partial void AfterUpdateData(EmploymentStudentVisitLog e, ref ActionResult ar) { ar = this.Json(new AjaxOperationResult { Data = this.ToJson(e), Successful = true }); }
private object ToJson(EmploymentStudentVisitLog e) { return new { Id=e.Id, StudentId=e.StudentId, VisitorId=e.VisitorId, Time=e.Time, Position=e.Position, Objective=e.Objective, Content=e.Content }; }
public ActionResult Add(EmploymentStudentVisitLog 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; }
partial void BeforeUpdateData(EmploymentStudentVisitLog e, ref ActionResult ar);
partial void BeforeShowEditView(EmploymentStudentVisitLog e);
partial void AfterAddData(EmploymentStudentVisitLog e, ref ActionResult ar);
partial void AddRowToGridModel(LigerGridModel m, EmploymentStudentVisitLog e);
public void Delete(EmploymentStudentVisitLog entity) { this.Repository.Delete(entity); this.Db.Save(); }
public void Add(EmploymentStudentVisitLog entity) { this.Repository.Add(entity); this.Db.Save(); }
public void Save(EmploymentStudentVisitLog entity) { if(entity.Id==0){ this.Add(entity); }else{ this.Db.Save(); } }
partial void AddRowToGridModel(LigerGridModel m, EmploymentStudentVisitLog e) { m.Rows.Add(this.ToJson(e)); }