protected void Button50_Click(object sender, EventArgs e) { BSubstitute bus = new BSubstitute(); Substitute sub = new Substitute(); sub.Person = new Person() { ID = 1436 }; sub.ManagerPersonId = 556; sub.TheFromDate = "1392/03/01"; sub.TheToDate = "1392/05/01"; sub.Active = true; bus.SaveChanges(sub, UIActionType.ADD); }
public void Insert_Test() { substitute_testObject.TheFromDate = Utility.ToPersianDate(DateTime.Now); substitute_testObject.TheToDate = Utility.ToPersianDate(DateTime.Now.AddDays(1)); substitute_testObject.ManagerPersonId = ADOManager1.Person.ID; substitute_testObject.Person = ADOPerson5; substitute_testObject.Active = true; busSubstitute.SaveChanges(substitute_testObject, UIActionType.ADD); ClearSession(); Assert.IsTrue(substitute_testObject.ID > 0); substitute_testObject = busSubstitute.GetByID(substitute_testObject.ID); Assert.IsNotNull(substitute_testObject.PrecardList); Assert.IsTrue(substitute_testObject.PrecardList.Count > 0); }