protected void Page_Load(object sender, EventArgs e) { if (!User.Identity.IsAuthenticated) { ScriptManager.RegisterStartupScript(this, this.GetType(), "ToLoginPage", "location.href='Login.aspx';", true); return; } else { DSUserTableAdapters.UserTableAdapter user = new DSUserTableAdapters.UserTableAdapter(); lblName.Text = user.ScalarQuery(User.Identity.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 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 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); } }
public string GetAccount(string userCode) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); return(helper.GetAccount(userCode)); }
public void UpdateUser(string account, int branchID, string name, string tel, string sex, string userCode) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); helper.UpdateUserByUserCode(account, branchID, name, tel, sex, userCode); }
public void InsertUser(string userCode, string account, string name, string sex, int branchID, string password, string tel, DateTime createTime, bool isDelete, bool isAvailable, bool isLockOut) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); helper.InsertUser(account, userCode, password, branchID, name, tel, sex, createTime, isDelete, isAvailable, isLockOut); }
public DataTable GetUsersByBranchId(int BranchId) { DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter(); return(helper.GetUsersByBranchId(BranchId)); }