Exemplo n.º 1
0
 //Update user into TabUser
 public int UpdateFromTabUser(string userName, string pwd, int userLevel, int UID)
 {
     try
     {
         return(_tableUserTableAdapter.UpdateUser(userName, pwd, userLevel, UID));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public int UpdateUser(int UID, string userName, string userEmail, int userLevel, string password)
        {
            var userData         = new UserData.TabUserDataTable();
            var userTableAdapter = new TabUserTableAdapter();

            if (UID > 0)
            {
                int countRow = userTableAdapter.UpdateUser(userName, password, userLevel, userEmail, UID);

                return(countRow);
            }
            return(0);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Update a user from User table.
 /// </summary>
 /// <param name="userName">string userName</param>
 /// <param name="password">string password</param>
 /// <param name="userLevel">int userLevel</param>
 /// <param name="userId">int userId</param>
 /// <returns>int rowsAffected</returns>
 /// <exception cref="ex">Exception</exception>
 public int UpdateUser(string userName, string userPassword, int userLevel, int userId)
 {
     try
     {
         return(_tabUserTableAdapter.UpdateUser(userName, userPassword, userLevel, userId));
     }
     catch (Exception ex)
     {
         //Error log simulate
         Console.WriteLine(ex.ToString());
         Console.WriteLine(ex.GetBaseException().ToString());
         throw;
     }
 }
 public bool IsUserUpdated(UserDTO updatedUser)
 {
     try
     {
         // update row using query
         tabUserTableAdapter.UpdateUser(updatedUser.UserName, updatedUser.Password, updatedUser.UserLevel, updatedUser.UserEmail, updatedUser.UID);
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
Exemplo n.º 5
0
        /*    public int UpdateUserById(int userId, string userName, string userPassword, int userLevel)
         *  {
         *      return _tabUserTableAdapter.UpdateUserPasswordByID(userPassword, userId);
         *  }
         */

        public int UpdateUser(string userName, string userPassword, int userLevel, int userId)
        {
            return(_tabUserTableAdapter.UpdateUser(userName, userPassword, userLevel, userId));
        }