public string GetCollege(string UserCode) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); DSUser.UserDataTable table = new DSUser.UserDataTable(); helper.FillCollege(table, UserCode); string college = string.Empty; if (table.Rows.Count != 0) { college = table.Rows[0]["College"].ToString(); } return(college); }
public string GetName(string UserCode) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); DSUser.UserDataTable table = new DSUser.UserDataTable(); helper.FillPsw(table, UserCode); string name = string.Empty; if (table.Rows.Count != 0) { name = table.Rows[0]["Name"].ToString(); } return(name); }
public int GetBranchID(string UserCode) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); DSUser.UserDataTable table = new DSUser.UserDataTable(); helper.FillPsw(table, UserCode); int i = 0; if (table.Rows.Count != 0) { i = Convert.ToInt32(table.Rows[0]["BranchID"].ToString()); } return(i); }
public bool AuthenticateUser(string username, string password, out string userId) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); DSUser.UserDataTable table = new DSUser.UserDataTable(); helper.Fill(table, username, password); if (table.Rows.Count == 0) { userId = ""; return(false); } else { userId = table.Rows[0]["UserCode"].ToString(); return(true); } }
public bool ChangePasword(string UserCode, string OldePassword, string NewPassword) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); DSUser.UserDataTable table = new DSUser.UserDataTable(); helper.FillPsw(table, UserCode); string Psw = table.Rows[0]["Password"].ToString(); if (Psw.Equals(OldePassword)) { helper.UpdatePasword(NewPassword, UserCode); return(true); } else { return(false); } }