partial void DeleteState(State instance);
partial void UpdateState(State instance);
partial void InsertState(State instance);
private void detach_States(State entity) { this.SendPropertyChanging(); entity.Country = null; }
private void attach_States(State entity) { this.SendPropertyChanging(); entity.Country = this; }
public ActionResult AddState(StateModel smodel) { try { HolidayPlanner.DAL.State st = new HolidayPlanner.DAL.State() { StateId = smodel.StateId, StateName = smodel.StateName, CountryId=smodel.CountryId }; context.States.InsertOnSubmit(st); context.SubmitChanges(); return RedirectToAction("Index"); } catch { return View(smodel); } }