Пример #1
0
 public ActionResult Add(SchoolContact 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;
 }
Пример #2
0
partial         void BeforeShowEditView(SchoolContact e);
Пример #3
0
partial         void BeforeUpdateData(SchoolContact e, ref ActionResult ar);
Пример #4
0
partial         void AfterAddData(SchoolContact e, ref ActionResult ar);
Пример #5
0
partial         void AfterUpdateData(SchoolContact e, ref ActionResult ar);
Пример #6
0
partial         void AddRowToGridModel(LigerGridModel m, SchoolContact e);
Пример #7
0
 public void Delete(SchoolContact entity)
 {
     this.Repository.Delete(entity);
     this.Db.Save();
 }
Пример #8
0
 public void Add(SchoolContact entity)
 {
     this.Repository.Add(entity);
     this.Db.Save();
 }
Пример #9
0
 public void Update(SchoolContact entity)
 {
     this.Repository.Update(entity);
     this.Db.Save();
 }
Пример #10
0
 public void Save(SchoolContact entity)
 {
     if(entity.Id==0){
         this.Add(entity);
     }else{
         this.Db.Save();
     }
 }