Esempio n. 1
0
 private void endPeriodComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     // MdlControllerModifier.deactivateButtons(detailedEntryButton, editEntryButton, editEntryButton, deleteEntryButton)
     // payMethodComboBox.SelectedIndex = 0
     MdlTimeManagement.populateTimeSheetList();
     firstLoad = false;
 }
Esempio n. 2
0
 private void payMethodComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(firstLoad, false, false)))
     {
         MdlTimeManagement.populateTimeSheetList();
     }
 }
Esempio n. 3
0
        private void createNewEntryButton_Click(object sender, EventArgs e)
        {
            var employeeType = default(string);
            int selectedRow  = createEntyDataGrid.CurrentRow.Index;

            if (createEntyDataGrid.SelectedRows.Count > 0)
            {
                employeeType = Conversions.ToString(createEntyDataGrid.Rows[selectedRow].Cells[4].Value);
            }

            if (string.IsNullOrEmpty(newEntrymodifiedByTextBox.Text) | reasonNewEntryComboBox.SelectedIndex == -1 | shiftTypeComboBox.SelectedIndex == -1 | siteLocationComboBox.SelectedIndex == -1)
            {
            }
            else if (createEntyDataGrid.SelectedRows.Count == 0 | clockInCheckBox.Checked == false)
            {
                MdlControllerModifier.warning("no item selected", editEntryTitleLabel);
            }
            else if (reasonNewEntryComboBox.SelectedItem.Equals("Other") & string.IsNullOrEmpty(RichTextBox1.Text))
            {
                MdlControllerModifier.warning("Edit entry", editEntryTitleLabel);
            }
            else if (employeeType.Equals("Crew") & workDoneListView.CheckedItems.Count == 0 & shiftTypeComboBox.SelectedItem.Equals("Piece Work"))
            {
                MdlControllerModifier.warning("Edit entry", editEntryTitleLabel);
            }
            else if (employeeType.Equals("Crew") & workDoneListView.CheckedItems.Count == 0 & shiftTypeComboBox.SelectedItem.Equals("Hourly") & clockOutCheckBox.Checked)
            {
                MdlControllerModifier.warning("Edit entry", editEntryTitleLabel);
            }
            else if (clockOutCheckBox.Checked & newEntryclockInTimePicker.Value > newEntryclockOutTimePicker.Value)
            {
                MdlControllerModifier.warning("Wrong time", editEntryTitleLabel);
            }
            else
            {
                MdlTimeManagement.createNewPunch(newEntryDatePicker, newEntryclockInTimePicker, newEntryclockOutTimePicker);
                editEntryTitleLabel.Text = "Success!";
                editEntryTitleLabel.Update();
                if (createEntyDataGrid.SelectedRows.Count > 0)
                {
                    if (My.MyProject.Forms.FrmTimeSheet.summaryBunifuDataGridView.SelectedRows.Count > 0)
                    {
                        int selectedEmployee = Conversions.ToInteger(createEntyDataGrid.Rows[selectedRow].Cells[3].Value);
                        MdlTimeManagement.populateDetails(selectedEmployee);
                    }
                    else
                    {
                        MdlTimeManagement.populateTimeSheetList();
                    }

                    Close();
                }

                My.MyProject.Forms.FrmTimeSheet.payMethodComboBox.SelectedIndex = My.MyProject.Forms.FrmTimeSheet.payMethodComboBox.SelectedIndex;
            }
        }
Esempio n. 4
0
        private void deleteEntryButton_Click(object sender, EventArgs e)
        {
            int selectedItemD = detailsBunifuDataGridView.CurrentCell.RowIndex;
            int selectedItemS = summaryBunifuDataGridView.CurrentCell.RowIndex;
            int employeeID    = Conversions.ToInteger(summaryBunifuDataGridView.Rows[selectedItemS].Cells[6].Value);
            // Dim selectedEmployee As Integer = Convert.ToUInt32(summaryListView.FocusedItem.Index.ToString)
            int _punchID = Convert.ToInt32(detailsBunifuDataGridView.Rows[selectedItemD].Cells[6].Value);
            var result   = MessageBox.Show("Are you sure you want to delete this entry? This can not be undone", "Delete Entry", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                db.deleteEntry(_punchID);
                MdlTimeManagement.populateDetails(employeeID);
                if (detailsBunifuDataGridView.Rows.Count == 0)
                {
                    MdlTimeManagement.populateTimeSheetList();
                }
                // MdlControllerModifier.deactivateButtons(detailedEntryButton, editEntryButton, editEntryButton, deleteEntryButton)
            }
        }
Esempio n. 5
0
 private void showAllEmployeesCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     MdlTimeManagement.populateTimeSheetList();
 }