Ejemplo n.º 1
0
        private void btnDeliver_Click(object sender, EventArgs e)
        {
            Orders orderUpdate = new Orders();

            if (radioAgent.Checked == false)
            {
                MessageBox.Show("Please Check Delivery Status Before Continue");
            }
            else
            {
                orderUpdate.Update_Deliver_Order(Convert.ToInt32(cmbOrderID.Text));
                DeliveryAgentArea agent = new DeliveryAgentArea();
                cmbOrderID.ResetText();
                txtTableID.Clear();
                FillCombo_withOrderID();
                this.Dispose();
                agent.Show();
            }
        }
Ejemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            EmployeeRegisterLogin login = new EmployeeRegisterLogin();

            if (cmbLogEmpID.Text == "" || txtLogEmpMail.Text == "" || txtLogEmpPass.Text == "" || cmbLogType.Text == "")
            {
                MessageBox.Show("Fill All the Fields");
            }
            else if (cmbLogEmpID.Text != "" && txtLogEmpMail.Text != "" && txtLogEmpPass.Text != "" && cmbLogType.Text != "")
            {
                string   Category     = cmbLogType.Text;
                int      EmpID        = Convert.ToInt32(cmbLogEmpID.Text);
                string   Mail         = txtLogEmpMail.Text;
                string   Password     = txtLogEmpPass.Text;
                DateTime attendance   = DateTime.Now;
                string   EmpAttendace = attendance.ToString("yyyy-MM-dd");
                string   Time         = attendance.ToString("hh:mm:ss");

                if (chkAttendance.Checked)
                {
                    login.Attendance(EmpID, EmpAttendace, Time);
                }

                if (login.EmployeeLogin(Category, Mail, Password))
                {
                    if (Category == "Manager")
                    {
                        AdminArea admin = new AdminArea();
                        this.Hide();
                        admin.Show();
                    }

                    else if (Category == "Accountant")
                    {
                        AccounantArea account = new AccounantArea();
                        this.Hide();
                        account.Show();
                    }

                    if (Category == "Cashier")
                    {
                        Employee.Cashier cash = new Employee.Cashier();
                        this.Hide();
                        cash.Show();
                    }

                    else if (Category == "Chef")
                    {
                        ChefArea chef = new ChefArea();
                        this.Hide();
                        chef.Show();
                    }

                    else if (Category == "Delivery Agent")
                    {
                        DeliveryAgentArea agent = new DeliveryAgentArea();
                        this.Hide();
                        agent.Show();
                    }
                }
            }
        }