I tried this way:
using (ISession dbSession =
SessionProvider.Instance.SessionFactory.OpenSession())
{
using (ITransaction transaction =
dbSession.BeginTransaction())
{
Osoba newPerson = new Osoba
{
Imie = txtFirstName.Text,
SumaWydatkow =
Convert.ToInt32(numericSumaWydatkow.Value),
Dział = dbSession.Load<Dział>(Convert.ToInt32
(comboBox1.SelectedValue))
};
dbSession.Save(newPerson);
transaction.Commit();
MessageBox.Show("You have successfully added
person");
}
}
but i retrive an error:
Unable to cast object of type 'hms.core.Entities.Dział' to type
'System.IConvertible'.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.