Пример #1
0
partial         void AfterUpdateData(User e, ref ActionResult ar)
        {
            ar = this.Json(new AjaxOperationResult {
                Data = this.ToJson(e),
                Successful = true
            });
        }
Пример #2
0
 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
         };
 }
Пример #3
0
        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;
                }
            }
        }
Пример #4
0
        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;
                }
            }
        }
Пример #5
0
        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;
                }
            }
        }
Пример #6
0
 public void Delete(User entity)
 {
     this.DbContext.Users.DeleteObject(entity);
 }
Пример #7
0
partial         void AddRowToGridModel(LigerGridModel m, User e)
        {
            m.Rows.Add(this.ToJson(e));
        }
Пример #8
0
        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;
            }
        }
Пример #9
0
        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;
            }
        }
Пример #10
0
 public void Add(User entity)
 {
     this.Repository.Add(entity);
     this.Db.Save();
 }
Пример #11
0
 public void Update(User entity)
 {
     this.Repository.Update(entity);
     this.Db.Save();
 }
Пример #12
0
 public void Save(User entity)
 {
     if(entity.Id==0){
         this.Add(entity);
     }else{
         this.Db.Save();
     }
 }
Пример #13
0
partial         void AfterUpdateData(User e, ref ActionResult ar);
Пример #14
0
partial         void AfterAddData(User e, ref ActionResult ar);
Пример #15
0
        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;
            }
        }
Пример #16
0
 public void Delete(User entity)
 {
     this.Repository.Delete(entity);
     this.Db.Save();
 }
Пример #17
0
        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;
            }
        }
Пример #18
0
 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);
     //}
 }
Пример #19
0
        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;
            }
        }
Пример #20
0
 public void Add(User entity)
 {
     this.DbContext.Users.AddObject(entity);
 }
Пример #21
0
        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;
            }
        }
Пример #22
0
partial         void AddRowToGridModel(LigerGridModel m, User e);