Exemplo n.º 1
0
 public bool AddUser(int roleId)
 {
     MonamurDBDataSetTableAdapters.V_usersTableAdapter v_usersTableAdap = new MonamurDBDataSetTableAdapters.V_usersTableAdapter();
     MonamurDBDataSet.V_usersDataTable v_usersDT = new MonamurDBDataSet.V_usersDataTable();
     v_usersTableAdap.FillByLogin(v_usersDT, Login);
     if (v_usersDT.Rows.Count == 0)
     {
         MonamurDBDataSetTableAdapters.UsersTableAdapter t_usersTableAdap = new MonamurDBDataSetTableAdapters.UsersTableAdapter();
         t_usersTableAdap.InsertUser(Login, Password, roleId);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 public bool ChangeProfilePassword(string oldPassword, string newPassword)
 {
     MonamurDBDataSetTableAdapters.V_usersTableAdapter v_usersTableAdap = new MonamurDBDataSetTableAdapters.V_usersTableAdapter();
     MonamurDBDataSet.V_usersDataTable v_usersDT = new MonamurDBDataSet.V_usersDataTable();
     v_usersTableAdap.FillById(v_usersDT, ID);
     if (oldPassword == v_usersDT.Rows[0]["password"].ToString())
     {
         MonamurDBDataSetTableAdapters.UsersTableAdapter t_usersTableAdap = new MonamurDBDataSetTableAdapters.UsersTableAdapter();
         t_usersTableAdap.UpdateUserPassword(newPassword, ID);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 3
0
 public bool ChangeProfileLogin(string newLogin)
 {
     MonamurDBDataSetTableAdapters.V_usersTableAdapter v_usersTableAdap = new MonamurDBDataSetTableAdapters.V_usersTableAdapter();
     MonamurDBDataSet.V_usersDataTable v_usersDT = new MonamurDBDataSet.V_usersDataTable();
     v_usersTableAdap.FillByLogin(v_usersDT, newLogin);
     if (v_usersDT.Rows.Count == 0)
     {
         MonamurDBDataSetTableAdapters.UsersTableAdapter t_usersTableAdap = new MonamurDBDataSetTableAdapters.UsersTableAdapter();
         t_usersTableAdap.UpdateUserProfile(newLogin, ID);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
 public bool EditUser(string newLogin, int newRoleId)
 {
     MonamurDBDataSetTableAdapters.V_usersTableAdapter v_usersTableAdap = new MonamurDBDataSetTableAdapters.V_usersTableAdapter();
     MonamurDBDataSet.V_usersDataTable v_usersDT = new MonamurDBDataSet.V_usersDataTable();
     v_usersTableAdap.FillByLogin(v_usersDT, newLogin);
     if ((v_usersDT.Rows.Count == 0) || ((v_usersDT.Rows.Count == 1) && (Convert.ToInt32(v_usersDT.Rows[0]["id"]) == ID)))
     {
         MonamurDBDataSetTableAdapters.UsersTableAdapter t_usersTableAdap = new MonamurDBDataSetTableAdapters.UsersTableAdapter();
         t_usersTableAdap.UpdateUserAllParams(newLogin, newRoleId, ID);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 5
0
 public void DeleteUser()
 {
     MonamurDBDataSetTableAdapters.UsersTableAdapter t_usersTableAdap = new MonamurDBDataSetTableAdapters.UsersTableAdapter();
     t_usersTableAdap.DeleteUser(ID);
 }
Exemplo n.º 6
0
 public bool ChangeUserPassword(string newPassword)
 {
     MonamurDBDataSetTableAdapters.UsersTableAdapter t_usersTableAdap = new MonamurDBDataSetTableAdapters.UsersTableAdapter();
     t_usersTableAdap.UpdateUserPassword(newPassword, ID);
     return(true);
 }