Esempio n. 1
0
 private void EmployeeManagementForm_Load(object sender, EventArgs e)
 {
     MdlOptionsManagement.getEmployeeManagementAllowedFunctionalities();
     MdlControllerModifier.clearFields();
     MdlEmpManagement.populateEmployeeList(BunifuDataGridView1, employeeStatus);
     firstLoad = false;
 }
Esempio n. 2
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            // if suspend is selected
            selectedRow = employeDataGridView.CurrentRow.Index;
            employeeID  = Conversions.ToInteger(employeDataGridView.Rows[selectedRow].Cells[6].Value);
            if (TabControl1.SelectedIndex == 0)
            {
                db.suspendOrTerminateEmployee(employeeID, "Suspension", fromDateTimePicker1.Value.Date, senpensionReasonRichTextBox1.Text);
                db.reinstateEmployee(employeeID, "Suspended");
            }

            // if terminate is selected
            else if (TabControl1.SelectedIndex == 1)
            {
                MdlModifyData.terminateEmployee(terminationDateTimePicker.Value);
                terminationDateTimePicker.Value = DateAndTime.Today.Date;
                db.suspendOrTerminateEmployee(employeeID, "Termination", terminationDateTimePicker.Value.Date, terminationREasonRichTextBox2.Text);
            }

            // if reinstate is selected
            else if (TabControl1.SelectedIndex == 2)
            {
                db.reinstateEmployee(employeeID, "Active");
                db.suspendOrTerminateEmployee(employeeID, "Reinstatement", reinstateDateTimePicker3.Value.Date, reinstateNoteRichTextBox1.Text);
            }

            MdlEmpManagement.populateEmployeeList(My.MyProject.Forms.FrmEmployeeManagement.BunifuDataGridView1, My.MyProject.Forms.FrmEmployeeManagement.employeeStatus);
            Close();
        }
Esempio n. 3
0
        public static void suspendEmployee(DateTime terminationDate)
        {
            employeDataGridView = My.MyProject.Forms.FrmEmployeeManagement.BunifuDataGridView1;
            int selectedRow = employeDataGridView.CurrentRow.Index;

            employeeID = Conversions.ToInteger(employeDataGridView.Rows[selectedRow].Cells[6].Value);
            db.TerminateEmployee(employeeID, terminationDate);
            MdlEmpManagement.populateEmployeeList(My.MyProject.Forms.FrmEmployeeManagement.BunifuDataGridView1, My.MyProject.Forms.FrmEmployeeManagement.employeeStatus);
        }
Esempio n. 4
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            selectedRow = BunifuDataGridView1.CurrentCell.RowIndex;
            string firstName = Conversions.ToString(BunifuDataGridView1.Rows[selectedRow].Cells[1].Value);
            string lastName  = Conversions.ToString(BunifuDataGridView1.Rows[selectedRow].Cells[2].Value);

            employeeID = Conversions.ToInteger(BunifuDataGridView1.Rows[selectedRow].Cells[6].Value);
            int result = (int)MessageBox.Show("Confirm deletion of " + firstName + " " + lastName + "?", "Delete employee", MessageBoxButtons.YesNo);

            if (result == (int)DialogResult.Yes)
            {
                db.deleteEmployee(employeeID);
                MdlEmpManagement.populateEmployeeList(BunifuDataGridView1, employeeStatus);
            }
        }
Esempio n. 5
0
        private void BunifuToggleSwitch1_OnValuechange(object sender, EventArgs e)
        {
            BunifuToggleSwitch b = (BunifuToggleSwitch)sender;

            if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(b.Value, true, false)))
            {
                employeeStatus = "";
            }
            else
            {
                employeeStatus = "where status = 'Active'";
            }

            if (firstLoad == false)
            {
                MdlEmpManagement.populateEmployeeList(BunifuDataGridView1, employeeStatus);
            }
        }
Esempio n. 6
0
        private void Button4_Click(object sender, EventArgs e)
        {
            if (FinishButton.Text.Equals("Cancel"))
            {
                MdlControllerModifier.clearFields();
                MdlControllerModifier.formatTabsbackToNormal();
            }
            else
            {
                db.updateCardID(_employeeFirstName, _alias, _employeeLasttName, Conversions.ToString(_cardID)); // Then
                _cardID = "";
                MdlControllerModifier.formatTabsbackToNormal();
                MdlControllerModifier.clearFields();
                newEmployeeTabControl.SelectTab(0);
                MdlEmpManagement.populateEmployeeList(My.MyProject.Forms.FrmEmployeeManagement.BunifuDataGridView1, My.MyProject.Forms.FrmEmployeeManagement.employeeStatus);
            }

            Close();
            My.MyProject.Forms.FrmEmployeeManagement.Show();
        }