Exemple #1
0
 public void AddSystemUser(systemuser newUser)
 {
     using (var dbModel = new LMSDataModelEntities())
     {
         dbModel.systemusers.AddObject(newUser);
         dbModel.ObjectStateManager.ChangeObjectState(newUser, System.Data.EntityState.Added);
         var saveCount = dbModel.SaveChanges();
         if (saveCount < 1)
         {
             throw new Exception("Fail to insert system user " + newUser.FirstName + " " + newUser.LastName + " into DB");
         }
     }
 }
Exemple #2
0
        private void Fixupsystemuser(systemuser previousValue)
        {
            if (previousValue != null && previousValue.sessions.Contains(this))
            {
                previousValue.sessions.Remove(this);
            }

            if (systemuser != null)
            {
                if (!systemuser.sessions.Contains(this))
                {
                    systemuser.sessions.Add(this);
                }
                if (SystemUser_id != systemuser.Id)
                {
                    SystemUser_id = systemuser.Id;
                }
            }
        }
        private void Fixupsystemuser(systemuser previousValue)
        {
            if (previousValue != null && previousValue.studentbookloans.Contains(this))
            {
                previousValue.studentbookloans.Remove(this);
            }

            if (systemuser != null)
            {
                if (!systemuser.studentbookloans.Contains(this))
                {
                    systemuser.studentbookloans.Add(this);
                }
                if (IssuerID != systemuser.Id)
                {
                    IssuerID = systemuser.Id;
                }
            }
        }
Exemple #4
0
        private void Fixupsystemuser(systemuser previousValue)
        {
            if (previousValue != null && previousValue.books.Contains(this))
            {
                previousValue.books.Remove(this);
            }

            if (systemuser != null)
            {
                if (!systemuser.books.Contains(this))
                {
                    systemuser.books.Add(this);
                }
                if (AddedBy != systemuser.Id)
                {
                    AddedBy = systemuser.Id;
                }
            }
        }