private void frmConvertEmployeeType_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busConvertEmployeeType"); this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblCostCentreSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayCategoryDesc.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayCategorySelectDesc.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblNormalLeave.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblNormalLeaveSelected.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); pvtDataSet = new DataSet(); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); Load_CurrentForm_Records(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmResetEmployeeTakeOn_Load(object sender, EventArgs e) { try { this.pvtint64CompanyNo = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); clsISUtilities = new clsISUtilities(this, "busResetEmployeeTakeOn"); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayCategory.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblChosenEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); this.dgvPayrollTypeDataGridView.Rows.Add("Wages"); this.dgvPayrollTypeDataGridView.Rows.Add("Salaries"); this.dgvPayrollTypeDataGridView.Rows.Add("Time Attendance"); this.pvtblnPayrollTypeDataGridViewLoaded = true; this.Set_DataGridView_SelectedRowIndex(this.dgvPayrollTypeDataGridView, 0); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmUserMenuAccess_Load(object sender, System.EventArgs e) { try { //This Must Replace TreeView First Row (Happens When GUI is Changed) //AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w clsISUtilities = new clsISUtilities(this, "busUserMenuAccess"); this.lblUserSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblCompanySpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblMenuStructureSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblMenuAccessSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); Build_Menu_Structure(); pvtDataSet = new DataSet(); object[] objParm = new object[3]; objParm[0] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString(); objParm[1] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); objParm[2] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Users", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); Load_Users(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmTimeAttendanceCompany_Load(object sender, System.EventArgs e) { try { PayrollLinkDataGridViewCellStyle = new DataGridViewCellStyle(); PayrollLinkDataGridViewCellStyle.BackColor = Color.Magenta; PayrollLinkDataGridViewCellStyle.SelectionBackColor = Color.Magenta; clsISUtilities = new clsISUtilities(this, "busCompany"); this.lblCompanySpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); pvtDataSet = new DataSet(); object[] objParm = new object[2]; objParm[0] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); objParm[1] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); Set_Form_For_Read(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmDataDownload_Load(object sender, System.EventArgs e) { try { clsISUtilities = new InteractPayroll.clsISUtilities(this, "busDataDownload"); //Local clsISClientUtilities = new clsISClientUtilities(this, "busClientDataDownload"); this.lblCostCentreSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedCostCentreSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblCostCentreDelete.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[2]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString(); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records_New", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); Load_CurrentForm_Records(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmEmployeeLeaveTakeOn_Load(object sender, System.EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busEmployeeLeaveTakeOn"); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblNormalLeave.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSickLeave.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); for (int intRow = 0; intRow < pvtDataSet.Tables["PayrollType"].Rows.Count; intRow++) { this.dgvPayrollTypeDataGridView.Rows.Add(pvtDataSet.Tables["PayrollType"].Rows[intRow]["PAYROLL_TYPE_DESC"].ToString()); } pvtblnPayrollTypeDataGridViewLoaded = true; if (pvtDataSet.Tables["PayrollType"].Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(dgvPayrollTypeDataGridView, 0); } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmFileDownload_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busFileDownload"); clsCrc32 = new clsCrc32(); this.lblUserSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblFileDesc.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); try { //User For Time Attendance Client (Not Payroll / Time Attendance Internet) miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem"); } catch { } pvtDataSet = new DataSet(); if (AppDomain.CurrentDomain.GetData("AccessInd").ToString() != "S") { this.btnDelete.Visible = false; this.btnClose.Top = this.btnDelete.Top; this.grbToUser.Visible = false; } object[] objParm = new object[2]; objParm[0] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); objParm[1] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); for (int intRow = 0; intRow < pvtDataSet.Tables["User"].Rows.Count; intRow++) { this.dgvUserDataGridView.Rows.Add(pvtDataSet.Tables["User"].Rows[intRow]["USER_ID"].ToString(), pvtDataSet.Tables["User"].Rows[intRow]["SURNAME"].ToString(), pvtDataSet.Tables["User"].Rows[intRow]["FIRSTNAME"].ToString(), pvtDataSet.Tables["User"].Rows[intRow]["USER_NO"].ToString()); } pvtblnUserDataGridViewLoaded = true; if (this.dgvUserDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(this.dgvUserDataGridView, 0); } else { CustomMessageBox.Show("There are No Files to Download.", "File Download", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmPublicHoliday_Load(object sender, System.EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busPublicHoliday"); if (AppDomain.CurrentDomain.GetData("AccessInd").ToString() == "S") { this.btnAll.Visible = true; } this.lblDescription.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[2]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString(); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); this.dgvPublicHolidayDataGridView.Columns[0].HeaderText = "Date (" + AppDomain.CurrentDomain.GetData("DateFormat").ToString() + ")"; Load_CurrentForm_Records(); Set_Form_For_Read(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmCalender_Load(object sender, System.EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busCalender"); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); byte[] pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); for (int intYear = 2007; intYear < DateTime.Now.Year + 2; intYear++) { this.cboYear.Items.Add(intYear.ToString()); } for (int intRow = 0; intRow < 6; intRow++) { this.dgvCalenderDataGridView.Rows.Add("", "", "", "", "", "", "", "", ""); } pvtblnCalenderDataGridViewLoaded = true; this.btnToday.Text = DateTime.Now.ToString(pvtstrDateFormat); SatSunDataGridViewCellStyle = new DataGridViewCellStyle(); SatSunDataGridViewCellStyle.ForeColor = Color.Navy; SatSunDataGridViewCellStyle.SelectionForeColor = Color.Navy; PublicHolidayDataGridViewCellStyle = new DataGridViewCellStyle(); PublicHolidayDataGridViewCellStyle.ForeColor = Color.Red; PublicHolidayDataGridViewCellStyle.SelectionForeColor = Color.Red; NormalDataGridViewCellStyle = new DataGridViewCellStyle(); NormalDataGridViewCellStyle.ForeColor = Color.Black; NormalDataGridViewCellStyle.SelectionForeColor = Color.Black; LightDataGridViewCellStyle = new DataGridViewCellStyle(); LightDataGridViewCellStyle.ForeColor = Color.Gray; LightDataGridViewCellStyle.SelectionForeColor = Color.Gray; Set_Date(DateTime.Now.ToString(pvtstrDateFormat)); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmFileUpload_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busFileUpload"); clsISClientUtilities = new clsISClientUtilities(this, "busBackupRestoreClientDatabase"); clsCrc32 = new clsCrc32(); this.lblUserSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedUserSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblFilesHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); try { //User For Time Attendance Client (Not Payroll / Time Attendance Internet) miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem"); } catch { } pvtDataSet = new DataSet(); object[] objParm = new object[2]; objParm[0] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); objParm[1] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); for (int intRow = 0; intRow < pvtDataSet.Tables["User"].Rows.Count; intRow++) { this.dgvUserDataGridView.Rows.Add(pvtDataSet.Tables["User"].Rows[intRow]["USER_ID"].ToString(), pvtDataSet.Tables["User"].Rows[intRow]["SURNAME"].ToString(), pvtDataSet.Tables["User"].Rows[intRow]["FIRSTNAME"].ToString(), pvtDataSet.Tables["User"].Rows[intRow]["USER_NO"].ToString()); if (pvtDataSet.Tables["User"].Rows.Count == 1) { } } pvtblnUserDataGridViewLoaded = true; if (this.dgvUserDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(this.dgvUserDataGridView, 0); } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void btnSave_Click(object sender, EventArgs e) { try { DataSet TempDataSet = new DataSet(); TempDataSet.Tables.Add(this.pvtDataSet.Tables["EtiEmployeeSave"].Clone()); for (int intRow = 0; intRow < this.dgvEmployeeDataGridView.Rows.Count; intRow++) { DataRow DataRow = TempDataSet.Tables["EtiEmployeeSave"].NewRow(); DataRow["EMPLOYEE_NO"] = Convert.ToInt32(this.dgvEmployeeDataGridView[EmployeeNoCol, intRow].Value); DataRow["ETI_MONTH"] = Convert.ToInt32(this.dgvEmployeeDataGridView[EmployeeEtiMonthCol, intRow].Value); DataRow["TOTAL_HOURS"] = Convert.ToDecimal(this.dgvEmployeeDataGridView[EmployeeTotalHoursCol, intRow].Value); DataRow["FACTOR"] = Convert.ToDecimal(this.dgvEmployeeDataGridView[EmployeeFactorCol, intRow].Value); DataRow["TOTAL_EARNINGS"] = Convert.ToDecimal(this.dgvEmployeeDataGridView[EmployeeTotalAmountCol, intRow].Value); DataRow["ETI_EARNINGS"] = Convert.ToDecimal(this.dgvEmployeeDataGridView[EmployeeEtiAmountCol, intRow].Value); DataRow["ETI_VALUE"] = Convert.ToDecimal(this.dgvEmployeeDataGridView[EmployeeEtiCalculatedCol, intRow].Value); TempDataSet.Tables["EtiEmployeeSave"].Rows.Add(DataRow); } byte[] pvtbytCompress = clsISUtilities.Compress_DataSet(TempDataSet); object[] objParm = new object[5]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); objParm[2] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); objParm[3] = Convert.ToDateTime(this.pvtDataSet.Tables["EtiRunDate"].Rows[intSelectedRowIndex]["ETI_RUN_DATE"]).ToString("yyyy-MM-dd"); objParm[4] = pvtbytCompress; byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Insert_Eti_Records", objParm, true); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); cboEtiRunDate.Items.Clear(); this.dgvEmployeeDataGridView.Rows.Clear(); this.dgvEmployeeExcludedDataGridView.Rows.Clear(); for (int intRow = 0; intRow < this.pvtDataSet.Tables["EtiRunDate"].Rows.Count; intRow++) { cboEtiRunDate.Items.Add(Convert.ToDateTime(this.pvtDataSet.Tables["EtiRunDate"].Rows[intRow]["ETI_RUN_DATE"]).ToString("MMMM yyyy")); } this.btnSave.Enabled = false; } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmLeaveType_Load(object sender, System.EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busLeaveType"); this.lblLeaveType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); PayrollLinkDataGridViewCellStyle = new DataGridViewCellStyle(); PayrollLinkDataGridViewCellStyle.BackColor = Color.Magenta; PayrollLinkDataGridViewCellStyle.SelectionBackColor = Color.Magenta; this.dgvPayrollTypeDataGridView.Rows.Add("Wages"); this.dgvPayrollTypeDataGridView.Rows.Add("Salaries"); this.pvtblnPayrollTypeDataGridViewLoaded = true; this.Set_DataGridView_SelectedRowIndex(this.dgvPayrollTypeDataGridView, 0); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); DataRow dtDataRow; //Table DataTable DataTable = new DataTable("PERCENT_PAID"); DataTable.Columns.Add("PERCENT_PAID_VALUE", typeof(System.Int16)); pvtDataSet.Tables.Add(DataTable); for (int intValue = 1; intValue < 101; intValue++) { dtDataRow = pvtDataSet.Tables["PERCENT_PAID"].NewRow(); dtDataRow["PERCENT_PAID_VALUE"] = intValue; pvtDataSet.Tables["PERCENT_PAID"].Rows.Add(dtDataRow); } pvtDataSet.AcceptChanges(); clsISUtilities.DataBind_ComboBox_Load(this.cboPercentage, pvtDataSet.Tables["PERCENT_PAID"], "PERCENT_PAID_VALUE", "PERCENT_PAID_VALUE"); Load_CurrentForm_Records(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void pbxHorzPage1_Click(object sender, System.EventArgs e) { try { object[] objParm = new object[6]; objParm[0] = pvtint64CompanyNo; objParm[1] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); objParm[2] = 1; objParm[3] = pvtintNumberHorizontalPages; objParm[4] = pvtstrEmployeePrintOrder; objParm[5] = pvtblnByPayCategoryParameter; pvtbyteCompress = (byte[])clsISUtilities.DynamicFunction("Print_Horizontal_SpreadSheet_Page", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbyteCompress); //Company DataTable DataTable myCompanyDataTable = pvtTempDataSet.Tables["Company"].Copy(); pvtDataSet.Tables.Add(myCompanyDataTable); //CompanyHeaderDetails DataTable DataTable myCompanyHeaderDetailsDataTable = pvtTempDataSet.Tables["CompanyHeaderDetails"].Copy(); pvtDataSet.Tables.Add(myCompanyHeaderDetailsDataTable); frmRptEarningsDeductionsSpreadSheet = new frmRptEarningsDeductionsSpreadSheet(this, pvtDataSet, pvtblnConsolidate, pvtblnByPayCategoryParameter, 1, pvtintNumberHorizontalPages, pvtstrReportHeader, pvtstrEmployeePrintOrder, "S"); frmRptEarningsDeductionsSpreadSheet.MdiParent = this.MdiParent; frmRptEarningsDeductionsSpreadSheet.Text = this.Text; frmRptEarningsDeductionsSpreadSheet.Show(); this.Hide(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmEmployeeActivateSelection_Load(object sender, System.EventArgs e) { try { Pen3Pixels = new Pen(Color.Black, 3); Pen1Pixel = new Pen(Color.Black, 1); clsISUtilities = new clsISUtilities(this, "busEmployeeActivateSelection"); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblChosenEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); clsISUtilities.Create_Calender_Control_From_TextBox(this.txtDate); clsISUtilities.NotDataBound_Date_TextBox(txtDate, "Capture Tax Effective Date."); clsISUtilities.NotDataBound_ComboBox(this.cboRunDate, "Select Tax Effective Date."); object[] objParm = new object[2]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString(); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); pvtSalaryDateDataView = null; pvtSalaryDateDataView = new DataView(pvtDataSet.Tables["SalaryPrevDate"], "COMPANY_NO = " + Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")), "", DataViewRowState.CurrentRows); for (int intRow = 0; intRow < pvtDataSet.Tables["PayrollType"].Rows.Count; intRow++) { this.dgvPayrollTypeDataGridView.Rows.Add(pvtDataSet.Tables["PayrollType"].Rows[intRow]["PAYROLL_TYPE_DESC"].ToString()); } pvtblnPayrollTypeDataGridViewLoaded = true; if (dgvPayrollTypeDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(dgvPayrollTypeDataGridView, 0); dgvPayrollTypeDataGridView.Refresh(); } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void btnPrint_Click(object sender, EventArgs e) { try { object[] objParm = new object[4]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = pvtstrPayrollType; objParm[2] = pvtintPayCategoryNo; objParm[3] = pvtintPayCategoryShiftScheduleNo; pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Print_Report", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); frmRptRoster = new frmRptRoster(pvtDataSet); frmRptRoster.ShowDialog(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmEtiRun_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busEtiRun"); EarnsTooMuchDataGridViewCellStyle = new DataGridViewCellStyle(); EarnsTooMuchDataGridViewCellStyle.BackColor = Color.Coral; EarnsTooMuchDataGridViewCellStyle.SelectionBackColor = Color.Coral; BeyondPeriodDataGridViewCellStyle = new DataGridViewCellStyle(); BeyondPeriodDataGridViewCellStyle.BackColor = Color.MediumTurquoise; BeyondPeriodDataGridViewCellStyle.SelectionBackColor = Color.MediumTurquoise; YoungerThanEighteenDataGridViewCellStyle = new DataGridViewCellStyle(); YoungerThanEighteenDataGridViewCellStyle.BackColor = Color.Lime; YoungerThanEighteenDataGridViewCellStyle.SelectionBackColor = Color.Lime; OlderThanThirtyDataGridViewCellStyle = new DataGridViewCellStyle(); OlderThanThirtyDataGridViewCellStyle.BackColor = Color.Plum; OlderThanThirtyDataGridViewCellStyle.SelectionBackColor = Color.Plum; this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblEmployeeExcluded.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[3]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); objParm[2] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); this.lblEarnAmount.Text = "Earns More than R" + Convert.ToDecimal(this.pvtDataSet.Tables["EtiMaxAmount"].Rows[0]["MAX_ETI_AMOUNT"]).ToString("#####0.00"); for (int intRow = 0; intRow < this.pvtDataSet.Tables["EtiRunDate"].Rows.Count; intRow++) { cboEtiRunDate.Items.Add(Convert.ToDateTime(this.pvtDataSet.Tables["EtiRunDate"].Rows[intRow]["ETI_RUN_DATE"]).ToString("MMMM yyyy")); } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmRptEti_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busRptEti"); this.lblRunDate.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblChosenEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[3]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); objParm[2] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); byte[] pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); this.pvtblnDateDataGridViewLoaded = false; for (int intRow = 0; intRow < this.pvtDataSet.Tables["EtiRunDate"].Rows.Count; intRow++) { this.dgvDateDataGridView.Rows.Add(Convert.ToDateTime(this.pvtDataSet.Tables["EtiRunDate"].Rows[intRow]["ETI_RUN_DATE"]).ToString("MMMM yyyy"), Convert.ToDateTime(this.pvtDataSet.Tables["EtiRunDate"].Rows[intRow]["ETI_RUN_DATE"]).ToString("yyyy-MM-dd")); } this.pvtblnDateDataGridViewLoaded = true; if (this.dgvDateDataGridView.Rows.Count > 0) { this.btnOK.Enabled = true; this.Set_DataGridView_SelectedRowIndex(this.dgvDateDataGridView, 0); } else { this.btnOK.Enabled = false; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } this.reportViewer.RefreshReport(); }
private void frmDeduction_Load(object sender, System.EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busDeduction"); this.lblDeductionSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayrollTypeSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPercentEarningsSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.dgvPayrollTypeDataGridView.Rows.Add("Wages"); this.dgvPayrollTypeDataGridView.Rows.Add("Salaries"); pvtblnPayrollTypeDataGridViewLoaded = true; this.Set_DataGridView_SelectedRowIndex(this.dgvPayrollTypeDataGridView, 0); LockedPayrollRunDataGridViewCellStyle = new DataGridViewCellStyle(); LockedPayrollRunDataGridViewCellStyle.BackColor = Color.Magenta; LockedPayrollRunDataGridViewCellStyle.SelectionBackColor = Color.Magenta; pvtDataSet = new DataSet(); object[] objParm = new object[3]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); objParm[2] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); clsISUtilities.DataBind_ComboBox_Load(this.cboNumberSubAccount, pvtDataSet.Tables["SubAccount"], "DEDUCTION_SUB_ACCOUNT_COUNT", "DEDUCTION_SUB_ACCOUNT_COUNT"); clsISUtilities.NotDataBound_ComboBox(this.cboDay, "Select Day of Month."); Load_CurrentForm_Records(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmTimeAttendanceDataDownload_Load(object sender, System.EventArgs e) { try { clsISUtilities = new InteractPayroll.clsISUtilities(this, "busDataDownload"); //Local clsISClientUtilities = new clsISClientUtilities(this, "busClientDataDownload"); miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem"); this.lblCompany.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblCostCentreSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedCostCentreSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblCostCentreDelete.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[2]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); objParm[1] = "B"; pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records_For_User_New", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); for (int intRow = 0; intRow < this.pvtDataSet.Tables["Company"].Rows.Count; intRow++) { this.dgvCompanyDataGridView.Rows.Add(this.pvtDataSet.Tables["Company"].Rows[intRow]["COMPANY_DESC"].ToString(), intRow.ToString()); } pvtblnCompanyDataGridViewLoaded = true; if (this.dgvCompanyDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(this.dgvCompanyDataGridView, 0); } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmShiftSchedule_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busShiftSchedule"); this.lblDescription.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); clsISUtilities.Create_Calender_Control_From_TextBox(this.txtFromDate); clsISUtilities.Create_Calender_Control_From_TextBox(this.txtToDate); clsISUtilities.NotDataBound_Date_TextBox(this.txtFromDate, "Enter From Date"); clsISUtilities.NotDataBound_Date_TextBox(this.txtToDate, "Enter To Date"); object[] objParm = new object[2]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString(); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); pvtblnPayrollTypeDataGridViewLoaded = false; for (int intRow = 0; intRow < pvtDataSet.Tables["PayrollType"].Rows.Count; intRow++) { this.dgvPayrollTypeDataGridView.Rows.Add(pvtDataSet.Tables["PayrollType"].Rows[intRow]["PAYROLL_TYPE_DESC"].ToString()); } pvtblnPayrollTypeDataGridViewLoaded = true; if (this.dgvPayrollTypeDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(this.dgvPayrollTypeDataGridView, 0); } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmFix_Load(object sender, EventArgs e) { clsISUtilities = new clsISUtilities(this, "busFix"); Set_Form_For_Read(); EmployeeNotLinkedDataGridViewCellStyle = new DataGridViewCellStyle(); EmployeeNotLinkedDataGridViewCellStyle.BackColor = Color.Yellow; EmployeeNotLinkedDataGridViewCellStyle.SelectionBackColor = Color.Yellow; this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedEmployee.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); this.lblLeaveType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedLeaveType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblOccupation.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedOccupation.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblDescription.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblListEmployees.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblEmployeeLinked.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblEmployeeNotLinked.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); this.dgvPayrollTypeDataGridView.Rows.Add("Wages"); this.dgvPayrollTypeDataGridView.Rows.Add("Salaries"); pvtblnPayrollTypeDataGridViewLoaded = true; Load_CurrentForm_Records(); }
private void Load_CurrentForm_Records() { try { object[] objParm = new object[2]; objParm[0] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); objParm[1] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); this.Clear_DataGridView(this.dgvUserDataGridView); pvtblnUserDataGridViewLoaded = false; for (int intRowCount = 0; intRowCount < this.pvtDataSet.Tables["User"].Rows.Count; intRowCount++) { this.dgvUserDataGridView.Rows.Add(this.pvtDataSet.Tables["User"].Rows[intRowCount]["USER_ID"].ToString(), this.pvtDataSet.Tables["User"].Rows[intRowCount]["SURNAME"].ToString(), this.pvtDataSet.Tables["User"].Rows[intRowCount]["FIRSTNAME"].ToString(), this.pvtDataSet.Tables["User"].Rows[intRowCount]["USER_NO"].ToString()); } pvtblnUserDataGridViewLoaded = true; if (this.dgvUserDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(this.dgvUserDataGridView, 0); } else { this.btnOK.Enabled = false; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmOccupationDepartment_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busOccupationDepartment"); this.lblDescription.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); pvtstrMenuId = AppDomain.CurrentDomain.GetData("MenuId").ToString(); if (pvtstrMenuId == "3A") { this.Name = "frmOccupation"; this.lblDescription.Text = "Occupation"; pvtstrTableName = "OCCUPATION"; clsISUtilities.NotDataBound_TextBox(this.txtOccupationDepartment, "Enter Occupation."); } else { pvtstrTableName = "DEPARTMENT"; clsISUtilities.NotDataBound_TextBox(this.txtOccupationDepartment, "Enter Department."); } object[] objParm = new object[2]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = pvtstrMenuId; pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); Load_CurrentForm_Records(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmRptLeaveTimeSheet_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busRptLeaveTimeSheet"); this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblSelectedEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayrollType.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); this.lblPayPeriod.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.dgvPayrollTypeDataGridView.Rows.Add("Wages"); this.pvtblnPayrollTypeDataGridViewLoaded = true; object[] objParm = new object[4]; objParm[0] = Convert.ToInt32(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("MenuId").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); this.Set_DataGridView_SelectedRowIndex(this.dgvPayrollTypeDataGridView, 0); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } this.reportViewer.RefreshReport(); }
private void frmPayrollRunFix_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busPayrollRunFix"); this.lblEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblCostCentre.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblEarning.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblDeduction.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); for (int intRow = 0; intRow < this.pvtDataSet.Tables["PayCategory"].Rows.Count; intRow++) { this.dgvPayCategoryDataGridView.Rows.Add(this.pvtDataSet.Tables["PayCategory"].Rows[intRow]["PAY_CATEGORY_DESC"].ToString(), this.pvtDataSet.Tables["PayCategory"].Rows[intRow]["PAY_CATEGORY_NO"].ToString(), this.pvtDataSet.Tables["PayCategory"].Rows[intRow]["NORM_PAID_PER_PERIOD"].ToString(), this.pvtDataSet.Tables["PayCategory"].Rows[intRow]["SICK_PAID_PER_PERIOD"].ToString(), intRow.ToString()); } pvtblnPayCategoryDataGridViewLoaded = true; this.Set_DataGridView_SelectedRowIndex(dgvPayCategoryDataGridView, 0); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmLoadNewDemoRun_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busLoadNewDemoRun"); this.lblDate.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); byte[] bytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); this.lblDesc.Text = "Choose Date to Load Company " + pvtDataSet.Tables["CompanyName"].Rows[0]["COMPANY_DESC"].ToString(); for (int intRow = 0; intRow < pvtDataSet.Tables["PayDates"].Rows.Count; intRow++) { this.dgvDateDataGridView.Rows.Add(Convert.ToDateTime(pvtDataSet.Tables["PayDates"].Rows[intRow]["PAY_PERIOD_DATE"]).ToString("dd MMM yyyy"), Convert.ToDateTime(pvtDataSet.Tables["PayDates"].Rows[intRow]["PAY_PERIOD_DATE"]).ToString("yyyy-MM-dd")); } pvtblnDateDataGridViewLoaded = true; if (pvtDataSet.Tables["PayDates"].Rows.Count > 0) { Set_DataGridView_SelectedRowIndex(dgvDateDataGridView, 0); this.btnLoad.Enabled = true; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void btnSave_Click(object sender, EventArgs e) { try { DataSet tempDataSet = new DataSet(); int intLeaveShiftNo = -1; //Employee Earnings //Employee Earnings tempDataSet.Tables.Add(pvtDataSet.Tables["PayCategory"].Clone()); if (this.dgvChosenPayCategoryDataGridView.Rows.Count == 0) { CustomMessageBox.Show("Select at least 1 Cost Centre", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { bool blnDefault = false; for (int intRow = 0; intRow < dgvChosenPayCategoryDataGridView.Rows.Count; intRow++) { DataRow MyDataRow = tempDataSet.Tables["PayCategory"].NewRow(); MyDataRow["PAY_CATEGORY_NO"] = this.dgvChosenPayCategoryDataGridView[3, intRow].Value.ToString(); if (Convert.ToBoolean(this.dgvChosenPayCategoryDataGridView[2, intRow].Value) == true) { MyDataRow["DEFAULT_IND"] = "Y"; if (blnDefault == false) { blnDefault = true; } else { CustomMessageBox.Show("Only 1 Cost Centre can be set to Default", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } else { MyDataRow["DEFAULT_IND"] = "N"; } MyDataRow["REC_RATE"] = this.dgvChosenPayCategoryDataGridView[1, intRow].Value.ToString(); tempDataSet.Tables["PayCategory"].Rows.Add(MyDataRow); } if (blnDefault == false) { CustomMessageBox.Show("1 Cost Centre must be set to Default", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } if (this.dgvLeaveShiftSelectedDataGridView.Rows.Count == 0) { CustomMessageBox.Show("Select at least 1 Normal Leave / Sick Leave Category", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (this.dgvLeaveShiftSelectedDataGridView.Rows.Count == 1) { intLeaveShiftNo = Convert.ToInt32(this.dgvLeaveShiftSelectedDataGridView[1, 0].Value); } else { CustomMessageBox.Show("Only 1 Normal Leave / Sick Leave Category Record Allowed.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } DataView CurrentPayCategoryDataView = new DataView(pvtDataSet.Tables["CurrentPayCategory"], "EMPLOYEE_NO = " + pvtintEmployeeNo + " AND PAY_CATEGORY_TYPE = '" + pvtstrCurrentPayrollType + "'", "", DataViewRowState.CurrentRows); for (int intRow = 0; intRow < CurrentPayCategoryDataView.Count; intRow++) { CurrentPayCategoryDataView[intRow].Delete(); intRow -= 1; } DataView EmployeeDataView = new DataView(pvtDataSet.Tables["Employee"], "EMPLOYEE_NO = " + pvtintEmployeeNo + " AND PAY_CATEGORY_TYPE = '" + pvtstrCurrentPayrollType + "'", "", DataViewRowState.CurrentRows); for (int intRow = 0; intRow < EmployeeDataView.Count; intRow++) { EmployeeDataView[intRow].Delete(); intRow -= 1; } byte[] bytCompress = clsISUtilities.Compress_DataSet(tempDataSet); object[] objParm = new object[6]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = pvtstrPayrollType; objParm[2] = pvtstrCurrentPayrollType; objParm[3] = pvtintEmployeeNo; objParm[4] = intLeaveShiftNo; objParm[5] = bytCompress; bytCompress = (byte[])clsISUtilities.DynamicFunction("Update_Employee", objParm); tempDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); pvtDataSet.Merge(tempDataSet); pvtDataSet.AcceptChanges(); Load_CurrentForm_Records(); btnCancel_Click(sender, e); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmClosePayrollRun_Load(object sender, System.EventArgs e) { try { if (AppDomain.CurrentDomain.GetData("FromProgramInd").ToString() == "X") { btnDateClose.Text = "Close Date"; grbCloseReminder.Text = grbCloseReminder.Text.Replace("Payroll", "Time Attendance"); this.lblCloseInfo.Text = this.lblCloseInfo.Text.Replace("Payroll", "Time Sheet"); this.picWarningPicture.Image = global::ClosePayrollRun.Properties.Resources.TimeSheetTotals48; } clsISUtilities = new clsISUtilities(this, "busClosePayrollRun"); int intTimeout = Convert.ToInt32(AppDomain.CurrentDomain.GetData("TimeSheetReadTimeoutSeconds")) * 1000; clsISUtilities.Set_WebService_Timeout_Value(intTimeout); 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(); pvtTempDataSet = new DataSet(); object[] objParm = new object[2]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString(); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); if (this.pvtDataSet.Tables["CloseQueue"].Rows.Count > 0) { pvtblnRecordInQueue = true; if (this.pvtDataSet.Tables["CloseQueue"].Rows[0]["CLOSE_RUN_QUEUE_IND"].ToString() == "S") { pvtstrRunType = this.pvtDataSet.Tables["CloseQueue"].Rows[0]["RUN_TYPE"].ToString(); Busy_With_Run(); } else { Set_Run_Failed(); } } //ELR - 2016-07-29 DataView PayCategoryDataView = new DataView(pvtDataSet.Tables["PayCategory"], "PAY_CATEGORY_TYPE = 'S' AND SALARY_TIMESHEET_UPLOAD_REQUIRED_IND = 'Y'", "", DataViewRowState.CurrentRows); if (PayCategoryDataView.Count > 0) { CustomMessageBox.Show("'Salaries Timesheets have not yet been UPLOADED.\n\nNB.You may continue without uploading but these Timesheets will then be Lost.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } Load_CurrentForm_Records(); if (pvtblnRecordInQueue == false) { this.tmrTimer.Enabled = true; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmNormalSickLeave_Load(object sender, System.EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busNormalSickLeave"); PayrollLinkDataGridViewCellStyle = new DataGridViewCellStyle(); PayrollLinkDataGridViewCellStyle.BackColor = Color.Magenta; PayrollLinkDataGridViewCellStyle.SelectionBackColor = Color.Magenta; this.lblDescription.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.lblPayrollType.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); this.dgvPayrollTypeDataGridView.Rows.Add("Wages"); this.dgvPayrollTypeDataGridView.Rows.Add("Salaries"); pvtblnPayrollTypeDataGridViewLoaded = true; this.Set_DataGridView_SelectedRowIndex(this.dgvPayrollTypeDataGridView, 0); object[] objParm = new object[3]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString(); objParm[2] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); DataRow dtDataRow; //Table DataTable DataTable = new DataTable("DAYS50"); DataTable.Columns.Add("DAYS50_DESC", typeof(System.String)); DataTable.Columns.Add("DAYS50_VALUE", typeof(System.Int16)); pvtDataSet.Tables.Add(DataTable); DataTable = new DataTable("DAYS365"); DataTable.Columns.Add("DAYS365_VALUE", typeof(System.Int16)); pvtDataSet.Tables.Add(DataTable); DataTable = new DataTable("HOURS24"); DataTable.Columns.Add("HOURS24_VALUE", typeof(System.Int16)); pvtDataSet.Tables.Add(DataTable); for (int intValue = 0; intValue < 51; intValue++) { if (intValue < 24) { dtDataRow = pvtDataSet.Tables["HOURS24"].NewRow(); dtDataRow["HOURS24_VALUE"] = intValue; pvtDataSet.Tables["HOURS24"].Rows.Add(dtDataRow); } if (intValue >= 0 & intValue < 51) { dtDataRow = pvtDataSet.Tables["DAYS50"].NewRow(); dtDataRow["DAYS50_DESC"] = intValue.ToString("00"); dtDataRow["DAYS50_VALUE"] = intValue; pvtDataSet.Tables["DAYS50"].Rows.Add(dtDataRow); } } for (int intValue = 180; intValue < 366; intValue++) { dtDataRow = pvtDataSet.Tables["DAYS365"].NewRow(); dtDataRow["DAYS365_VALUE"] = intValue; pvtDataSet.Tables["DAYS365"].Rows.Add(dtDataRow); } DataTable = new DataTable("MINUTE"); DataTable.Columns.Add("MINUTE_VALUE", typeof(System.Int16)); pvtDataSet.Tables.Add(DataTable); dtDataRow = pvtDataSet.Tables["MINUTE"].NewRow(); dtDataRow["MINUTE_VALUE"] = 0; pvtDataSet.Tables["MINUTE"].Rows.Add(dtDataRow); dtDataRow = pvtDataSet.Tables["MINUTE"].NewRow(); dtDataRow["MINUTE_VALUE"] = 15; pvtDataSet.Tables["MINUTE"].Rows.Add(dtDataRow); dtDataRow = pvtDataSet.Tables["MINUTE"].NewRow(); dtDataRow["MINUTE_VALUE"] = 30; pvtDataSet.Tables["MINUTE"].Rows.Add(dtDataRow); dtDataRow = pvtDataSet.Tables["MINUTE"].NewRow(); dtDataRow["MINUTE_VALUE"] = 45; pvtDataSet.Tables["MINUTE"].Rows.Add(dtDataRow); pvtDataSet.AcceptChanges(); clsISUtilities.DataBind_ComboBox_Load(this.cboNormalPaid, this.pvtDataSet.Tables["DAYS50"], "DAYS50_DESC", "DAYS50_VALUE"); clsISUtilities.DataBind_ComboBox_Load(this.cboSickPaid, this.pvtDataSet.Tables["DAYS50"], "DAYS50_DESC", "DAYS50_VALUE"); clsISUtilities.DataBind_ComboBox_Load(this.cboMaxShifts, this.pvtDataSet.Tables["DAYS365"], "DAYS365_VALUE", "DAYS365_VALUE"); clsISUtilities.NotDataBound_ComboBox(this.cboMinShiftHours, "Select Minimum Hours for a valid shift."); clsISUtilities.NotDataBound_ComboBox(this.cboMinShiftMinutes, "Select Minimum Mibnutes for a valid shift."); for (int intRow = 0; intRow < this.pvtDataSet.Tables["HOURS24"].Rows.Count; intRow++) { this.cboMinShiftHours.Items.Add(Convert.ToInt32(this.pvtDataSet.Tables["HOURS24"].Rows[intRow]["HOURS24_VALUE"]).ToString("00")); } for (int intRow = 0; intRow < this.pvtDataSet.Tables["MINUTE"].Rows.Count; intRow++) { this.cboMinShiftMinutes.Items.Add(Convert.ToInt32(this.pvtDataSet.Tables["MINUTE"].Rows[intRow]["MINUTE_VALUE"]).ToString("00")); } Load_CurrentForm_Records(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void btnSave_Click(object sender, System.EventArgs e) { try { int intReturnCode = Save_Check(); if (intReturnCode != 0) { return; } DataSet TempDataSet = new DataSet(); DataTable myDataTable = this.pvtDataSet.Tables["PaidHoliday"].Clone(); TempDataSet.Tables.Add(myDataTable); pvtDataView = null; pvtDataView = new DataView(this.pvtDataSet.Tables["PaidHoliday"], "", "", DataViewRowState.Added | DataViewRowState.Deleted | DataViewRowState.ModifiedCurrent); for (int intRow = 0; intRow < pvtDataView.Count; intRow++) { if (pvtDataView[intRow]["PUBLIC_HOLIDAY_DESC"].ToString().Trim() == "" & pvtDataView[intRow]["PUBLIC_HOLIDAY_DATE"] == System.DBNull.Value) { continue; } TempDataSet.Tables[0].ImportRow(pvtDataView[intRow].Row); } if (TempDataSet.Tables[0].Rows.Count > 0) { Int64 Int64CompanyNo = 999999; if (this.btnAll.Text == "All") { Int64CompanyNo = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); } byte[] bytCompress = clsISUtilities.Compress_DataSet(TempDataSet); object[] objParm = new object[3]; objParm[0] = Int64CompanyNo; objParm[1] = bytCompress; objParm[2] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString(); bytCompress = (byte[])clsISUtilities.DynamicFunction("Update_Records", objParm, true); pvtDataSet = null; pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(bytCompress); } btnCancel_Click(sender, e); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }