Exemplo n.º 1
0
        public bool InsertUser(string userName, string emailAddress, bool isAdmin, string createdBy)
        {
            var newUser = new User();
                newUser.UserName = userName;
                newUser.EmailAddress = emailAddress;
                newUser.IsAdmin = isAdmin;
                newUser.CreatedBy = createdBy;
                newUser.DateCreated = DateTime.Now;
                newUser.ModifiedBy = createdBy;
                newUser.DateModified = DateTime.Now;

                return InsertUser(newUser);
        }
Exemplo n.º 2
0
 public bool InsertUser(User user)
 {
     try
     {
         _context.Users.Add(user);
         _context.SaveChanges();
         return true;
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex);
         //log some stuff
         return false;
     }
 }
Exemplo n.º 3
0
 public bool Updateuser(User user)
 {
     return UpdateUser(user.UserID, user.UserName, user.EmailAddress, user.IsAdmin.Value, user.ModifiedBy);
 }