예제 #1
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            var employeDataGridView = My.MyProject.Forms.FrmEmployeeManagement.BunifuDataGridView1;
            int employeeID          = Conversions.ToInteger(employeDataGridView.Rows[employeDataGridView.CurrentRow.Index].Cells[6].Value);

            if (string.IsNullOrEmpty(usernameTextBox.Text) | string.IsNullOrEmpty(passwordTextBox.Text) | string.IsNullOrEmpty(confirmTextBox.Text))
            {
                nameOfemployeLabel.Text      = "Please, make sure to fill all the required fields";
                nameOfemployeLabel.BackColor = Color.Firebrick;
            }
            else if (!confirmTextBox.Text.Equals(passwordTextBox.Text))
            {
                nameOfemployeLabel.Text      = "Passwords don't match";
                nameOfemployeLabel.BackColor = Color.Firebrick;
            }
            else if (employeDataGridView.SelectedRows.Count > 0)
            {
                db.createUsername(employeeID, Strings.Trim(usernameTextBox.Text), MdlModifyData.base64Encode(Strings.Trim(passwordTextBox.Text)));
                nameOfemployeLabel.Text      = "Success";
                nameOfemployeLabel.BackColor = Color.Green;
            }
            else
            {
                nameOfemployeLabel.Text      = "Please, select an employee to proceed";
                nameOfemployeLabel.BackColor = Color.Firebrick;
            }
            // MdlControllerModifier.deactivateButtons(FrmEmployeeManagement.modifyButton,
            // FrmEmployeeManagement.terminateButton,
            // FrmEmployeeManagement.cardIDButton,
            // FrmEmployeeManagement.deleteButton)
            MdlControllerModifier.pause(2000);
            Close();
        }
예제 #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();
        }
예제 #3
0
 private void TouchButton1_Load(object sender, EventArgs e)
 {
     Label1.Text = "Saving permissions...";
     Label1.Refresh();
     // selectParentNode()
     MdlModifyData.saveClearance(My.MyProject.Forms.FrmEmployeeManagement.BunifuDataGridView1);
     Label1.Text      = "Success";
     Label1.BackColor = Color.Green;
     Label1.Refresh();
     MdlControllerModifier.pause(500);
     Close();
 }
예제 #4
0
 private void Key_press_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode != Keys.ShiftKey)
     {
         /* TODO ERROR: Skipped WarningDirectiveTrivia */
         if (e.KeyCode == Keys.Enter)
         {
             _cardID = _cardID.Substring(1, _cardID.Length - 2);
             MdlModifyData.reassignCardID(_cardID);
         }
         else
         {
             _cardID += char.ConvertFromUtf32(e.KeyValue);
         }
     }
 }
예제 #5
0
 private void BunifuDataGridView1_CellContentClick(object sender, EventArgs e)
 {
     selectedRow = BunifuDataGridView1.CurrentCell.RowIndex;
     employeeID  = Conversions.ToInteger(BunifuDataGridView1.Rows[selectedRow].Cells[6].Value);
     if (Conversions.ToBoolean(MdlOptionsManagement.allowedToSeeDetails))
     {
         MdlModifyData.fillEmployeeDetails(employeeID);
         MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmEmployeeDetails, this);
     }
     else
     {
         My.MyProject.Forms.FrmdeleteWarning.mainMessageLabel.Text = "You are not allowed to see employees personal information";
         My.MyProject.Forms.FrmdeleteWarning.ButtonPanel.Visible   = true;
         My.MyProject.Forms.FrmdeleteWarning.Show();
     }
 }
예제 #6
0
        private void Button1_Click_1(object sender, EventArgs e)
        {
            MdlLoadingSetting.adjustScreen(My.MyProject.Forms.FrmParentScreen.PanelWindows, My.MyProject.Forms.FrmParentScreen.menuIsExpanded);
            MdlLoadingSetting.adjustScreen(My.MyProject.Forms.FrmAddNewEmployee, My.MyProject.Forms.FrmParentScreen.menuIsExpanded);
            if (My.MyProject.Forms.FrmParentScreen.FormsTab1.FormExists(My.MyProject.Forms.FrmAddNewEmployee.Name))
            {
                MdlLoadingSetting.waitForm.Close();
                return;
            }
            else
            {
                My.MyProject.Forms.FrmParentScreen.AddFormToPanel(My.MyProject.Forms.FrmAddNewEmployee);
                My.MyProject.Forms.FrmParentScreen.FormsTab1.AddFormTab("Edit Employee", My.MyProject.Forms.FrmAddNewEmployee.Name);
                MdlLoadingSetting.waitForm.Close();
            }

            MdlModifyData.fillTextBoxes();
            My.MyProject.Forms.FrmAddNewEmployee.personalInfoButton.Text        = "Update and Continue";
            My.MyProject.Forms.FrmAddNewEmployee.skillsCertificationButton.Text = "Update and Continue";
            My.MyProject.Forms.FrmAddNewEmployee.newEmployeeTabControl.SelectTab(0);
        }
예제 #7
0
        private void Button2_Click(object sender, EventArgs e)
        {
            var    ftpModule = new MdlFtp();
            string imageName;

            if (string.IsNullOrEmpty(firstNameTextBox.Text) | string.IsNullOrEmpty(lastNameLabel.Text) | typeComboBox.SelectedIndex == -1 | yardComboBox.SelectedIndex == -1 | genderComboBox.SelectedIndex == -1 | string.IsNullOrEmpty(jobDescriptionComboBox.Text) | payMehodComboBox.SelectedIndex == -1)
            {
                MdlControllerModifier.warning("incomplete information", titlePersonalInfoLabel);
            }
            else if (personalInfoButton.Text.Equals("Save and Continue"))
            {
                if (!Information.IsNothing(remoteFtpPath) && remoteFtpPath.Equals(""))
                {
                    imageName     = Strings.Trim(aliasTextBox.Text).Replace("/", "").Replace(@"\", "").Replace(" ", "") + DateAndTime.Now.ToString("dd-MMMd-yyyy_HHmmss") + pictureExtendsion;
                    remoteFtpPath = "/Operations/EmployeeManagement/EmployeePictures/";
                    ftpModule.uploadFtpFile(PictureLocalPath, remoteFtpPath, imageName);
                }
                else
                {
                    remoteFtpPath = "";
                }

                if (Conversions.ToBoolean(db.saveEmployee()))
                {
                    if (!newEmployeeTabControl.TabPages.Contains(certificationsTabPage))
                    {
                        newEmployeeTabControl.TabPages.Add(certificationsTabPage);
                        newEmployeeTabControl.SelectTab(1);
                    }

                    _employeeFirstName = firstNameTextBox.Text;
                    _employeeLasttName = lastNameTextBox.Text;
                    _alias             = aliasTextBox.Text;
                    SkillsCertificationPictureBox.BackgroundImage = employeePictureBox.BackgroundImage;
                    titlePersonalInfoLabel.ForeColor = Color.FromArgb(64, 64, 64);
                    titlePersonalInfoLabel.Text      = "Fill up all that apply";
                }
                else
                {
                    MdlControllerModifier.warning("user already exists", titlePersonalInfoLabel);
                }
            }
            else
            {
                if (!PictureLocalPath.Equals(""))
                {
                    imageName     = Strings.Trim(aliasTextBox.Text).Replace("/", "").Replace(@"\", "").Replace(" ", "") + DateAndTime.Now.ToString("dd-MMMd-yyyy_HHmmss") + pictureExtendsion;
                    remoteFtpPath = "/Operations/EmployeeManagement/EmployeePictures/" + imageName;
                    if ((OldPictureRemotelPath ?? "") != (remoteFtpPath ?? "") && !OldPictureRemotelPath.Equals(""))
                    {
                        ftpModule.deleteFTPImage(OldPictureRemotelPath);
                    }

                    ftpModule.uploadFtpFile(PictureLocalPath, "/Operations/EmployeeManagement/EmployeePictures/", imageName);
                    SkillsCertificationPictureBox.BackgroundImage = employeePictureBox.BackgroundImage;
                    ScanCardPictureBox.BackgroundImage            = employeePictureBox.BackgroundImage;
                }
                else
                {
                    remoteFtpPath = "";
                }

                db.updateEmployeeInfo(MdlModifyData.userID);
                if (!newEmployeeTabControl.TabPages.Contains(certificationsTabPage))
                {
                    newEmployeeTabControl.TabPages.Add(certificationsTabPage);
                    newEmployeeTabControl.SelectTab(1);
                }

                MdlModifyData.fillSkillsCheckBoxes();
                newEmployeeTabControl.SelectTab(1);
            }
        }
예제 #8
0
 private void Button2_Click(object sender, EventArgs e)
 {
     Close();
     MdlModifyData.clearEmployeeDetails();
     MdlControllerModifier.clearFields();
 }