예제 #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();
     }
 }