Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        public frmReadWriteFile()
        {
            InitializeComponent();

            clsISUtilities = new clsISUtilities(this, "busPayrollLogon");
            this.Paint    += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Form_Paint);

            clsISClientUtilities = new InteractPayrollClient.clsISClientUtilities(this, "busClientPayrollLogon");

            clsCrc32 = new clsCrc32();
        }
Exemple #4
0
        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 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
                    | double.TryParse(this.txtPortNumber.Text, out dblTest) == false)
                {
                    CustomClientMessageBox.Show("Setup a Valid IP / Port Number.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }
                else
                {
                    clsISClientUtilities = null;
                    clsISClientUtilities = new clsISClientUtilities(this, "busTimeAttendanceLogon");

                    int intReturnCode = clsISClientUtilities.WebService_Ping_Test();

                    if (intReturnCode == 0)
                    {
                        CustomClientMessageBox.Show("Communication Successful.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        //Form with Unsuccessful would show
                    }
                }
            }
            catch (Exception eException)
            {
            }
        }
Exemple #6
0
        static void Main(string[] args)
        {
            try
            {
                if (args.Length == 0)
                {
                    pvtblnFromWindowsService = false;
                }

                if (pvtblnFromWindowsService == false)
                {
                    Console.WriteLine("Entered ValiditeClockingsSyncViaDB");
                }

                Check_Log_For_Archiving();

                string strConfig = AppDomain.CurrentDomain.BaseDirectory + "URLClientConfig.txt";

                FileInfo fiFileInfo = new FileInfo(strConfig);

                if (fiFileInfo.Exists == true)
                {
                    StreamReader srStreamReader = File.OpenText(strConfig);

                    string strURLPath = srStreamReader.ReadLine();

                    srStreamReader.Close();

                    AppDomain.CurrentDomain.SetData("URLClientPath", strURLPath);
                }
                else
                {
                    AppDomain.CurrentDomain.SetData("URLClientPath", "");
                }

                clsISClientUtilities = new clsISClientUtilities(null, "busValiditeClockingsSyncViaDB");

                pvtDataSet = new DataSet();

                object[] objParm = new object[1];
                objParm[0] = "Hullo";
                byte[] bytCompress = (byte[])clsISClientUtilities.DynamicFunction("Insert_Records", objParm, false);

                pvtDataSet = clsISClientUtilities.DeCompress_Array_To_DataSet(bytCompress);

                if (pvtDataSet.Tables["LinksMissing"].Rows.Count > 0)
                {
                    if (pvtblnFromWindowsService == false)
                    {
                        Console.WriteLine("EMPLOYEES NOT LINKED START*********");
                    }

                    WriteLog("EMPLOYEES NOT LINKED START*********");

                    for (int intCount = 0; intCount < pvtDataSet.Tables["LinksMissing"].Rows.Count; intCount++)
                    {
                        if (pvtblnFromWindowsService == false)
                        {
                            Console.WriteLine("Employee " + pvtDataSet.Tables["LinksMissing"].Rows[intCount]["EMPLOYEE_NO"].ToString());
                        }

                        WriteLog("Employee " + pvtDataSet.Tables["LinksMissing"].Rows[intCount]["EMPLOYEE_NO"].ToString());
                    }

                    if (pvtblnFromWindowsService == false)
                    {
                        Console.WriteLine("EMPLOYEES NOT LINKED END*********");
                    }

                    WriteLog("EMPLOYEES NOT LINKED END*********");
                }

                if (pvtblnFromWindowsService == false)
                {
                    Console.WriteLine("Number of Records Inserted = " + pvtDataSet.Tables["Clockings"].Rows.Count);
                }

                WriteLog("Number of Records Inserted = " + pvtDataSet.Tables["Clockings"].Rows.Count);

                if (pvtblnFromWindowsService == false)
                {
                    Console.WriteLine("Exit ValiditeClockingsSyncViaDB");
                }
            }
            catch (Exception ex)
            {
                string strException = ex.Message;

                if (ex.InnerException != null)
                {
                    strException = strException + " " + ex.InnerException.Message;
                }

                if (pvtblnFromWindowsService == false)
                {
                    Console.WriteLine("Exception = " + strException);
                }

                WriteExceptionLog("ClockingsService", ex);
            }
            finally
            {
                if (pvtblnFromWindowsService == false)
                {
                    Console.ReadLine();
                }
            }
        }
        public void frmSplashScreen_Load(object sender, System.EventArgs e)
        {
            try
            {
                AppDomain.CurrentDomain.SetData("KillApp", "");

                this.Show();
                this.Refresh();
                Application.DoEvents();
                this.Focus();

                this.Cursor = Cursors.AppStarting;

                clsFileDownLoad = new clsFileDownLoad();

                pvtDataTable = new DataTable();

                //Get File Version and Dates from Current Directories
                pvtDataTable = clsFileDownLoad.Get_Files_Directories();

                pvtDataSet = new DataSet();

                //Local Database
                clsISClientUtilities = new clsISClientUtilities(this, "busClientPayrollLogon");

                //try
                //{
                //    //Try to Get DB Up (LocalDB)
                //    object[] objParm = null;

                //    clsISClientUtilities.DynamicFunction("Logon_Client_DataBase", objParm, false);
                //}
                //catch (Exception ex)
                //{
                //}
#if (DEBUG)
                //this.txtUserId.Text = "HelenaLR";
                //this.txtPassword.Text = "monster";
                this.txtUserId.Text   = "Interact";
                this.txtPassword.Text = "tcaretni";

                //this.txtUserId.Text = "migs";
                //this.txtPassword.Text = "migs";

                //this.txtUserId.Text = "CasperB";
                //this.txtPassword.Text = "DRIKKIE69";

                //this.txtUserId.Text = "johnnyh";
                //this.txtPassword.Text = "jesus*01";

                //this.txtUserId.Text = "henk";
                //this.txtPassword.Text = "henk";

                //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.btnConnection.Enabled = true;

                this.txtUserId.Focus();
#if (DEBUG)
                btnOK_Click(sender, e);
#endif
                this.Cursor = Cursors.Default;

                this.Focus();
            }
            catch (Exception eException)
            {
                clsISUtilities.ErrorHandler(eException);
                this.Close();
            }
        }
Exemple #8
0
        private void frmDataUpload_Load(object sender, System.EventArgs e)
        {
            try
            {
                //Move Group Boxes Over each Other
                this.grbNoDateOpen.Top = this.grbRunTimeAttendance.Top;

                clsISUtilities = new clsISUtilities(this, "busDataUpload");
                //Local
                clsISClientUtilities = new clsISClientUtilities(this, "busClientDataUpload");

                if (AppDomain.CurrentDomain.GetData("AccessInd").ToString() == "U")
                {
                    this.lblResetTimeAttendanceMenu.Visible = false;
                    this.lblOpenPayrollMenu.Visible         = false;
                }

                //Get Pay Categories on Local Mahine
                pvtDataSetClient = new DataSet();

                object[] objParm = new object[1];
                objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo"));

                blnclsISClientUtilities = true;
                pvtbytCompress          = (byte[])this.clsISClientUtilities.DynamicFunction("Get_New_Company_Records", objParm, false);

                pvtDataSetClient = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress);

                this.lblCostCentreSpreadsheetHeader.Paint  += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint);
                this.lblPayrollTypeSpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint);

                NoPayrollDateOpenDataGridViewCellStyle                    = new DataGridViewCellStyle();
                NoPayrollDateOpenDataGridViewCellStyle.BackColor          = Color.Red;
                NoPayrollDateOpenDataGridViewCellStyle.SelectionBackColor = Color.Red;

                RunTimeAttendancePendingDataGridViewCellStyle                    = new DataGridViewCellStyle();
                RunTimeAttendancePendingDataGridViewCellStyle.BackColor          = Color.Lime;
                RunTimeAttendancePendingDataGridViewCellStyle.SelectionBackColor = Color.Lime;

                RunTimeAttendanceAlreadyRunDataGridViewCellStyle                    = new DataGridViewCellStyle();
                RunTimeAttendanceAlreadyRunDataGridViewCellStyle.BackColor          = Color.Orange;
                RunTimeAttendanceAlreadyRunDataGridViewCellStyle.SelectionBackColor = Color.Orange;

                objParm    = new object[2];
                objParm[0] = Convert.ToInt64(AppDomain.CurrentDomain.GetData("CompanyNo"));
                objParm[1] = AppDomain.CurrentDomain.GetData("FromProgramInd").ToString();

                blnclsISClientUtilities = false;
                pvtbytCompress          = (byte[])clsISUtilities.DynamicFunction("Get_Form_Records_New", objParm);

                pvtDataSet = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress);

                string strPayrollType = "";

                if (this.pvtDataSet.Tables["PayrollType"].Rows.Count > 0)
                {
                    for (int intRow = 0; intRow < this.pvtDataSet.Tables["PayrollType"].Rows.Count; intRow++)
                    {
                        this.dgvPayrollTypeDataGridView.Rows.Add("",
                                                                 this.pvtDataSet.Tables["PayrollType"].Rows[intRow]["PAYROLL_TYPE"].ToString());

                        strPayrollType = this.pvtDataSet.Tables["PayrollType"].Rows[intRow]["PAYROLL_TYPE"].ToString().Substring(0, 1);

                        pvtPayCategoryDataView = null;
                        pvtPayCategoryDataView = new DataView(pvtDataSet.Tables["PayCategory"],
                                                              "COMPANY_NO = " + AppDomain.CurrentDomain.GetData("CompanyNo").ToString() + "AND PAY_CATEGORY_TYPE = '" + strPayrollType + "'",
                                                              "",
                                                              DataViewRowState.CurrentRows);

                        if (pvtPayCategoryDataView.Count == 0)
                        {
                            this.dgvPayrollTypeDataGridView[0, intRow].Style = this.NoPayrollDateOpenDataGridViewCellStyle;
                        }
                        else
                        {
                            switch (strPayrollType)
                            {
                            case "W":

                                if (this.pvtDataSet.Tables["Company"].Rows[0]["WAGE_RUN_IND"].ToString() == "N")
                                {
                                    this.dgvPayrollTypeDataGridView[0, intRow].Style = this.RunTimeAttendancePendingDataGridViewCellStyle;
                                }
                                else
                                {
                                    this.dgvPayrollTypeDataGridView[0, intRow].Style = this.RunTimeAttendanceAlreadyRunDataGridViewCellStyle;
                                }

                                break;

                            case "S":

                                if (this.pvtDataSet.Tables["Company"].Rows[0]["SALARY_RUN_IND"].ToString() == "Y")
                                {
                                    this.dgvPayrollTypeDataGridView[0, intRow].Style = this.RunTimeAttendancePendingDataGridViewCellStyle;
                                }
                                else
                                {
                                    this.dgvPayrollTypeDataGridView[0, intRow].Style = this.RunTimeAttendanceAlreadyRunDataGridViewCellStyle;
                                }

                                break;

                            case "T":

                                if (this.pvtDataSet.Tables["Company"].Rows[0]["TIME_ATTENDANCE_RUN_IND"].ToString() == "N")
                                {
                                    this.dgvPayrollTypeDataGridView[0, intRow].Style = this.RunTimeAttendancePendingDataGridViewCellStyle;
                                }
                                else
                                {
                                    this.dgvPayrollTypeDataGridView[0, intRow].Style = this.RunTimeAttendanceAlreadyRunDataGridViewCellStyle;
                                }

                                break;
                            }
                        }
                    }

                    pvtblnPayrollTypeDataGridViewLoaded = true;

                    this.Set_DataGridView_SelectedRowIndex(dgvPayrollTypeDataGridView, 0);
                }
            }
            catch (Exception eException)
            {
                if (blnclsISClientUtilities == true)
                {
                    clsISClientUtilities.ErrorHandler(eException);
                }
                else
                {
                    clsISUtilities.ErrorHandler(eException);
                }
            }
        }