private void Set_Form_For_Edit() { bool blnNew = false; if (this.Text.EndsWith(" - New") == true) { blnNew = true; this.txtOccupationDepartment.Text = ""; } this.dgvOccupationDepartmentDataGridView.Enabled = false; picOccupationDepartmentLock.Visible = true; clsISUtilities.Set_Form_For_Edit(blnNew); this.btnNew.Enabled = false; this.btnUpdate.Enabled = false; this.btnDelete.Enabled = false; this.btnSave.Enabled = true; this.btnCancel.Enabled = true; this.txtOccupationDepartment.Enabled = true; this.txtOccupationDepartment.Focus(); }
private void btnUpdate_Click(object sender, EventArgs e) { this.Text += " - Update"; if (this.dgvPayrollTypeDataGridView[0, this.Get_DataGridView_SelectedRowIndex(dgvPayrollTypeDataGridView)].Value.ToString().Substring(0, 1) == "W") { this.cboRunDate.Visible = false; this.txtDate.Visible = true; } else { this.txtDate.Visible = false; this.cboRunDate.Visible = true; this.cboRunDate.Enabled = true; } clsISUtilities.Set_Form_For_Edit(false); this.picPayrollTypeLock.Visible = true; this.dgvPayrollTypeDataGridView.Enabled = false; this.btnUpdate.Enabled = false; this.btnCancel.Enabled = true; this.btnSave.Enabled = true; }
private void Set_Form_For_Edit() { bool blnNew = false; if (this.Text.EndsWith(" - New") == true) { blnNew = true; this.txtFromDate.Text = ""; this.txtToDate.Text = ""; this.rbnUnlocked.Checked = true; } this.dgvPayrollTypeDataGridView.Enabled = false; this.dgvSchiftScheduleDataGridView.Enabled = false; picShiftScheduleLock.Visible = true; this.picPayrollTypeLock.Visible = true; clsISUtilities.Set_Form_For_Edit(blnNew); this.btnNew.Enabled = false; this.btnUpdate.Enabled = false; this.btnDelete.Enabled = false; this.btnSave.Enabled = true; this.btnCancel.Enabled = true; this.txtFromDate.Enabled = true; this.txtToDate.Enabled = true; this.rbnLocked.Enabled = true; this.rbnUnlocked.Enabled = true; this.txtFromDate.Focus(); }
private void Set_Form_For_Edit() { bool blnNew = true; if (this.Text.EndsWith(" - Update") == true) { blnNew = false; } clsISUtilities.Set_Form_For_Edit(blnNew); this.btnNew.Enabled = false; this.btnUpdate.Enabled = false; this.btnDelete.Enabled = false; this.btnSave.Enabled = true; this.btnCancel.Enabled = true; this.dgvCompanyDataGridView.Enabled = false; this.picCompanyLock.Visible = true; if (AppDomain.CurrentDomain.GetData("AccessInd").ToString() == "S") { if (blnNew == false) { this.rbnEditNo.Enabled = true; this.rbnEditYes.Enabled = true; } } if (this.Text.EndsWith(" - New") == true) { pvtCompanyDataView[clsISUtilities.DataViewIndex]["COMPANY_DEL_IND"] = "Y"; this.txtRate2.Text = "0.00"; this.txtRate3.Text = "2.00"; this.txtSalaryRate2.Text = "0.00"; this.txtSalaryRate3.Text = "2.00"; } else { if (pvtDataSet.Tables["Company"].Rows[clsISUtilities.DataViewIndex]["COUNT_PAY_CATEGORY_NO"] != System.DBNull.Value) { if (Convert.ToInt32(pvtDataSet.Tables["Company"].Rows[clsISUtilities.DataViewIndex]["COUNT_PAY_CATEGORY_NO"]) != 0) { //Payroll Run for Company (Excludes TakeOn) this.txtRate1.Enabled = false; this.txtRate2.Enabled = false; this.txtRate3.Enabled = false; this.txtSalaryRate1.Enabled = false; this.txtSalaryRate2.Enabled = false; this.txtSalaryRate3.Enabled = false; } } } }
private void Set_Form_For_Edit() { bool blnNew = false; if (this.Text.EndsWith(" - New") == true) { blnNew = true; this.rbnPaid.Checked = true; cboPercentage.Enabled = true; } else { if (this.rbnPaid.Checked == true) { this.cboPercentage.Enabled = true; } } clsISUtilities.Set_Form_For_Edit(blnNew); if (this.Text.EndsWith(" - New") == true) { //Set So That btnUpdate gets Enabled pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["PAYROLL_LINK"] = System.DBNull.Value; } this.dgvLeaveTypeDataGridView.Enabled = false; this.dgvPayrollTypeDataGridView.Enabled = false; this.picLeaveTypeLock.Visible = true; this.picPayrollTypeLock.Visible = true; this.rbnUnPaid.Enabled = true; this.rbnPaid.Enabled = true; this.btnNew.Enabled = false; this.btnUpdate.Enabled = false; this.btnDelete.Enabled = false; this.btnSave.Enabled = true; this.btnCancel.Enabled = true; this.txtLeaveType.Focus(); }
private void Set_Form_For_Edit() { bool blnNew = true; if (this.Text.IndexOf("- Update") > -1) { blnNew = false; } this.dgvNormalSickLeaveCategoryDataGridView.Enabled = false; this.dgvPayrollTypeDataGridView.Enabled = false; this.picLeaveLock.Visible = true; this.picPayrollTypeLock.Visible = true; clsISUtilities.Set_Form_For_Edit(blnNew); this.cboMinShiftHours.Enabled = true; this.cboMinShiftMinutes.Enabled = true; this.btnNew.Enabled = false; this.btnUpdate.Enabled = false; this.btnDelete.Enabled = true; this.btnSave.Enabled = true; this.btnCancel.Enabled = true; if (this.Text.IndexOf("- New") > -1) { this.cboMinShiftHours.SelectedIndex = -1; this.cboMinShiftMinutes.SelectedIndex = -1; } if (pvstrPayrollType == "S") { this.cboMinShiftHours.Enabled = false; this.cboMinShiftMinutes.Enabled = false; this.cboMaxShifts.Enabled = false; } this.txtLeave.Focus(); }
private void Set_Form_For_Edit() { this.dgvPayrollTypeDataGridView.Enabled = false; this.picPayrollTypeLock.Visible = true; this.btnNew.Enabled = false; this.btnSave.Enabled = true; this.btnCancel.Enabled = true; clsISUtilities.Calender_Control_From_TextBox_Enable(this.txtDate); clsISUtilities.Set_Form_For_Edit(false); this.cboRunDate.Enabled = true; this.btnAdd.Enabled = true; this.btnAddAll.Enabled = true; this.btnRemove.Enabled = true; this.btnRemoveAll.Enabled = true; this.Clear_DataGridView(this.dgvChosenEmployeeDataGridView); }
private void frmRptTimeSheetTotalsSelection_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busRptTimeSheetTotals"); if (AppDomain.CurrentDomain.GetData("FromProgramInd").ToString() == "X") { lblPeriod.Text = "Time Attendance Run Date"; } clsISUtilities.Set_Form_For_Edit(false); this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPeriod.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayCategory.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblCostCentre.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedCostCentre.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); pvtDataSet = new DataSet(); object[] objParm = new object[4]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString(); objParm[2] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); objParm[3] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); DataView PayCategoryDataView = new DataView(this.pvtDataSet.Tables["PayCategory"], "COMPANY_NO = " + Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")).ToString() + " AND PAY_CATEGORY_TYPE = 'W'", "", DataViewRowState.CurrentRows); if (PayCategoryDataView.Count > 0) { this.dgvPayrollTypeDataGridView.Rows.Add("Wages"); } PayCategoryDataView = null; PayCategoryDataView = new DataView(this.pvtDataSet.Tables["PayCategory"], "COMPANY_NO = " + Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")).ToString() + " AND PAY_CATEGORY_TYPE = 'S'", "", DataViewRowState.CurrentRows); if (PayCategoryDataView.Count > 0) { this.dgvPayrollTypeDataGridView.Rows.Add("Salaries"); } PayCategoryDataView = null; PayCategoryDataView = new DataView(this.pvtDataSet.Tables["PayCategory"], "COMPANY_NO = " + Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")).ToString() + " AND PAY_CATEGORY_TYPE = 'T'", "", DataViewRowState.CurrentRows); if (PayCategoryDataView.Count > 0) { this.dgvPayrollTypeDataGridView.Rows.Add("Time Attendance"); } pvtblnPayrollTypeDataGridViewLoaded = true; if (this.dgvPayrollTypeDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(this.dgvPayrollTypeDataGridView, 0); } else { this.btnOK.Enabled = false; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } this.reportViewer.RefreshReport(); }
private void Set_Form_For_Edit() { bool blnNew = true; this.dgvDeductionDataGridView.Enabled = false; this.dgvPayrollTypeDataGridView.Enabled = false; this.picDeductionLock.Visible = true; this.picPayrollTypeLock.Visible = true; this.btnNew.Enabled = false; this.btnUpdate.Enabled = false; this.btnDelete.Enabled = false; this.btnSave.Enabled = true; this.btnCancel.Enabled = true; if (this.Text.IndexOf(" - Update", 0) > 0) { blnNew = false; } clsISUtilities.Set_Form_For_Edit(blnNew); if (pvtDeductionDataView.Count > 0) { if (Convert.ToInt32(pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_NO"]) <= 200 & this.Text.IndexOf(" - Update", 0) > 0) { this.txtDeduction.Enabled = false; this.txtHeader1.Enabled = false; this.txtHeader2.Enabled = false; } } this.txtValue.Enabled = true; if (pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_TYPE_IND"].ToString() != "P") { if (pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_TYPE_IND"].ToString() == "U") { this.rbnEachPayPeriod.Enabled = false; this.rbnMonthly.Enabled = false; this.txtValue.Enabled = false; } } else { this.txtMinValue.Enabled = true; this.txtMaxValue.Enabled = true; } if (this.rbnMonthly.Checked == true) { this.cboDay.Enabled = true; } if (this.rbnYesLoanType.Checked == true) { this.cboNumberSubAccount.Enabled = true; } this.dgvEarningDataGridView.SelectionMode = DataGridViewSelectionMode.CellSelect; this.dgvEarningDataGridView.EditMode = DataGridViewEditMode.EditOnKeystroke; this.dgvEarningDataGridView.Enabled = true; if (this.dgvEarningDataGridView.Rows.Count > 0) { dgvEarningDataGridView.CurrentCell = dgvEarningDataGridView[2, 0]; } //Display Only this.txtIRP5Code.Enabled = false; }