Пример #1
0
        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 -.-' ");
            }
        }
Пример #2
0
 public DetailNews(FoodN.Entity.Food food, FoodN.Entity.Account acc, int c)
 {
     check           = c;
     selectedAccount = acc;
     selectedFood    = food;
     InitializeComponent();
 }
Пример #3
0
        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 = "";
            }
        }
Пример #4
0
 public UserForm(FoodN.Entity.Account acc)
 {
     selectedAccount = acc;
     InitializeComponent();
 }