コード例 #1
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmMainPanel frm = new frmMainPanel();

            frm.Show();
        }
コード例 #2
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            frmMainPanel mainPanel = new frmMainPanel();

            this.Hide();
            mainPanel.Show();
        }
コード例 #3
0
        private void frmSignUp_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmMainPanel tp = new frmMainPanel();

            tp.Show();
        }
コード例 #4
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmMainPanel tp = new frmMainPanel();

            tp.Show();
        }
コード例 #5
0
        private void btnGoBack_Click(object sender, EventArgs e)
        {
            this.Hide();

            if (emp.getDesignation().Equals("Admin"))
            {
                frmAdminPanel frm = new frmAdminPanel(emp);
                frm.Show();
            }
            else if (emp.getDesignation().Equals("Manager"))
            {
                frmGMPanel frm = new frmGMPanel(emp);
                frm.Show();
            }
            else if (emp.getDesignation().Equals("Operator"))
            {
                frmOperatorPanel frm = new frmOperatorPanel(emp);
                frm.Show();
            }
            else
            {
                frmMainPanel frm = new frmMainPanel();
                this.Hide();
                frm.Show();
            }
        }
コード例 #6
0
        private void aloginpage_FormClosing(object sender, FormClosingEventArgs e)
        {
            frmMainPanel tp = new frmMainPanel();

            tp.Show();
        }
コード例 #7
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            String gender = null;

            if (rdoMale.Checked && !rdoFemale.Checked)
            {
                gender = "male";
            }
            else if (!rdoMale.Checked && rdoFemale.Checked)
            {
                gender = "female";
            }
            else if (rdoMale.Checked && rdoFemale.Checked)
            {
                MessageBox.Show("Error Invalid Selection: Select only one gender!");
                return;
            }
            else
            {
                MessageBox.Show("Please Select a gender!");
                return;
            }

            Person          person  = new Person();
            EmployeeAddress address = new EmployeeAddress();

            person.setFirstName(txtFirstName.Text);
            person.setMiddleName(txtMiddleName.Text);
            person.setLastName(txtLastName.Text);
            String[] phoneNo = { txtPhoneNo1.Text, txtPhoneNo2.Text, txtPhoneNo3.Text };
            String[] cellNo  = { txtCellNo1.Text, txtCellNo2.Text, txtCellNo3.Text };
            person.setPhoneNo(phoneNo);
            person.setCellNo(cellNo);
            person.setCNIC(txtCNIC.Text);
            person.setGender(gender);
            person.setEmail(txtEmail.Text);
            person.setDateOfBirth(dateTimePickerDob.Value);
            address.setCity(txtCity.Text);
            address.setCountry(txtCountry.Text);
            address.setHouseNo(txtHouseNo.Text);
            address.setStreet(txtStreet.Text);
            address.setZipCode(int.Parse(txtZipCode.Text));
            address.setProvince(txtProvince.Text);
            Employee emp = new Employee();

            emp.setPersonalInformation(person);
            emp.setAddress(address);
            emp.setDesignation(txtDesignation.Text);
            emp.setRank(txtRank.Text);
            emp.setQualification(txtQualification.Text);
            emp.setPassword(txtPassword.Text);
            emp.setSalary(int.Parse(txtSalary.Text));
            emp.setDateOfHire(dateTimePickerDoh.Value);
            Database db = new Database();

            if (db.insertEmployee(emp))
            {
                MessageBox.Show("Employee Successfully Registered! Wait for approval");
                this.Hide();
                frmMainPanel mainPanel = new frmMainPanel();
                mainPanel.Show();
            }
            else
            {
                MessageBox.Show("Unable to register employee!");
            }
        }