public override void CreateDetail() { var hp = new PermitForHoisting() { BaseAppID = NewlyInsertedBaseAppID, TypeOfWork = "Install", OccupationDate = DateTime.Today.AddDays(3), //? OccupationTimeStart = "9 AM", OccupationTimeEnd = "6 PM", TypeOfTruck = 0, DutyCopOnly = false, }; Db.PermitForHoistings.Add(hp); try { //Check Validation Errors var error = Db.GetValidationErrors(); Db.SaveChanges(); NewlyInsertedID = hp.AppID; } catch (DbEntityValidationException dbEx) { var s = dbEx.Message; } }
public MyApplicationForHoistingPermit(int baseAppID) : base(baseAppID) { Value = _db.PermitForHoistings.First(x => x.BaseAppID == BaseValue.BaseAppID); _appID = Value.AppID; }
public MyApplicationForHoistingPermit(int baseAppID, int appID) : base(baseAppID) { _appID = appID; Value = _db.PermitForHoistings.Find(appID); }