コード例 #1
0
        private void Btn_Back_Click_1(object sender, EventArgs e)
        {
            if (Class_Login.UserType == "Employee" || Class_Login.UserType == "Adminstrator")
            {
                EmployeeHomepage backto = new EmployeeHomepage();
                backto.Show();
                this.Close();
            }

            if (Class_Login.UserType == "Customer")
            {
                CustomerHomepage backto = new CustomerHomepage();
                backto.Show();
                this.Close();
            }
        }
コード例 #2
0
ファイル: Form_Login.cs プロジェクト: mansourarab/MarabComSal
        private void Btn_Login_Click(object sender, EventArgs e)
        {
            Class_Login newlogin = new Class_Login();
            int?        AccountId;
            string      UserType;
            string      Uname;

            int result = newlogin.CheckUser(Tb_Username.Text, Tb_Password.Text, out AccountId, out UserType, out Uname);

            if (result == 1)
            {
                lbl_status.ForeColor = System.Drawing.Color.Green;
                lbl_status.Text      = "Loggied in Successfully!";

                Class_Login.AccountId = AccountId;
                Class_Login.UserType  = UserType;
                Class_Login.uname     = Uname;

                if (UserType == "Employee" || UserType == "Adminstrator")
                {
                    EmployeeHomepage Hform = new EmployeeHomepage();
                    this.Close();
                    Hform.Show();
                }

                if (UserType == "Customer")
                {
                    CustomerHomepage Hform = new CustomerHomepage();
                    this.Close();
                    Hform.Show();
                }
            }
            else
            {
                lbl_status.ForeColor = System.Drawing.Color.Red;
                lbl_status.Text      = "Invalid Info";
            }
        }