public ActionResult Add(District e) { ActionResult ar = null; try { this.BeforeAddData(e, ref ar); if (ar == null) { this.Service.Add(e); e = this.Service.FindById(e.Id); //ar = this.Json(new AjaxOperationResult { Data = e, Successful = true }); this.AfterAddData(e, ref ar); } } catch (Exception ex) { ar = this.Json(new AjaxOperationResult { Successful = false, Message = ex.Message }); } return ar; }
private void FixupDistrict(District previousValue) { if (previousValue != null && previousValue.Student_File.Contains(this)) { previousValue.Student_File.Remove(this); } if (District != null) { if (!District.Student_File.Contains(this)) { District.Student_File.Add(this); } if (DistrictId != District.Id) { DistrictId = District.Id; } } else if (!_settingFK) { DistrictId = null; } }
partial void BeforeUpdateData(District e, ref ActionResult ar);
partial void BeforeShowEditView(District e);
partial void BeforeAddData(District e, ref ActionResult ar);
partial void AfterUpdateData(District e, ref ActionResult ar);
partial void AfterAddData(District e, ref ActionResult ar);
partial void AddRowToGridModel(LigerGridModel m, District e);