public string GetUserRole() { MonamurDBDataSetTableAdapters.V_usersTableAdapter v_usersTableAdapter = new MonamurDBDataSetTableAdapters.V_usersTableAdapter(); MonamurDBDataSet.V_usersDataTable v_usersDataTable = new MonamurDBDataSet.V_usersDataTable(); v_usersTableAdapter.FillById(v_usersDataTable, ID); return(v_usersDataTable.Rows[0]["role"].ToString()); }
public void UpdateProfile() { MonamurDBDataSetTableAdapters.V_usersTableAdapter v_usersTableAdap = new MonamurDBDataSetTableAdapters.V_usersTableAdapter(); MonamurDBDataSet.V_usersDataTable v_usersDT = new MonamurDBDataSet.V_usersDataTable(); v_usersTableAdap.FillById(v_usersDT, ID); Login = v_usersDT.Rows[0]["login"].ToString(); }
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); } }