partial void AfterUpdateData(User e, ref ActionResult ar) { ar = this.Json(new AjaxOperationResult { Data = this.ToJson(e), Successful = true }); }
private object ToJson(User e) { return new { Id=e.Id, Name=e.Name, Password=e.Password, Status=e.Status, LastLoginTime=e.LastLoginTime, LastLoginIP=e.LastLoginIP, DefaultUrl=e.DefaultUrl }; }
private void FixupUser(User previousValue) { if (previousValue != null && previousValue.Supervisors.Contains(this)) { previousValue.Supervisors.Remove(this); } if (User != null) { if (!User.Supervisors.Contains(this)) { User.Supervisors.Add(this); } if (UserId != User.Id) { UserId = User.Id; } } }
private void FixupVisitor(User previousValue) { if (previousValue != null && previousValue.EmploymentStudentVisitLogs.Contains(this)) { previousValue.EmploymentStudentVisitLogs.Remove(this); } if (Visitor != null) { if (!Visitor.EmploymentStudentVisitLogs.Contains(this)) { Visitor.EmploymentStudentVisitLogs.Add(this); } if (VisitorId != Visitor.Id) { VisitorId = Visitor.Id; } } }
private void FixupSalesman(User previousValue) { if (previousValue != null && previousValue.Marketing_TelSaleLog.Contains(this)) { previousValue.Marketing_TelSaleLog.Remove(this); } if (Salesman != null) { if (!Salesman.Marketing_TelSaleLog.Contains(this)) { Salesman.Marketing_TelSaleLog.Add(this); } if (SalesmanId != Salesman.Id) { SalesmanId = Salesman.Id; } } }
public void Delete(User entity) { this.DbContext.Users.DeleteObject(entity); }
partial void AddRowToGridModel(LigerGridModel m, User e) { m.Rows.Add(this.ToJson(e)); }
private void FixupTeacher2(User previousValue) { if (previousValue != null && previousValue.Student_File4.Contains(this)) { previousValue.Student_File4.Remove(this); } if (Teacher2 != null) { if (!Teacher2.Student_File4.Contains(this)) { Teacher2.Student_File4.Add(this); } if (TeacherId2 != Teacher2.Id) { TeacherId2 = Teacher2.Id; } } else if (!_settingFK) { TeacherId2 = null; } }
private void FixupMaster3(User previousValue) { if (previousValue != null && previousValue.Student_File2.Contains(this)) { previousValue.Student_File2.Remove(this); } if (Master3 != null) { if (!Master3.Student_File2.Contains(this)) { Master3.Student_File2.Add(this); } if (MasterId3 != Master3.Id) { MasterId3 = Master3.Id; } } else if (!_settingFK) { MasterId3 = null; } }
public void Add(User entity) { this.Repository.Add(entity); this.Db.Save(); }
public void Update(User entity) { this.Repository.Update(entity); this.Db.Save(); }
public void Save(User entity) { if(entity.Id==0){ this.Add(entity); }else{ this.Db.Save(); } }
partial void AfterUpdateData(User e, ref ActionResult ar);
partial void AfterAddData(User e, ref ActionResult ar);
private void FixupMaster1(User previousValue) { if (previousValue != null && previousValue.Student_File.Contains(this)) { previousValue.Student_File.Remove(this); } if (Master1 != null) { if (!Master1.Student_File.Contains(this)) { Master1.Student_File.Add(this); } if (MasterId1 != Master1.Id) { MasterId1 = Master1.Id; } } else if (!_settingFK) { MasterId1 = null; } }
public void Delete(User entity) { this.Repository.Delete(entity); this.Db.Save(); }
private void FixupMaster2(User previousValue) { if (previousValue != null && previousValue.Student_File1.Contains(this)) { previousValue.Student_File1.Remove(this); } if (Master2 != null) { if (!Master2.Student_File1.Contains(this)) { Master2.Student_File1.Add(this); } if (MasterId2 != Master2.Id) { MasterId2 = Master2.Id; } } else if (!_settingFK) { MasterId2 = null; } }
public void Update(User entity) { var e = this.FindById(entity.Id); if (e != null) { e.Name = entity.Name; e.Password = entity.Password; e.Status = entity.Status; e.LastLoginTime = entity.LastLoginTime; e.LastLoginIP = entity.LastLoginIP; e.DefaultUrl = entity.DefaultUrl; } //if (this.FindById(entity.Id) != null) { // this.DbContext.Users.Attach(entity); // this.DbContext.ObjectStateManager.ChangeObjectState(entity, System.Data.EntityState.Modified); //} }
private void FixupTeacher1(User previousValue) { if (previousValue != null && previousValue.Student_File3.Contains(this)) { previousValue.Student_File3.Remove(this); } if (Teacher1 != null) { if (!Teacher1.Student_File3.Contains(this)) { Teacher1.Student_File3.Add(this); } if (TeacherId1 != Teacher1.Id) { TeacherId1 = Teacher1.Id; } } else if (!_settingFK) { TeacherId1 = null; } }
public void Add(User entity) { this.DbContext.Users.AddObject(entity); }
private void FixupTeacher3(User previousValue) { if (previousValue != null && previousValue.Student_File5.Contains(this)) { previousValue.Student_File5.Remove(this); } if (Teacher3 != null) { if (!Teacher3.Student_File5.Contains(this)) { Teacher3.Student_File5.Add(this); } if (TeacherId3 != Teacher3.Id) { TeacherId3 = Teacher3.Id; } } else if (!_settingFK) { TeacherId3 = null; } }
partial void AddRowToGridModel(LigerGridModel m, User e);