コード例 #1
0
        private void btnEmplyeeRegistration_Click(object sender, EventArgs e)        //Register User in the Database
        {
            EmployeeRegisterLogin register = new EmployeeRegisterLogin();
            int      EmpID       = Convert.ToInt32(txtEmpID.Text.Trim());
            string   EmpName     = txtEmpFullname.Text.Trim();
            string   EmpEmail    = txtEmail.Text.Trim();
            string   EmpNIC      = txtEmpNIC.Text.Trim();
            string   EmpContact  = txtEmpContact.Text.Trim();
            string   EmpCategory = cmbEmpJobCategory.Text.Trim();
            string   EmpPassword = txtEmpPassword.Text.Trim();
            double   Salary      = Convert.ToDouble(txtSalary.Text.Trim());
            DateTime EmpJoin     = DateTime.Now;
            string   EmpJoinDate = EmpJoin.ToString("yyyy-MM-dd");

            if (txtEmpID.Text == "" || txtEmpFullname.Text == "" || txtEmpFullname.Text == "" || txtEmail.Text == "" || txtEmpNIC.Text == "" || txtEmpContact.Text == "" || cmbEmpJobCategory.Text == "" || txtEmpPassword.Text == "" || txtSalary.Text == "")
            {
                MessageBox.Show("Fill All Feilds With Relavant Details");
            }
            else if (txtEmpPassword.Text != txtEmpRePassword.Text)
            {
                MessageBox.Show("Two Passwords Doesn't Match");
            }
            else
            {
                register.EmployeeRegistration(EmpID, EmpName, EmpEmail, EmpNIC, EmpContact, EmpCategory, EmpJoinDate, EmpPassword, Salary);
            }
            Clear();
        }
コード例 #2
0
        void FillCombo_with_EmployeeID()
        {
            EmployeeRegisterLogin log   = new EmployeeRegisterLogin();
            List <string>         range = log.FillComboLoginID();

            foreach (string item in range)
            {
                cmbLogEmpID.Items.Add(item);
            }
        }
コード例 #3
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();
                    }
                }
            }
        }