|
This is not the place to post these.
|
|
|
|
|
Ah, ok. Could you guide me to the right one please? Thanks!
Victoria F
|
|
|
|
|
CP doesn't have a jobs board any more.
|
|
|
|
|
Darn! OK, thanks for letting me know. Apologies for any inconvenience.
Victoria F
|
|
|
|
|
Victoria Feng wrote: The ideal candidate would be excited to learn Try the nut-house.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I have four related tables
AttoreTipo (1..n) Attore (1..n) CommessaAttore (n..1) Commessa.
AttoreTipo is a lookup table
i'm using entityframework 6 code first with repository and UnitOfWork patterns.
the model is:
public class Attore
{
public int Id { get; set; }
public int IdTipo { get; set; }
public string Nome { get; set; }
public string Cognome { get; set; }
public virtual ICollection<CommessaAttore> CommessaAttore { get; set; }
public virtual AttoreTipo AttoreTipo { get; set; }
}
public class AttoreTipo
{
public int Id { get; set; }
public string Tipo { get; set; }
public DateTime CreateDate { get; set; }
public DateTime? UpdateDate { get; set; }
public virtual ICollection<Attore> Attore { get; set; }
}
public class CommessaAttore
{
public int Id { get; set; }
public int IdCommessa { get; set; }
public int IdAttore { get; set; }
public DateTime CreateDate { get; set; }
public DateTime? UpdateDate { get; set; }
public virtual Commessa Commessa { get; set; }
public virtual Attore Attore { get; set; }
}
public class Commessa
{
public int Id { get; set; }
public string Descrizione { get; set; }
public DateTime EndDate { get; set; }
public DateTime CreateDate { get; set; }
public DateTime? UpdateDate { get; set; }
public virtual ICollection<CommessaAttore> CommessaAttore { get; set; }
}
In the aspx page, in the same button click event, i call the repository's method AddCommessaAttore(CommessaAttore commessaattore)
,where CommessaAttore has the attore property value by an Attore entity. Attore entity has an attoretipo prop. (attoretipo entity) not set because is a lookup table. Next i call getCommessaAttoriByCommessaId method, that read all commessaattore records by a given idcommessa, to fill a gridview,
but the AttoreTipo result always null. Entity framework don't resolve AttoreTipo entity
public CommessaAttore AddCommessaAttore(CommessaAttore commessaattore)
{
repository.Add(commessaattore);
SaveChanges();
return commessaattore;
}
public IEnumerable<CommessaAttore> GetCommessaAttoriByCommessaId(int idcommessa)
{
var activities = repository.GetMany(commatts => commatts.IdCommessa == idcommessa);
return activities;
}
thanks
|
|
|
|
|
Did you define a relation between the two tables? If you open the database using Sql Management Studio, and generate a diagram of the tables, does it show a line between the lookup-table and the table in which it is used?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Yes tables are related. Anyway i solved using include and specifying tables attore.attore tipo. Thanks
|
|
|
|
|
Sorry, sounded like something that simple might have been overlooked.. attore, an 'actor type'?
You're welcome
|
|
|
|
|
If you're using POCOs and not setting up your own Model binder with the fluent API, you need to use attributes to indicate your keys and relationships.
public class Attore
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity), Display(AutoGenerateField = false)]
public int Id { get; set; }
[ForeignKey("AttoreTipo")]
public int IdTipo { get; set; }
public string Nome { get; set; }
public string Cognome { get; set; }
public virtual ICollection<CommessaAttore> CommessaAttore { get; set; }
public virtual AttoreTipo AttoreTipo { get; set; }
}
And so on. The EF doesn't know what you intend to use for keys unless you are explicit about it, the virtual properties give it a hook for a relation, but unless the FK is defined it has nothing to hook to.
|
|
|
|
|
Hi,
I need to make FolderBrowserDialog in asp.net and that should show all the drives present in the client system and i should get full folder path of the client system so that i can save the files in selected client folder.
How to achieve this.
If anybody knows, please reply me.
Thanks in advance.
|
|
|
|
|
|
You can't without using an unsecure technology like ActiveX or Flash, or downloading an executable to the client side to run. It would represent a massive security hole if a website were able to get full access to the filesystem.
|
|
|
|
|
In a .bat file, I need to find the 32-bit .NET Framework InstallPath on a 64-bit machine. Following is my code snippet:
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP" /s|FIND "InstallPath"|FIND "4.0."
However, it returns the InstallPath for 64bit:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
I actually need is something like:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\
Any suggestions are appreciated.
|
|
|
|
|
Have you tried searching the Wow6432Node ?
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP" /s|FIND "InstallPath"|FIND "4.0."
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Wow! It works! Thank you very much! The name looks odd. What does the number mean? Will MS change it?
|
|
|
|
|
As far as I'm aware, it refers to "Windows 32-bit on Windows 64-bit". The name hasn't changed since 64-bit support was added to Windows, and is unlikely to change in the future.
http://en.wikipedia.org/wiki/WoW64[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have a table with a status column
The data is inserted with the status "treaty" and inserted again the status input,
I would make sure that the number of treated equals the number of input and forbid the insertion if the number exceeds the treaty.
Thank you in advance.
|
|
|
|
|
Your question is not very clear, but it suggests that you should select all the records with each status and get the counts. Then compare the counts and insert or not as you need.
|
|
|
|
|
Hi,
I need to send mail (not receive) from my application running on Windows Embedded Compact 7 (Compact Framework 3.5).
After a lot of googling and some test with EaSendMail, mailcf, cslmail... I found OpenNETCF that looks very promising but I'm not able to use it...
I can use other component of OpenNETCF but not the one I need: OpenNETCF.Net.Mail.
Simply my application doesn't compile when I add to the project a reference to OpenNETCF.Net.Mail.dll.
To get this problem it is enough to create a new SmartDevice project (VS2008, VB.NET, CF3.5) and in the property of the project to add a reference to OpenNETCF.Net.Mail.dll: the project doesn't compile any more. I just get a warning about a version conflict and no error:
Consider app.config remapping of assembly "System, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "2.0.0.0" [] to Version "3.5.0.0" [C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.dll] to solve conflict and get rid of warning.<br />
C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3247: Found conflicts between different versions of the same dependent assembly.
Searching info about that warning I found that it is "safe" to ignore it because the OpenNETCF version that I'm using (2.3.12004.0) is compatible with CF3.5.
If I remove the reference to OpenNETCF.Net.Mail.dll and I add a reference to OpenNETCF.Windows.Forms.dll I get 5 warnings about remapping but the project compiles.
I have already posted this question in another forum without getting any answer, I hope here someone could help me.
Any suggestion is appreciated, also about other free component to send mail.
Thanks in advance.
|
|
|
|
|
Hi,
it seems that this topic is not very interesting but I've found the solution and I want to share it.
I contacted OpenNETCF support and Chris Tacke answered very kindly.
The solution is to remove from project references System.Xml.Linq that for some reason sometimes generates this kind of problem in VB.NET CF 3.5 projects.
|
|
|
|
|
Hello everyone,
my application is a SmartDevice application and it runs on a device with Windows Embedded Compact 7 OS, so it relies on Compact Framwork 3.5.
Here is my problem (simplified): I have two forms, in the first form there is a Textbox and when it gets focus the second form pops up (I use form2.ShowDialog()).
The second form is a little numeric keypad that I use to write numbers in the textbox of the first form. This second form has also an OK button that close the form.
Is there a way to rise the TextChanged event of the textbox in the first form from the click event of the OK button in the second form (the OK button click doesn't write anything in the textbox)?
Thanks in advance.
|
|
|
|
|
No, because the OK button Click code should not know ANYTHING about the form that created and showed it.
Since you're using ShowDialog in the parent form, you could just call the method that does whatever you have in the TextChanged event handler.
You DID move your TextChanged event code to a seperate method, correct? Don't put your work code in the event handler. Put it in its own seperate method and call that from the TextChanged event handler code. That way you can call it fdrom anywhere else you need to in your code without having to worry about how you're needlessly going to trigger events.
|
|
|
|
|
Thanks Dave,
you have answered my question: I can't do what I wanted to do...
I have not moved my TextChanged event code to a seperate method, but I have an alibi!
In my application there are many textbox in different pages (UserControls) that call the same numeric keypad, so in the code in the keypad there is no reference to a specific method.
The keypad just knows which textbox is the caller and it writes in it.
It works but I wanted to improve it because the TextChanged event is raised anytime I write a digit from the keypad and not when I close the keypad clicking the OK button.
I wanted to do the opposite.
I can avoid the TextChanged event with a flag but to rise it by the OK button I have to use also this button to write something, for example I could write and delete a space.
Thank you.
|
|
|
|
|
steve_9496613 wrote: I have not moved my TextChanged event code to a seperate method, but I have an alibi!
No you don't. It doesn't matter at all what the situation is. Moving the code to a separate method is always better than leaving it the event handler method. The sole exception being events that expect a return value in the form of a modified event argument, such as FormClosing.
If the keypad knows which control it's "typing" in that's OK and even useful in this case. The keypad doesn't necessarily need its own TextBox to type into, but does need some way of display the entered text without showing it in the target textbox. When OK is hit, the control then copies the text into the target TextBox thereby raising the TextChanged event in the target control only once.
|
|
|
|