public void getCha() { string accountName = tbUser.Text; string accountPass = tbPass.Text; if (!string.IsNullOrEmpty(accountName) && !string.IsNullOrEmpty(accountPass)) { account = FoodN.Entity.AdminLogin.getAdminLogin(accountName, accountPass); if (account.roleID == 1) { this.Hide(); ManageInfo m = new ManageInfo(); m.Show(); } else { this.Hide(); UserForm u = new UserForm(account); u.Show(); } } else { MessageBox.Show("Please fill all the content -.-' "); } }
public DetailNews(FoodN.Entity.Food food, FoodN.Entity.Account acc, int c) { check = c; selectedAccount = acc; selectedFood = food; InitializeComponent(); }
protected void btnLogin_Click(object sender, EventArgs e) { try { string accountName = tbUsername.Text; string accountPass = tbPassword.Text; if (!string.IsNullOrEmpty(accountName) && !string.IsNullOrEmpty(accountPass)) { account = FoodN.Entity.AdminLogin.getAdminLogin(accountName, accountPass); if (account.roleID == 1) { lbError.Text = "Account doesn't exist"; tbUsername.Text = ""; tbPassword.Text = ""; } else { Session["accID"] = account.accountID; Session["accName"] = account.accountName; Session["accPass"] = account.accountPass; Session["accRole"] = account.roleID; Response.Redirect("HomePage.aspx"); } } else { lbError.Text = "Please fill all the content -.-' "; } } catch { lbError.Text = "Account doesn't exist"; tbUsername.Text = ""; tbPassword.Text = ""; } }
public UserForm(FoodN.Entity.Account acc) { selectedAccount = acc; InitializeComponent(); }