private void btnDelete_Click(object sender, EventArgs e) { try { DialogResult dlgResult = CustomMessageBox.Show("Are you sure you want to Delete this File?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dlgResult == DialogResult.Yes) { object[] objParm = new object[3]; objParm[0] = pvtintUserNo; objParm[1] = pvtstrFileUploadDatetime; objParm[2] = pvtstrFileName; clsISUtilities.DynamicFunction("Delete_Record", objParm); this.pvtUserFileDataview[pvtintUserFileDataGridViewRowIndex].Delete(); this.pvtDataSet.AcceptChanges(); this.Set_DataGridView_SelectedRowIndex(this.dgvUserDataGridView, this.Get_DataGridView_SelectedRowIndex(this.dgvUserDataGridView)); } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void btnFile_Click(object sender, EventArgs e) { try { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "All files (*.*)|*.*"; dialog.Title = "Select a File to Upload."; if (dialog.ShowDialog() == DialogResult.OK) { this.txtFilePath.Text = dialog.FileName; pvtstrFileName = dialog.SafeFileName; this.btnUpload.Enabled = true; } else { this.txtFilePath.Text = ""; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void rbnSelectedEmployees_Click(object sender, EventArgs e) { try { if (rbnSelectedEmployees.Checked == true & this.dgvPayPeriodDataGridView.Rows.Count > 0) { this.grbEmployeeSelection.Enabled = true; this.Clear_DataGridView(this.dgvPayCategoryDataGridView); this.Clear_DataGridView(this.dgvEmployeeDataGridView); this.Clear_DataGridView(this.dgvChosenEmployeeDataGridView); pvtblnPayCategoryDataGridViewLoaded = false; pvtPayCategoryDataView = null; pvtPayCategoryDataView = new DataView(this.pvtDataSet.Tables["PayCategory"], "COMPANY_NO = " + Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")) + " AND PAY_CATEGORY_TYPE = '" + pvtstrPayrollType + "'", "PAY_CATEGORY_DESC", DataViewRowState.CurrentRows); for (int intRow = 0; intRow < pvtPayCategoryDataView.Count; intRow++) { this.dgvPayCategoryDataGridView.Rows.Add(pvtPayCategoryDataView[intRow]["PAY_CATEGORY_DESC"].ToString(), pvtPayCategoryDataView[intRow]["PAY_CATEGORY_NO"].ToString()); } pvtblnPayCategoryDataGridViewLoaded = true; if (this.dgvPayCategoryDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(this.dgvPayCategoryDataGridView, 0); } this.btnAdd.Enabled = true; this.btnAddAll.Enabled = true; this.btnRemove.Enabled = true; this.btnRemoveAll.Enabled = true; this.tabControl.SelectedIndex = 0; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
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 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 btnTest_Click(object sender, EventArgs e) { try { double dblTest = 0; if (double.TryParse(this.txtIP1.Text, out dblTest) == false | double.TryParse(this.txtIP2.Text, out dblTest) == false | double.TryParse(this.txtIP3.Text, out dblTest) == false | double.TryParse(this.txtIP4.Text, out dblTest) == false) { CustomMessageBox.Show("Setup a Valid IP Number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { object[] obj = null; string strOk = (string)clsISUtilities.DynamicFunction("Ping", obj); if (strOk == "OK") { CustomMessageBox.Show("Communication Successful.", "Communication", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { clsISUtilities.ErrorHandler(ex); } }
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 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 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); } }
public void btnSave_Click(object sender, System.EventArgs e) { try { int intDataViewRow = 0; for (int intRow = 0; intRow < pvtEmployeeDataView.Count; intRow++) { intDataViewRow = Convert.ToInt32(this.dgvEmployeesDataGridView[7, intRow].Value); if (Convert.ToDouble(this.dgvEmployeesDataGridView[4, intRow].Value) == Convert.ToDouble(pvtEmployeeDataView[intDataViewRow]["PREV_NORMAL_LEAVE_DAYS"]) & Convert.ToDouble(this.dgvEmployeesDataGridView[5, intRow].Value) == Convert.ToDouble(pvtEmployeeDataView[intDataViewRow]["NORMAL_LEAVE_DAYS"]) & Convert.ToDouble(this.dgvEmployeesDataGridView[6, intRow].Value) == Convert.ToDouble(pvtEmployeeDataView[intDataViewRow]["SICK_LEAVE_DAYS"])) { continue; } pvtEmployeeDataView[intDataViewRow]["PREV_NORMAL_LEAVE_DAYS"] = Math.Round(Convert.ToDouble(this.dgvEmployeesDataGridView[4, intRow].Value), 2); pvtEmployeeDataView[intDataViewRow]["NORMAL_LEAVE_DAYS"] = Math.Round(Convert.ToDouble(this.dgvEmployeesDataGridView[5, intRow].Value), 2); pvtEmployeeDataView[intDataViewRow]["SICK_LEAVE_DAYS"] = Math.Round(Convert.ToDouble(this.dgvEmployeesDataGridView[6, intRow].Value), 2); } pvtTempDataSet = null; pvtTempDataSet = new DataSet(); DataTable myDataTable = this.pvtDataSet.Tables["Employee"].Clone(); pvtTempDataSet.Tables.Add(myDataTable); if (pvtEmployeeDataView != null) { for (int intRow = 0; intRow < pvtEmployeeDataView.Count; intRow++) { if (pvtEmployeeDataView[intRow].Row.RowState == DataRowState.Modified) { pvtTempDataSet.Tables["Employee"].ImportRow(pvtEmployeeDataView[intRow].Row); } } } if (pvtTempDataSet.Tables["Employee"].Rows.Count > 0) { //Compress DataSet pvtbytCompress = clsISUtilities.Compress_DataSet(pvtTempDataSet); object[] objParm = new object[2]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = pvtbytCompress; clsISUtilities.DynamicFunction("Update_Record", objParm); } this.pvtDataSet.AcceptChanges(); btnCancel_Click(sender, e); } 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 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 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 rbnEmployeeSelected_CheckedChanged(object sender, EventArgs e) { try { if (rbnEmployeeSelected.Checked == true) { pvtblnPayCategoryDataGridViewLoaded = false; this.Clear_DataGridView(this.dgvPayCategoryDataGridView); this.Clear_DataGridView(this.dgvEmployeeDataGridView); this.Clear_DataGridView(this.dgvChosenEmployeeDataGridView); this.btnEmployeeAdd.Enabled = true; this.btnEmployeeAddAll.Enabled = true; this.btnEmployeeRemoveAll.Enabled = true; this.btnEmployeeRemove.Enabled = true; this.grbEmployeeSelection.Enabled = true; this.rbnByPayCategory.Checked = true; for (int intIndex = 0; intIndex < pvtPayCategoryDataView.Count; intIndex++) { this.dgvPayCategoryDataGridView.Rows.Add(pvtPayCategoryDataView[intIndex]["PAY_CATEGORY_DESC"].ToString(), pvtPayCategoryDataView[intIndex]["PAY_CATEGORY_NO"].ToString()); } pvtblnPayCategoryDataGridViewLoaded = true; if (this.dgvPayCategoryDataGridView.Rows.Count > 0) { this.Set_DataGridView_SelectedRowIndex(this.dgvPayCategoryDataGridView, 0); } this.tabControl.SelectedIndex = 0; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
public void frmSplashScreen_Load(object sender, System.EventArgs e) { try { AppDomain.CurrentDomain.SetData("KillApp", ""); this.Show(); this.Refresh(); Application.DoEvents(); this.Cursor = Cursors.AppStarting; clsFileDownLoad = new clsFileDownLoad(); pvtDataTable = new DataTable(); //Get File Version and Dates from Current Directories pvtDataTable = clsFileDownLoad.Get_Files_Directories(); clsISUtilities = null; clsISUtilities = new clsISUtilities(this, "busPayrollLogon"); pvtDataSet = new DataSet(); //Local Database clsISClientUtilities = new clsISClientUtilities(this, "busClientPayrollLogon"); #if (DEBUG) //this.txtUserId.Text = "JOHNNYH"; //this.txtPassword.Text = "JESUS*01"; this.txtUserId.Text = "Interact"; this.txtPassword.Text = "tcaretni"; //this.txtUserId.Text = "gary"; //this.txtPassword.Text = "garylr"; //this.txtUserId.Text = "errol"; //this.txtPassword.Text = "errol"; #endif this.txtUserId.Enabled = true; this.txtPassword.Enabled = true; this.btnOK.Enabled = true; this.txtUserId.Focus(); #if (DEBUG) SendKeys.Send("{ENTER}"); #endif this.Cursor = Cursors.Default; } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); this.Close(); } }
private void frmEmployeeRecover_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(); clsDBConnectionObjects = new InteractPayroll.clsDBConnectionObjects(); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
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 btnSave_Click(object sender, EventArgs e) { try { DataSet tempDataSet = new DataSet(); tempDataSet.Tables.Add(pvtDataSet.Tables["Earning"].Clone()); pvtEarningDataView = null; pvtEarningDataView = new DataView(this.pvtDataSet.Tables["Earning"], "PAY_CATEGORY_NO = " + pvtintPayCategoryNo + " AND EMPLOYEE_NO = " + this.pvtintEmployeeNo, "", DataViewRowState.Added | DataViewRowState.ModifiedCurrent); for (int intRow = 0; intRow < pvtEarningDataView.Count; intRow++) { tempDataSet.Tables["Earning"].ImportRow(pvtEarningDataView[intRow].Row); } tempDataSet.Tables.Add(pvtDataSet.Tables["Deduction"].Clone()); pvtEarningDataView = null; pvtEarningDataView = new DataView(this.pvtDataSet.Tables["Deduction"], "EMPLOYEE_NO = " + this.pvtintEmployeeNo, "", DataViewRowState.Added | DataViewRowState.ModifiedCurrent); for (int intRow = 0; intRow < pvtEarningDataView.Count; intRow++) { tempDataSet.Tables["Deduction"].ImportRow(pvtEarningDataView[intRow].Row); } byte[] bytCompress = clsISUtilities.Compress_DataSet(tempDataSet); object[] objParm = new object[5]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = pvtintPayCategoryNo; objParm[2] = pvtstrNormPaidPerPeriod; objParm[3] = pvtstrSickPaidPerPeriod; objParm[4] = bytCompress; clsISUtilities.DynamicFunction("Update_Employee_Earnings_Deductions", objParm); this.pvtDataSet.AcceptChanges(); btnCancel_Click(null, e); } 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); } }
public void btnSave_Click(object sender, System.EventArgs e) { try { pvtTempDataSet = null; pvtTempDataSet = new DataSet(); DataTable myDataTable; myDataTable = this.pvtDataSet.Tables["EmployeeEarning"].Clone(); pvtTempDataSet.Tables.Add(myDataTable); for (int intRow = 0; intRow < pvtEmployeeEarningDataView.Count; intRow++) { if (pvtEmployeeEarningDataView[intRow].Row.RowState == DataRowState.Modified) { pvtTempDataSet.Tables["EmployeeEarning"].ImportRow(pvtEmployeeEarningDataView[intRow].Row); } } myDataTable = this.pvtDataSet.Tables["EmployeeDeduction"].Clone(); pvtTempDataSet.Tables.Add(myDataTable); for (int intRow = 0; intRow < pvtEmployeeDeductionDataView.Count; intRow++) { if (pvtEmployeeDeductionDataView[intRow].Row.RowState == DataRowState.Modified) { pvtTempDataSet.Tables["EmployeeDeduction"].ImportRow(pvtEmployeeDeductionDataView[intRow].Row); } } //Compress DataSet pvtbytCompress = clsISUtilities.Compress_DataSet(pvtTempDataSet); object[] objParm = new object[3]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); objParm[1] = pvtbytCompress; objParm[2] = this.dgvPayrollTypeDataGridView[0, this.Get_DataGridView_SelectedRowIndex(dgvPayrollTypeDataGridView)].Value.ToString().Substring(0, 1); clsISUtilities.DynamicFunction("Update_Records", objParm, true); this.pvtDataSet.AcceptChanges(); btnCancel_Click(null, null); } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void btnOK_Click(object sender, System.EventArgs e) { try { if (this.txtPassword1.Text.Trim().ToUpper() == this.txtPassword2.Text.Trim().ToUpper()) { if (this.txtPassword1.Text.Trim() == "") { CustomMessageBox.Show("Enter Passwords", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtPassword1.Focus(); return; } } else { CustomMessageBox.Show("Passwords are NOT the same", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtPassword1.Focus(); return; } DialogResult dlgResult = CustomMessageBox.Show("Are you sure you want to Change your Password?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dlgResult == DialogResult.Yes) { string strPassword = this.txtPassword1.Text.Trim().ToUpper(); Int64 int64CurrentUserNo = Convert.ToInt64(AppDomain.CurrentDomain.GetData("UserNo")); object[] objParm = new object[2]; objParm[0] = int64CurrentUserNo; objParm[1] = strPassword; clsISUtilities.DynamicFunction("Update_Password", objParm, true); AppDomain.CurrentDomain.SetData("PasswordChanged", "Y"); AppDomain.CurrentDomain.SetData("NewPassword", strPassword); this.Close(); } } 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 btnTestConnection_Click(object sender, EventArgs e) { try { string strNewURL = ""; #if (DEBUG) #else strNewURL = this.txtIP1.Text + "." + this.txtIP2.Text + "." + this.txtIP3.Text + "." + this.txtIP4.Text; #endif AppDomain.CurrentDomain.SetData("URLPath", strNewURL); clsISUtilities = null; clsISUtilities = new clsISUtilities(null, "busPayrollLogon"); clsISUtilities.Set_WebService_Timeout_Value(15000); string strOk = (string)clsISUtilities.DynamicFunction("Ping", null); if (strOk == "OK") { MessageBox.Show("Communication Successful.", "Communication", MessageBoxButtons.OK, MessageBoxIcon.Information); clsISUtilities = null; clsISUtilities = new clsISUtilities(null, "busEmployeeRecover"); this.btnRunFix.Enabled = true; } else { this.btnRunFix.Enabled = true; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
private void frmPassword_Load(object sender, System.EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busPasswordReset"); this.lblUser.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); Load_CurrentForm_Records(); } 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); } }