Exemplo n.º 1
0
        private void Btn_Back_Click(object sender, EventArgs e)
        {
            EmployeeHomepage backto = new EmployeeHomepage();

            backto.Show();
            this.Close();
        }
Exemplo n.º 2
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();
            }
        }
        private void Btn_Create_Click(object sender, EventArgs e)
        {
            if (status is null)
            {
                MessageBox.Show("Please check availability...");
            }

            else
            {
                Class_NewAccount newaccount = new Class_NewAccount();
                int EmployeeNewAccount      = newaccount.EmployeeNewAccount(Tb_Fullname.Text, Rbtn_Male.Checked, Tb_Phone.Text, Tb_Address.Text, Tb_Username.Text, Tb_Password.Text, Tb_Email.Text, Tb_Department.Text);

                if (EmployeeNewAccount != 0)
                {
                    MessageBox.Show("Your account was Created successfully!");
                    EmployeeHomepage forwardtoemp = new EmployeeHomepage();
                    this.Close();
                    forwardtoemp.Show();
                }
            }
        }
Exemplo n.º 4
0
        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";
            }
        }