private void frmSetupInternetWebServerIP_Load(object sender, EventArgs e) { miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem"); clsISUtilities = null; clsISUtilities = new clsISUtilities(this, "busPayrollLogon"); clsISUtilities.Set_WebService_Timeout_Value(50000); FileInfo fiFileInfo = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "URLConfig.txt"); if (fiFileInfo.Exists == true) { StreamReader srStreamReader = File.OpenText(AppDomain.CurrentDomain.BaseDirectory + "URLConfig.txt"); strURLPath = srStreamReader.ReadLine(); srStreamReader.Close(); strIP = strURLPath.Split('.'); if (strIP.Length == 4) { Load_IP_And_Disable(); this.btnTest.Enabled = true; } else { CustomMessageBox.Show("Error in 'URLConfig.txt'.\n\nSpeak to System Administrator", "File Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public frmSplashScreen() { InitializeComponent(); clsISUtilities = null; clsISUtilities = new clsISUtilities(this, "busPayrollLogon"); this.lblHeader.MouseDown += new System.Windows.Forms.MouseEventHandler(clsISUtilities.lblHeader_MouseDown); this.lblHeader.MouseMove += new System.Windows.Forms.MouseEventHandler(clsISUtilities.lblHeader_MouseMove); this.lblHeader.MouseUp += new System.Windows.Forms.MouseEventHandler(clsISUtilities.lblHeader_MouseUp); this.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Form_Paint); clsISUtilities.Set_WebService_Timeout_Value(20000); }
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 frmBackupDatabase_Load(object sender, EventArgs e) { try { clsISUtilities = new clsISUtilities(this, "busBackupRestoreDatabase"); //10 Times Normal Timeout int intTimeout = Convert.ToInt32(AppDomain.CurrentDomain.GetData("TimeSheetReadTimeoutSeconds")) * 1000 * 10; clsISUtilities.Set_WebService_Timeout_Value(intTimeout); string strDatabaseName = ""; DataSet DataSet = (DataSet)AppDomain.CurrentDomain.GetData("DataSet"); for (int intRow = 0; intRow < DataSet.Tables["Company"].Rows.Count; intRow++) { if (Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")) == Convert.ToInt64(DataSet.Tables["Company"].Rows[intRow]["COMPANY_NO"])) { strDatabaseName = DataSet.Tables["Company"].Rows[intRow]["COMPANY_DESC"].ToString(); break; } } if (strDatabaseName != "") { this.lblDescription.Text = "Backup Database '" + strDatabaseName + "'?"; this.btnOK.Enabled = true; } } 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 btnOK_Click(object sender, System.EventArgs e) { try { this.Cursor = Cursors.AppStarting; clsISUtilities.Set_WebService_Timeout_Value(30000); this.txtUserId.Enabled = false; this.txtPassword.Enabled = false; this.btnOK.Enabled = false; object[] objParm = null; string strClientDBConnected = "Y"; DataSet DataSet = new DataSet(); try { //Check Client Databse ia Available / Check Tables are Correct pvtblnInternetBeingUsed = false; pvtbytCompress = (byte[])clsISClientUtilities.DynamicFunction("Logon_Client_DataBase", objParm, false); DataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); } catch (Exception ex) { strClientDBConnected = "N"; } if (pvtDataSet.Tables["ReturnValues"] != null) { pvtDataSet.Tables.Remove("ReturnValues"); } if (this.txtUserId.Text.Trim() == "") { this.Cursor = Cursors.Default; this.txtUserId.Enabled = true; this.txtPassword.Enabled = true; this.btnOK.Enabled = true; MessageBox.Show("Enter " + this.lblUserEmployee.Text + ".", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtUserId.Focus(); } else { if (this.txtPassword.Text.Trim() == "") { this.Cursor = Cursors.Default; this.txtUserId.Enabled = true; this.txtPassword.Enabled = true; this.btnOK.Enabled = true; MessageBox.Show("Enter Password.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtPassword.Focus(); } else { pvtstrUserInformation = this.txtUserId.Text.Trim().ToUpper() + "|" + this.txtPassword.Text.Trim().ToUpper(); this.btnOK.Enabled = false; this.txtUserId.Enabled = false; this.txtPassword.Enabled = false; objParm = new object[2]; objParm[0] = pvtstrUserInformation; objParm[1] = strClientDBConnected; pvtbytCompress = (byte[])clsISUtilities.DynamicFunction("Logon_User_TimeAttendance", objParm); pvtTempDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress); pvtDataSet.Merge(pvtTempDataSet); pvtint64UserNo = Convert.ToInt64(pvtDataSet.Tables["ReturnValues"].Rows[0]["USER_NO"]); pvtstrResetInd = pvtDataSet.Tables["ReturnValues"].Rows[0]["RESET_IND"].ToString(); pvtstrAccessInd = pvtDataSet.Tables["ReturnValues"].Rows[0]["ACCESS_IND"].ToString(); pvtint64LastCompanyNo = Convert.ToInt64(pvtDataSet.Tables["ReturnValues"].Rows[0]["LAST_COMPANY_NO"]); pvtstrPayCategoryType = pvtDataSet.Tables["ReturnValues"].Rows[0]["LAST_PAY_CATEGORY_TYPE"].ToString(); if (pvtint64UserNo == -1) { MessageBox.Show(this.lblUserEmployee.Text + " Id / Password NOT Found.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtUserId.Enabled = true; this.txtPassword.Enabled = true; this.btnOK.Enabled = true; return; } else { if (pvtDataSet.Tables["ReturnValues"].Rows[0]["LOCK_IND"].ToString() == "Y") { frmLock frmLock = new frmLock(); frmLock.ShowDialog(); //Set so That Lower Down in Program it Closes in exe AppDomain.CurrentDomain.SetData("UserNo", -1); this.Close(); return; } else { if (pvtstrResetInd == "Y") { AppDomain.CurrentDomain.SetData("UserNo", pvtint64UserNo); //Password Change frmPasswordChange = new frmPasswordChange(); frmPasswordChange.ShowDialog(); if (AppDomain.CurrentDomain.GetData("PasswordChanged").ToString() != "Y") { //Set so That Lower Down in Program it Closes in exe AppDomain.CurrentDomain.SetData("UserNo", -1); this.Close(); return; } frmPasswordChange = null; } //Interact System Administrator if (pvtint64UserNo == 0) { if (pvtDataSet.Tables["MenuTag"] != null) { if (Convert.ToInt32(pvtDataSet.Tables["MenuTag"].Rows[0]["NULL_COUNT"]) > 0) { MessageBox.Show("TABLE 'MENU_FILE_NAME' Has NO Menu Tag"); } pvtDataSet.Tables.Remove("MenuTag"); } } this.btnOK.Enabled = false; AppDomain.CurrentDomain.SetData("Logoff", false); #if (DEBUG) //Errol Temp Remove //if (AppDomain.CurrentDomain.GetData("URLPath").ToString() != "") //{ pvtDataSet.Tables["Files"].Clear(); //} #endif //SET ALL GLOBAL VARIABLES HERE AppDomain.CurrentDomain.SetData("UserNo", pvtint64UserNo); AppDomain.CurrentDomain.SetData("AccessInd", pvtstrAccessInd); AppDomain.CurrentDomain.SetData("LastCompanyNo", pvtint64LastCompanyNo); if (pvtDataSet.Tables["Files"].Rows.Count > 0) { //Check for any Downloads bool blnLogoff = false; int intReturnCode = clsFileDownLoad.DownLoad_Files(ref pvtDataSet, ref DataSet, ref blnLogoff, strClientDBConnected); if (intReturnCode == 99) { //Restart Windows Service frmRestartService frmRestartService = new frmRestartService(DataSet.Tables["ReturnValues"].Rows[0]["MACHINE_NAME"].ToString(), DataSet.Tables["ReturnValues"].Rows[0]["MACHINE_IP"].ToString()); frmRestartService.Show(); try { clsRestartFingerPrintClockTimeAttendanceService clsRestartFingerPrintClockTimeAttendanceService; if (AppDomain.CurrentDomain.GetData("URLClientPath").ToString() != "") { //Calls Web Service Internally clsRestartFingerPrintClockTimeAttendanceService = new clsRestartFingerPrintClockTimeAttendanceService(""); InteractPayrollClient.Restart Restart = (InteractPayrollClient.Restart)clsRestartFingerPrintClockTimeAttendanceService.DynamicFunction("RestartFingerPrintClockTimeAttendanceService", null); if (Restart.OK == "Y") { } else { MessageBox.Show("Failed to Restart 'FingerPrintClockTimeAttendanceService' Service.\n\nSpeak to System Administrator.\n\nReboot of Machine '" + pvtDataSet.Tables["ReturnValues"].Rows[0]["MACHINE_NAME"].ToString() + "' (IP = " + pvtDataSet.Tables["ReturnValues"].Rows[0]["MACHINE_IP"].ToString() + ")\n will Allow you to Continue.", "Program Changes", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { clsRestartFingerPrintClockTimeAttendanceService = new clsRestartFingerPrintClockTimeAttendanceService("FingerPrintClockServiceStartStop"); object Restart = clsRestartFingerPrintClockTimeAttendanceService.DynamicFunction("RestartFingerPrintClockTimeAttendanceService", null); string strRestart = Restart.ToString(); if (strRestart.IndexOf("FingerPrintClockServer.Restart") > -1) { //Not Really True } else { MessageBox.Show("Failed to Restart 'FingerPrintClockTimeAttendanceService' Service.\n\nSpeak to System Administrator.\n\nReboot of Machine '" + pvtDataSet.Tables["ReturnValues"].Rows[0]["MACHINE_NAME"].ToString() + "' (IP = " + pvtDataSet.Tables["ReturnValues"].Rows[0]["MACHINE_IP"].ToString() + ")\n will Allow you to Continue.", "Program Changes", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } catch { MessageBox.Show("Failed to Restart 'FingerPrintClockTimeAttendanceService' Service.\n\nSpeak to System Administrator.\n\nReboot of Machine '" + pvtDataSet.Tables["ReturnValues"].Rows[0]["MACHINE_NAME"].ToString() + "' (IP = " + pvtDataSet.Tables["ReturnValues"].Rows[0]["MACHINE_IP"].ToString() + ")\n will Allow you to Continue.", "Program Changes", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } frmRestartService.Close(); } else { if (intReturnCode != 0) { if (AppDomain.CurrentDomain.GetData("KillApp").ToString() == "Y") { } else { MessageBox.Show("Error In Download of File.\nProgram Closing.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } //Force Program To Close AppDomain.CurrentDomain.SetData("UserNo", -1); this.Close(); return; } if (blnLogoff == true) { AppDomain.CurrentDomain.SetData("Logoff", true); } } if (strClientDBConnected == "Y") { if (DataSet.Tables["FileToDelete"].Rows.Count > 0) { DataSet myDataSet = new System.Data.DataSet(); DataTable myDataTable = DataSet.Tables["FileToDelete"].Copy(); myDataSet.Tables.Add(myDataTable); byte[] mybytCompress = clsISClientUtilities.Compress_DataSet(DataSet); object[] obj = new object[1]; obj[0] = mybytCompress; pvtblnInternetBeingUsed = false; clsISClientUtilities.DynamicFunction("Cleanup_Client_DataBase_Files", obj, false); } } } else { //Delete Any Version Sub Directories string strDirectory = ""; for (int intRow = 0; intRow < pvtDataTable.Rows.Count; intRow++) { strDirectory = AppDomain.CurrentDomain.BaseDirectory + pvtDataTable.Rows[intRow]["PROJECT_VERSION"].ToString(); if (Directory.Exists(strDirectory) == true) { // Delete the target to ensure it is not there. Directory.Delete(strDirectory, true); } } } pvtDataSet.Tables.Remove(pvtDataSet.Tables["Files"]); clsFileDownLoad = null; if (pvtstrPayCategoryType == "") { pvtstrPayCategoryType = "T"; } AppDomain.CurrentDomain.SetData("LastPayCategoryType", pvtstrPayCategoryType); if (pvtstrAccessInd == "S") { if (pvtstrEditHelpInd == null) { //Initial Communication Failure (Reset via Connection Button) AppDomain.CurrentDomain.SetData("EditHelpInd", "N"); } else { AppDomain.CurrentDomain.SetData("EditHelpInd", pvtstrEditHelpInd.Substring(0, 1)); } } else { AppDomain.CurrentDomain.SetData("EditHelpInd", "N"); } //Used in Employee Form to Show Tax Rate if (pvtstrEditHelpInd == null) { AppDomain.CurrentDomain.SetData("TaxCasual", 25); } else { AppDomain.CurrentDomain.SetData("TaxCasual", pvtstrEditHelpInd.Substring(pvtstrEditHelpInd.IndexOf(",") + 1)); } AppDomain.CurrentDomain.SetData("CurrentForm", ""); AppDomain.CurrentDomain.SetData("DataSet", this.pvtDataSet); string strPath = AppDomain.CurrentDomain.BaseDirectory + "TimeAttendanceMain.dll"; AppDomain.CurrentDomain.SetData("StartUpFile", strPath); this.Close(); } } } } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }
public void frmLogonScreen_Load(object sender, System.EventArgs e) { try { this.Show(); this.Refresh(); Application.DoEvents(); this.Cursor = Cursors.AppStarting; clsCrc32 = new clsCrc32(); clsISClientUtilities = new clsISClientUtilities(this, "busTimeAttendanceLogon"); this.lblHeader.MouseDown += new System.Windows.Forms.MouseEventHandler(clsISClientUtilities.lblHeader_MouseDown); this.lblHeader.MouseMove += new System.Windows.Forms.MouseEventHandler(clsISClientUtilities.lblHeader_MouseMove); this.lblHeader.MouseUp += new System.Windows.Forms.MouseEventHandler(clsISClientUtilities.lblHeader_MouseUp); this.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Form_Paint); //Cause Paint this.Refresh(); clsISUtilities = new clsISUtilities(this, "busPayrollLogon"); clsISUtilities.Set_WebService_Timeout_Value(30000); if (AppDomain.CurrentDomain.GetData("URLClientPath").ToString() != "") { this.txtIPAddressPortNo.Text = AppDomain.CurrentDomain.GetData("URLClientPath").ToString(); this.Refresh(); int intReturnCode = clsISClientUtilities.WebService_Ping_Test(); if (intReturnCode == 0) { this.txtUserId.Enabled = true; this.txtPassword.Enabled = true; this.btnOK.Enabled = true; } } else { this.txtIPAddressPortNo.Text = "Late Binding"; this.txtUserId.Enabled = true; this.txtPassword.Enabled = true; this.btnOK.Enabled = true; } pvtDataSet = new DataSet(); #if (DEBUG) { this.txtUserId.Text = "Interact"; this.txtPassword.Text = "tcaretni"; //this.txtUserId.Text = "helenalr"; //this.txtPassword.Text = "monster"; //this.txtUserId.Text = "TyroneS"; //this.txtPassword.Text = "271083"; //this.txtUserId.Text = "ChristineG"; //this.txtPassword.Text = "CHRIS1"; //this.txtUserId.Text = "MIGS"; //this.txtPassword.Text = "MIGS"; //this.txtUserId.Text = "TREVOR"; //this.txtPassword.Text = "3636"; //this.txtUserId.Text = "JAMESM"; //this.txtPassword.Text = "JAMES456"; } #endif this.txtUserId.Focus(); #if (DEBUG) SendKeys.Send("{ENTER}"); #endif this.Cursor = Cursors.Default; } catch (Exception eException) { clsISClientUtilities.ErrorHandler(eException); this.txtUserId.Enabled = true; this.txtPassword.Enabled = true; this.Cursor = Cursors.Default; this.btnOK.Enabled = true; } }
private void frmTimeAttendanceMain_Load(object sender, EventArgs e) { try { AppDomain.CurrentDomain.SetData("Globe", pnlGlobe); clsISClientUtilities = new clsISClientUtilities(this, "busTimeAttendanceMain"); clsISUtilities = new clsISUtilities(this, "busPayrollLogon"); clsISUtilities.Set_WebService_Timeout_Value(50000); clsFileDownLoad = new clsFileDownLoad(); if (AppDomain.CurrentDomain.GetData("AccessInd").ToString() == "U") { toolStripSeparator1.Visible = false; this.setupToolStripMenuItem.Visible = false; this.viewToolStripMenuItem.Visible = false; this.UserToolStripButton.Visible = false; this.DeviceToolStripButton.Visible = false; this.employeeToolStripButton.Visible = false; this.employeeGroupToolStripButton.Visible = false; this.deviceEmployeeToolStripButton.Visible = false; } pvtstrWebServerBeenUsed = "L"; byte[] bytCompress = (byte[])clsISClientUtilities.DynamicFunction("Get_Form_Records", null, false); DataSet DataSet = clsISClientUtilities.DeCompress_Array_To_DataSet(bytCompress); FileInfo fiFileInfo = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "URLClientConfig.txt"); if (fiFileInfo.Exists == true) { StreamReader srStreamReader = File.OpenText(AppDomain.CurrentDomain.BaseDirectory + "URLClientConfig.txt"); string strURLClientConfig = srStreamReader.ReadLine(); string[] strParameters = strURLClientConfig.Split(':'); if (strParameters.Length != 2) { System.Windows.Forms.MessageBox.Show("Error in 'URLClientConfig.txt'. Contents = " + strURLClientConfig + "\n\nSpeak to System Administrator.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } if (strParameters[0] == "0.0.0.0") { this.Text += " [Local]"; } else { this.Text += " [" + strURLClientConfig + "]"; } } else { this.Text += " [Local]"; } string strSoftwareToUse = ""; if (DataSet.Tables["SoftwareToUse"].Rows.Count == 0) { strSoftwareToUse = "D"; } else { strSoftwareToUse = DataSet.Tables["SoftwareToUse"].Rows[0]["FINGERPRINT_SOFTWARE_IND"].ToString(); } AppDomain.CurrentDomain.SetData("BiometricSoftware", strSoftwareToUse); AppDomain.CurrentDomain.SetData("MdiForm", this); if (strSoftwareToUse == "D") { this.Text += " [Digital Persona]"; } else { this.Text += " [Griaule]"; } AppDomain.CurrentDomain.SetData("InternetGlobe", this.pnlGlobe); } catch (Exception eException) { clsISClientUtilities.ErrorHandler(eException); } }
private void frmRestoreDatabase_Load(object sender, EventArgs e) { try { if (AppDomain.CurrentDomain.GetData("AccessInd").ToString() == "S") { this.btnDelete.Visible = true; } clsISUtilities = new clsISUtilities(this, "busBackupRestoreDatabase"); //10 Times Normal Timeout int intTimeout = Convert.ToInt32(AppDomain.CurrentDomain.GetData("TimeSheetReadTimeoutSeconds")) * 1000 * 10; clsISUtilities.Set_WebService_Timeout_Value(intTimeout); this.lblFilesHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint); object[] objParm = new object[1]; objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo")); byte[] byteCompress = (byte[])clsISUtilities.DynamicFunction("Get_Restore_Files", objParm); pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(byteCompress); if (pvtDataSet.Tables["CompanyKey"].Rows.Count > 0) { this.chkCopy.Checked = true; this.grbDynamicTimeSheet.Visible = true; } string strPayrollRunDate = ""; string strBackupDate = ""; pvtDataView = new DataView(pvtDataSet.Tables["File"], "", "BACKUP_DATETIME DESC", DataViewRowState.CurrentRows); for (int intRow = 0; intRow < pvtDataView.Count; intRow++) { if (pvtDataView[intRow]["PAYROLL_RUN_DATETIME"] != System.DBNull.Value) { strPayrollRunDate = Convert.ToDateTime(pvtDataView[intRow]["PAYROLL_RUN_DATETIME"]).ToString("yyyy-MM-dd"); } else { strPayrollRunDate = ""; } if (pvtDataView[intRow]["BACKUP_DATETIME"] != System.DBNull.Value) { strBackupDate = Convert.ToDateTime(pvtDataView[intRow]["BACKUP_DATETIME"]).ToString("yyyy-MM-dd HH:mm:ss"); } else { strBackupDate = ""; } this.dgvFilesDataGridView.Rows.Add(strBackupDate, pvtDataView[intRow]["PAY_CATEGORY_TYPE"].ToString(), strPayrollRunDate, pvtDataView[intRow]["BACKUP_FILE_NAME"].ToString()); } if (pvtDataView.Count > 0) { this.btnOK.Enabled = true; } } catch (Exception eException) { clsISUtilities.ErrorHandler(eException); } }