Exemplo n.º 1
0
        private void btnSetup_Click(object sender, EventArgs e)
        {
            frmConnectionSetup frmConnectionSetup = new frmConnectionSetup();

            frmConnectionSetup.ShowDialog();

            if (this.txtIPAddressPortNo.Text != AppDomain.CurrentDomain.GetData("URLClientPath").ToString())
            {
                this.txtIPAddressPortNo.Text = AppDomain.CurrentDomain.GetData("URLClientPath").ToString();

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

                if (AppDomain.CurrentDomain.GetData("URLClientPath").ToString() != "")
                {
                    int intReturnCode = clsISClientUtilities.WebService_Ping_Test();

                    if (intReturnCode == 0)
                    {
                        this.txtUserId.Enabled   = true;
                        this.txtPassword.Enabled = true;

                        this.btnOK.Enabled = true;
                    }
                    else
                    {
                        this.txtUserId.Enabled   = false;
                        this.txtPassword.Enabled = false;

                        this.btnOK.Enabled = false;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public frmMessage()
        {
            InitializeComponent();

            clsISClientUtilities = new clsISClientUtilities();

            this.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Form_Paint);
        }
Exemplo n.º 3
0
        private void frmClientConvertCostCentre_Load(object sender, EventArgs e)
        {
            try
            {
                miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

                clsISClientUtilities = new clsISClientUtilities(this, "busClientConvertCostCentre");

                this.lblCompanySpreadsheetHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblPayrollTypeHeader.Paint        += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblPayCategoryDesc.Paint          += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblPayCategorySelectDesc.Paint    += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                this.dgvConvertToPayrollTypeDataGridView.Rows.Add("Wages");
                this.dgvConvertToPayrollTypeDataGridView.Rows.Add("TimeSheets");
                this.dgvConvertToPayrollTypeDataGridView.Rows.Add("Salaries");

                pvtblnConvertToPayrollTypeDataGridViewLoaded = true;

                this.Set_DataGridView_SelectedRowIndex(this.dgvConvertToPayrollTypeDataGridView, 0);

                try
                {
                    clsISUtilities = new InteractPayroll.clsISUtilities(this, "busConvertCostCentre");
                }
                catch (Exception ex)
                {
                    CustomClientMessageBox.Show("Connection to Internet Database Could Not be Established", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                object[] objParm = new object[0];

                pvtbytCompress = (byte[])clsISClientUtilities.DynamicFunction("Get_Form_Records", objParm, false);

                pvtDataSet = clsISClientUtilities.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(),
                                                         this.pvtDataSet.Tables["Company"].Rows[intRow]["COMPANY_NO"].ToString());
                }

                pvtblnCompanyDataGridViewLoaded = true;

                if (this.dgvCompanyDataGridView.Rows.Count > 0)
                {
                    this.Set_DataGridView_SelectedRowIndex(this.dgvCompanyDataGridView, 0);
                }
            }
            catch (Exception eException)
            {
                clsISClientUtilities.ErrorHandler(eException);
            }
        }
Exemplo n.º 4
0
        public frmReadWriteFile()
        {
            InitializeComponent();

            clsISClientUtilities = new clsISClientUtilities();

            this.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Form_Paint);

            //Cause Paint
            this.Refresh();
        }
        public frmRestartService(string stMachineName, string stMachineIP)
        {
            InitializeComponent();

            clsISClientUtilities clsISClientUtilities = new clsISClientUtilities();

            this.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Form_Paint);

            //Causes Repaint
            this.Refresh();

            this.txtMachineName.Text = stMachineName;
            this.txtMachineIP.Text   = stMachineIP;
        }
        private void frmBackupDatabase_Load(object sender, EventArgs e)
        {
            try
            {
                miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

                clsISClientUtilities = new clsISClientUtilities(this, "busBackupRestoreClientDatabase");

                this.lblDescription.Text = "Backup Database 'InteractPayrollClient'?";
                this.btnOK.Enabled       = true;
            }
            catch (Exception eException)
            {
                clsISClientUtilities.ErrorHandler(eException);
            }
        }
        private void frmRestoreDatabase_Load(object sender, EventArgs e)
        {
            try
            {
                miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

                clsISClientUtilities = new clsISClientUtilities(this, "busBackupRestoreClientDatabase");

                this.lblFilesHeader.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                Load_Restore_Files();
            }
            catch (Exception eException)
            {
                clsISClientUtilities.ErrorHandler(eException);
            }
        }
Exemplo n.º 8
0
        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 frmFingerPrintReader_Load(object sender, EventArgs e)
        {
            clsISClientUtilities = new clsISClientUtilities(this, "busRemotBackupSiteName");

            miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

            object[] objParm = new object[0];

            byte[]  bytCompress = (byte[])clsISClientUtilities.DynamicFunction("Get_Form_Records", objParm, false);
            DataSet DataSet     = clsISClientUtilities.DeCompress_Array_To_DataSet(bytCompress);

            if (DataSet.Tables["RemoteBackupSiteName"].Rows.Count > 0)
            {
                this.txtRemoteBackupSiteName.Text = DataSet.Tables["RemoteBackupSiteName"].Rows[0]["SITE_NAME"].ToString();
            }

            pvtstrFilePath = AppDomain.CurrentDomain.BaseDirectory + "FingerPrintReaderConfig.txt";

            Read_Reader_From_File();
        }
Exemplo n.º 10
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            try
            {
                clsISClientUtilities = null;
                clsISClientUtilities = new clsISClientUtilities(this, "busTimeAttendanceLogon");

                int intReturnCode = clsISClientUtilities.WebService_Ping_Test();

                if (intReturnCode == 0)
                {
                    System.Windows.Forms.MessageBox.Show("Communication Successful.", "Communication", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    //Form with Unsuccessful would show
                }
            }
            catch (Exception eException)
            {
            }
        }
Exemplo n.º 11
0
        private void frmConnectionSetup_Load(object sender, EventArgs e)
        {
            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 Repaint
            this.Refresh();

            if (AppDomain.CurrentDomain.GetData("URLClientPath").ToString() != "")
            {
                strParts = AppDomain.CurrentDomain.GetData("URLClientPath").ToString().Split(':');

                if (strParts.Length == 2)
                {
                    strIP = strParts[0].Split('.');

                    if (strIP.Length == 4)
                    {
                        Load_IP_And_Port_And_Disable();

                        this.btnTest.Enabled = true;
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("Error in 'URLClientConfig.txt'.\n\nSpeak to System Administrator", "File Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("Error in 'URLClientConfig.txt'.\n\nSpeak to System Administrator", "File Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 12
0
        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;
            }
        }
Exemplo n.º 13
0
        private void frmClockToEmployeeLink_Load(object sender, EventArgs e)
        {
            try
            {
                clsISClientUtilities = new clsISClientUtilities(this, "busClockToEmployeeLink");

                this.lblCompany.Paint        += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblClockingDevice.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblEmployee.Paint       += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

                NoTemplateDataGridViewCellStyle                    = new DataGridViewCellStyle();
                NoTemplateDataGridViewCellStyle.BackColor          = Color.Yellow;
                NoTemplateDataGridViewCellStyle.SelectionBackColor = Color.Yellow;

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

                NormalDataGridViewCellStyle                    = new DataGridViewCellStyle();
                NormalDataGridViewCellStyle.BackColor          = SystemColors.Control;
                NormalDataGridViewCellStyle.SelectionBackColor = SystemColors.Control;

                LocalTemplateDataGridViewCellStyle                    = new DataGridViewCellStyle();
                LocalTemplateDataGridViewCellStyle.BackColor          = Color.SeaGreen;
                LocalTemplateDataGridViewCellStyle.SelectionBackColor = Color.SeaGreen;

                ServerTemplateDataGridViewCellStyle                    = new DataGridViewCellStyle();
                ServerTemplateDataGridViewCellStyle.BackColor          = Color.Aquamarine;
                ServerTemplateDataGridViewCellStyle.SelectionBackColor = Color.Aquamarine;

                object[] objParm = new object[2];
                objParm[0] = Convert.ToInt32(AppDomain.CurrentDomain.GetData("UserNo"));
                objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString();

                byte[] bytCompress = (byte[])clsISClientUtilities.DynamicFunction("Get_Form_Records", objParm, false);
                pvtDataSet = clsISClientUtilities.DeCompress_Array_To_DataSet(bytCompress);
#if (DEBUG)
                int intWidth     = 0;
                int intHeight    = 0;
                int intNewHeight = 0;

                DataGridView myDataGridView;

                foreach (Control myControl in this.Controls)
                {
                    if (myControl is DataGridView)
                    {
                        myDataGridView = null;
                        myDataGridView = (DataGridView)myControl;

                        intWidth = myDataGridView.RowHeadersWidth;

                        if (myDataGridView.ScrollBars == ScrollBars.Vertical
                            | myDataGridView.ScrollBars == ScrollBars.Both)
                        {
                            intWidth += 19;
                        }

                        for (int intCol = 0; intCol < myDataGridView.ColumnCount; intCol++)
                        {
                            if (myDataGridView.Columns[intCol].Visible == true)
                            {
                                intWidth += myDataGridView.Columns[intCol].Width;
                            }
                        }

                        if (intWidth != myDataGridView.Width)
                        {
                            System.Windows.Forms.MessageBox.Show(myDataGridView.Name + " Width should be " + intWidth.ToString());
                        }

                        intHeight    = myDataGridView.ColumnHeadersHeight + 2;
                        intNewHeight = myDataGridView.RowTemplate.Height / 2;

                        for (int intRow = 0; intRow < 200; intRow++)
                        {
                            intHeight += myDataGridView.RowTemplate.Height;

                            if (intHeight == myDataGridView.Height)
                            {
                                break;
                            }
                            else
                            {
                                if (intHeight > myDataGridView.Height)
                                {
                                    System.Windows.Forms.MessageBox.Show(myDataGridView.Name + " Height should be " + intHeight.ToString());
                                    break;
                                }
                                else
                                {
                                    if (intHeight + intNewHeight > myDataGridView.Height)
                                    {
                                        System.Windows.Forms.MessageBox.Show(myDataGridView.Name + " Height should be " + intHeight.ToString());
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        if (myControl is GroupBox)
                        {
                            foreach (Control myControl1 in myControl.Controls)
                            {
                                if (myControl1 is DataGridView)
                                {
                                    myDataGridView = null;
                                    myDataGridView = (DataGridView)myControl1;

                                    intWidth = myDataGridView.RowHeadersWidth;

                                    if (myDataGridView.ScrollBars == ScrollBars.Vertical
                                        | myDataGridView.ScrollBars == ScrollBars.Both)
                                    {
                                        intWidth += 19;
                                    }

                                    for (int intCol = 0; intCol < myDataGridView.ColumnCount; intCol++)
                                    {
                                        if (myDataGridView.Columns[intCol].Visible == true)
                                        {
                                            intWidth += myDataGridView.Columns[intCol].Width;
                                        }
                                    }

                                    if (intWidth != myDataGridView.Width)
                                    {
                                        System.Windows.Forms.MessageBox.Show(myDataGridView.Name + " Width should be " + intWidth.ToString());
                                    }

                                    intHeight    = myDataGridView.ColumnHeadersHeight + 2;
                                    intNewHeight = myDataGridView.RowTemplate.Height / 2;

                                    for (int intRow = 0; intRow < 200; intRow++)
                                    {
                                        intHeight += myDataGridView.RowTemplate.Height;

                                        if (intHeight == myDataGridView.Height)
                                        {
                                            break;
                                        }
                                        else
                                        {
                                            if (intHeight > myDataGridView.Height)
                                            {
                                                System.Windows.Forms.MessageBox.Show(myDataGridView.Name + " Height should be " + intHeight.ToString());
                                                break;
                                            }
                                            else
                                            {
                                                if (intHeight + intNewHeight > myDataGridView.Height)
                                                {
                                                    System.Windows.Forms.MessageBox.Show(myDataGridView.Name + " Height should be " + intHeight.ToString());
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
#endif
                Load_CurrentForm_Records();
            }
            catch (Exception eException)
            {
                clsISClientUtilities.ErrorHandler(eException);
            }
        }
        private void frmTimeAttendanceDataUpload_Load(object sender, System.EventArgs e)
        {
            try
            {
                //Move Group Boxes Over each Other
                miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

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

                object[] objParm = new object[2];
                objParm[0] = Convert.ToInt32(AppDomain.CurrentDomain.GetData("UserNo"));
                objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString();

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

                pvtDataSetClient = clsISUtilities.DeCompress_Array_To_DataSet(pvtbytCompress);

                this.lblCompany.Paint += new System.Windows.Forms.PaintEventHandler(clsISUtilities.Label_Paint);
                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("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++)
                {
                    DataView PayCategoryClientDataView = new DataView(pvtDataSetClient.Tables["PayCategory"],
                                                                      "COMPANY_NO = " + this.pvtDataSet.Tables["Company"].Rows[intRow]["COMPANY_NO"].ToString(),
                                                                      "",
                                                                      DataViewRowState.CurrentRows);

                    if (PayCategoryClientDataView.Count > 0)
                    {
                        this.dgvCompanyDataGridView.Rows.Add(this.pvtDataSet.Tables["Company"].Rows[intRow]["COMPANY_DESC"].ToString(),
                                                             this.pvtDataSet.Tables["Company"].Rows[intRow]["COMPANY_NO"].ToString());
                    }
                }

                pvtblnCompanyDataGridViewLoaded = true;

                if (this.dgvCompanyDataGridView.Rows.Count > 0)
                {
                    this.Set_DataGridView_SelectedRowIndex(dgvCompanyDataGridView, 0);
                }
            }
            catch (Exception eException)
            {
                clsISUtilities.ErrorHandler(eException);
            }
        }
Exemplo n.º 15
0
        private void frmClock_Load(object sender, EventArgs e)
        {
            try
            {
                miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

                cboFAR.Items.Add("1/10000");
                cboFAR.Items.Add("1/25000");
                cboFAR.Items.Add("1/50000");
                cboFAR.Items.Add("1/75000");
                cboFAR.Items.Add("1/100000");

                intPossibleFARValuesArray = new int[5];

                intPossibleFARValuesArray[0] = 214748;
                intPossibleFARValuesArray[1] = 85899;
                intPossibleFARValuesArray[2] = 42949;
                intPossibleFARValuesArray[3] = 28633;
                intPossibleFARValuesArray[4] = 21475;

                string strTag = "Start";

                clsISClientUtilities = new clsISClientUtilities(this, "busClock");

                this.lblClock.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                object[] objParm = new object[2];
                objParm[0] = Convert.ToInt32(AppDomain.CurrentDomain.GetData("UserNo"));
                objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString();

                byte[] bytCompress = (byte[])clsISClientUtilities.DynamicFunction("Get_Form_Records", objParm, false);
                pvtDataSet = clsISClientUtilities.DeCompress_Array_To_DataSet(bytCompress);

                for (int intRowCount = 0; intRowCount < pvtDataSet.Tables["Company"].Rows.Count; intRowCount++)
                {
                    this.cboCompany.Items.Add(pvtDataSet.Tables["Company"].Rows[intRowCount]["COMPANY_DESC"].ToString());
                }

                strTag = "After DataSet";

#if (DEBUG)
                int intWidth = this.dgvClockDataGridView.RowHeadersWidth;

                if (this.dgvClockDataGridView.ScrollBars == ScrollBars.Vertical
                    | this.dgvClockDataGridView.ScrollBars == ScrollBars.Both)
                {
                    intWidth += 19;
                }

                for (int intCol = 0; intCol < this.dgvClockDataGridView.ColumnCount; intCol++)
                {
                    if (this.dgvClockDataGridView.Columns[intCol].Visible == true)
                    {
                        intWidth += this.dgvClockDataGridView.Columns[intCol].Width;
                    }
                }

                if (intWidth != this.dgvClockDataGridView.Width)
                {
                    System.Windows.Forms.MessageBox.Show("Width should be " + intWidth.ToString());
                }

                int intHeight    = this.dgvClockDataGridView.ColumnHeadersHeight + 2;
                int intNewHeight = this.dgvClockDataGridView.RowTemplate.Height / 2;

                for (int intRow = 0; intRow < 200; intRow++)
                {
                    intHeight += this.dgvClockDataGridView.RowTemplate.Height;

                    if (intHeight == this.dgvClockDataGridView.Height)
                    {
                        break;
                    }
                    else
                    {
                        if (intHeight > this.dgvClockDataGridView.Height)
                        {
                            System.Windows.Forms.MessageBox.Show("Height should be " + intHeight.ToString());
                            break;
                        }
                        else
                        {
                            if (intHeight + intNewHeight > this.dgvClockDataGridView.Height)
                            {
                                System.Windows.Forms.MessageBox.Show("Height should be " + intHeight.ToString());
                                break;
                            }
                        }
                    }
                }
#endif
                Load_CurrentForm_Records();
            }
            catch (Exception eException)
            {
                clsISClientUtilities.ErrorHandler(eException);
            }
        }
        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 frmEmployeeLinkDevice_Load(object sender, System.EventArgs e)
        {
            try
            {
                clsISClientUtilities = new clsISClientUtilities(this, "busEmployeeLinkDevice");

                this.lblCompany.Paint        += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblClockingDevice.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                this.lblEmployee.Paint       += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblLinkedEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                this.lblCostCentre.Paint       += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblLinkedCostCentre.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                this.lblDepartment.Paint       += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblLinkedDepartment.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                this.lblGroup.Paint       += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblLinkedGroup.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

#if (DEBUG)
                int intWidth = this.dgvDeviceDataGridView.RowHeadersWidth;

                if (this.dgvDeviceDataGridView.ScrollBars == ScrollBars.Vertical
                    | this.dgvDeviceDataGridView.ScrollBars == ScrollBars.Both)
                {
                    intWidth += 19;
                }

                for (int intCol = 0; intCol < this.dgvDeviceDataGridView.ColumnCount; intCol++)
                {
                    if (this.dgvDeviceDataGridView.Columns[intCol].Visible == true)
                    {
                        intWidth += this.dgvDeviceDataGridView.Columns[intCol].Width;
                    }
                }

                if (intWidth != this.dgvDeviceDataGridView.Width)
                {
                    System.Windows.Forms.MessageBox.Show("Width should be " + intWidth.ToString());
                }

                int intHeight    = this.dgvDeviceDataGridView.ColumnHeadersHeight + 2;
                int intNewHeight = this.dgvDeviceDataGridView.RowTemplate.Height / 2;

                for (int intRow = 0; intRow < 200; intRow++)
                {
                    intHeight += this.dgvDeviceDataGridView.RowTemplate.Height;

                    if (intHeight == this.dgvDeviceDataGridView.Height)
                    {
                        break;
                    }
                    else
                    {
                        if (intHeight > this.dgvDeviceDataGridView.Height)
                        {
                            System.Windows.Forms.MessageBox.Show("Height should be " + intHeight.ToString());
                            break;
                        }
                        else
                        {
                            if (intHeight + intNewHeight > this.dgvDeviceDataGridView.Height)
                            {
                                System.Windows.Forms.MessageBox.Show("Height should be " + intHeight.ToString());
                                break;
                            }
                        }
                    }
                }

                intWidth = this.dgvDepartmentDataGridView.RowHeadersWidth;

                if (this.dgvDepartmentDataGridView.ScrollBars == ScrollBars.Vertical
                    | this.dgvDepartmentDataGridView.ScrollBars == ScrollBars.Both)
                {
                    intWidth += 19;
                }

                for (int intCol = 0; intCol < this.dgvDepartmentDataGridView.ColumnCount; intCol++)
                {
                    if (this.dgvDepartmentDataGridView.Columns[intCol].Visible == true)
                    {
                        intWidth += this.dgvDepartmentDataGridView.Columns[intCol].Width;
                    }
                }

                if (intWidth != this.dgvDepartmentDataGridView.Width)
                {
                    System.Windows.Forms.MessageBox.Show("Employee Width should be " + intWidth.ToString());
                }

                intHeight    = this.dgvDepartmentDataGridView.ColumnHeadersHeight + 2;
                intNewHeight = this.dgvDepartmentDataGridView.RowTemplate.Height / 2;

                for (int intRow = 0; intRow < 200; intRow++)
                {
                    intHeight += this.dgvDepartmentDataGridView.RowTemplate.Height;

                    if (intHeight == this.dgvDepartmentDataGridView.Height)
                    {
                        break;
                    }
                    else
                    {
                        if (intHeight > this.dgvDepartmentDataGridView.Height)
                        {
                            System.Windows.Forms.MessageBox.Show("Employee Height should be " + intHeight.ToString());
                            break;
                        }
                        else
                        {
                            if (intHeight + intNewHeight > this.dgvDepartmentDataGridView.Height)
                            {
                                System.Windows.Forms.MessageBox.Show("Employee Height should be " + intHeight.ToString());
                                break;
                            }
                        }
                    }
                }
#endif
                object[] objParm = new object[2];
                objParm[0] = Convert.ToInt32(AppDomain.CurrentDomain.GetData("UserNo"));
                objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString();

                byte[] bytCompress = (byte[])clsISClientUtilities.DynamicFunction("Get_Form_Records", objParm, false);
                pvtDataSet = clsISClientUtilities.DeCompress_Array_To_DataSet(bytCompress);

                string strDeviceType = "";

                for (int intRowCount = 0; intRowCount < pvtDataSet.Tables["Device"].Rows.Count; intRowCount++)
                {
                    if (pvtDataSet.Tables["Device"].Rows[intRowCount]["DEVICE_USAGE"].ToString() == "T")
                    {
                        strDeviceType = "Time & Attendance";
                    }
                    else
                    {
                        if (pvtDataSet.Tables["Device"].Rows[intRowCount]["DEVICE_USAGE"].ToString() == "A")
                        {
                            strDeviceType = "Access";
                        }
                        else
                        {
                            strDeviceType = "Access / Time & Attendance";
                        }
                    }

                    this.dgvDeviceDataGridView.Rows.Add(pvtDataSet.Tables["Device"].Rows[intRowCount]["DEVICE_DESC"].ToString(), strDeviceType, pvtDataSet.Tables["Device"].Rows[intRowCount]["DEVICE_NO"].ToString(), intRowCount.ToString());
                }

                pvtblnDeviceDataGridViewLoaded = true;

                if (pvtDataSet.Tables["Device"].Rows.Count > 0)
                {
                    this.Set_DataGridView_SelectedRowIndex(dgvDeviceDataGridView, this.Get_DataGridView_SelectedRowIndex(dgvDeviceDataGridView));

                    Load_CurrentForm_Records();
                }
                else
                {
                    this.btnUpdate.Enabled = false;
                }
            }
            catch (Exception eException)
            {
                clsISClientUtilities.ErrorHandler(eException);
            }
        }
Exemplo n.º 18
0
        private void frmEmployeeGroup_Load(object sender, System.EventArgs e)
        {
            try
            {
                clsISClientUtilities = new clsISClientUtilities(this, "busEmployeeGroup");

                this.lblCompany.Paint          += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblGroup.Paint            += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblEmployee.Paint         += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);
                this.lblSelectedEmployee.Paint += new System.Windows.Forms.PaintEventHandler(clsISClientUtilities.Label_Paint);

                miLinkedMenuItem = (ToolStripMenuItem)AppDomain.CurrentDomain.GetData("LinkedMenuItem");

#if (DEBUG)
                int intWidth = this.dgvGroupDataGridView.RowHeadersWidth;

                if (this.dgvGroupDataGridView.ScrollBars == ScrollBars.Vertical
                    | this.dgvGroupDataGridView.ScrollBars == ScrollBars.Both)
                {
                    intWidth += 19;
                }

                for (int intCol = 0; intCol < this.dgvGroupDataGridView.ColumnCount; intCol++)
                {
                    if (this.dgvGroupDataGridView.Columns[intCol].Visible == true)
                    {
                        intWidth += this.dgvGroupDataGridView.Columns[intCol].Width;
                    }
                }

                if (intWidth != this.dgvGroupDataGridView.Width)
                {
                    System.Windows.Forms.MessageBox.Show("Width should be " + intWidth.ToString());
                }

                int intHeight    = this.dgvGroupDataGridView.ColumnHeadersHeight + 2;
                int intNewHeight = this.dgvGroupDataGridView.RowTemplate.Height / 2;

                for (int intRow = 0; intRow < 200; intRow++)
                {
                    intHeight += this.dgvGroupDataGridView.RowTemplate.Height;

                    if (intHeight == this.dgvGroupDataGridView.Height)
                    {
                        break;
                    }
                    else
                    {
                        if (intHeight > this.dgvGroupDataGridView.Height)
                        {
                            System.Windows.Forms.MessageBox.Show("Height should be " + intHeight.ToString());
                            break;
                        }
                        else
                        {
                            if (intHeight + intNewHeight > this.dgvGroupDataGridView.Height)
                            {
                                System.Windows.Forms.MessageBox.Show("Height should be " + intHeight.ToString());
                                break;
                            }
                        }
                    }
                }

                intWidth = this.dgvEmployeeDataGridView.RowHeadersWidth;

                if (this.dgvEmployeeDataGridView.ScrollBars == ScrollBars.Vertical
                    | this.dgvEmployeeDataGridView.ScrollBars == ScrollBars.Both)
                {
                    intWidth += 19;
                }

                for (int intCol = 0; intCol < this.dgvEmployeeDataGridView.ColumnCount; intCol++)
                {
                    if (this.dgvEmployeeDataGridView.Columns[intCol].Visible == true)
                    {
                        intWidth += this.dgvEmployeeDataGridView.Columns[intCol].Width;
                    }
                }

                if (intWidth != this.dgvEmployeeDataGridView.Width)
                {
                    System.Windows.Forms.MessageBox.Show("Employee Width should be " + intWidth.ToString());
                }

                intHeight    = this.dgvEmployeeDataGridView.ColumnHeadersHeight + 2;
                intNewHeight = this.dgvEmployeeDataGridView.RowTemplate.Height / 2;

                for (int intRow = 0; intRow < 200; intRow++)
                {
                    intHeight += this.dgvEmployeeDataGridView.RowTemplate.Height;

                    if (intHeight == this.dgvEmployeeDataGridView.Height)
                    {
                        break;
                    }
                    else
                    {
                        if (intHeight > this.dgvEmployeeDataGridView.Height)
                        {
                            System.Windows.Forms.MessageBox.Show("Employee Height should be " + intHeight.ToString());
                            break;
                        }
                        else
                        {
                            if (intHeight + intNewHeight > this.dgvEmployeeDataGridView.Height)
                            {
                                System.Windows.Forms.MessageBox.Show("Employee Height should be " + intHeight.ToString());
                                break;
                            }
                        }
                    }
                }
#endif
                object[] objParm = new object[2];
                objParm[0] = Convert.ToInt32(AppDomain.CurrentDomain.GetData("UserNo"));
                objParm[1] = AppDomain.CurrentDomain.GetData("AccessInd").ToString();

                byte[] bytCompress = (byte[])clsISClientUtilities.DynamicFunction("Get_Form_Records", objParm, false);
                pvtDataSet = clsISClientUtilities.DeCompress_Array_To_DataSet(bytCompress);

                Load_CurrentForm_Records();
            }
            catch (Exception eException)
            {
                clsISClientUtilities.ErrorHandler(eException);
            }
        }