public ActionResult Add(School 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 FixupSchool(School previousValue) { if (previousValue != null && previousValue.SchoolContacts.Contains(this)) { previousValue.SchoolContacts.Remove(this); } if (School != null) { if (!School.SchoolContacts.Contains(this)) { School.SchoolContacts.Add(this); } if (SchoolId != School.Id) { SchoolId = School.Id; } } }
private void FixupGruduateSchool(School previousValue) { if (previousValue != null && previousValue.Student_File.Contains(this)) { previousValue.Student_File.Remove(this); } if (GruduateSchool != null) { if (!GruduateSchool.Student_File.Contains(this)) { GruduateSchool.Student_File.Add(this); } if (GruduateSchoolId != GruduateSchool.Id) { GruduateSchoolId = GruduateSchool.Id; } } else if (!_settingFK) { GruduateSchoolId = null; } }
public void Delete(School entity) { this.Repository.Delete(entity); this.Db.Save(); }
public void Add(School entity) { this.Repository.Add(entity); this.Db.Save(); }
public void Update(School entity) { this.Repository.Update(entity); this.Db.Save(); }
public void Save(School entity) { if(entity.Id==0){ this.Add(entity); }else{ this.Db.Save(); } }
partial void BeforeUpdateData(School e, ref ActionResult ar);
partial void BeforeShowEditView(School e);
partial void BeforeAddData(School e, ref ActionResult ar);
partial void AfterUpdateData(School e, ref ActionResult ar);
partial void AfterAddData(School e, ref ActionResult ar);
partial void AddRowToGridModel(LigerGridModel m, School e);