Example #1
0
        }     //--------------------------

        #endregion

        #region Programmer-Defined Function Procedures

        //this function gets the selected employee
        public DataTable GetSelectedEmployeeInformation(ClientExchange.EmployeeSearchFilter searchFilter)
        {
            DataTable employeeTable = RemoteClient.ProcStatic.GetEmployeeInformationFilterStatusAndType(searchFilter,
                                                                                                        _classDataSet.Tables["EmployeeInformationTable"]);

            DataTable newTable = new DataTable("EmployeeSearchByEmployeeNameIdCardNumberTable");

            newTable.Columns.Add("employee_id", System.Type.GetType("System.String"));
            newTable.Columns.Add("card_number", System.Type.GetType("System.String"));
            newTable.Columns.Add("employee_name", System.Type.GetType("System.String"));

            searchFilter.StringSearch = searchFilter.StringSearch.Replace("*", "").Replace("%", "").Replace("'", "''");

            String strFilter = "(employee_id LIKE '%" + searchFilter.StringSearch + "%' OR " +
                               "employee_name LIKE '%" + searchFilter.StringSearch + "%' OR " +
                               "card_number LIKE '%" + searchFilter.StringSearch + "%')";

            DataRow[] selectRow = employeeTable.Select(strFilter.Trim("*".ToCharArray()), "employee_name ASC");

            foreach (DataRow empRow in selectRow)
            {
                DataRow newRow = newTable.NewRow();

                newRow["employee_id"]   = empRow["employee_id"].ToString();
                newRow["card_number"]   = empRow["card_number"].ToString();
                newRow["employee_name"] = empRow["employee_name"].ToString();

                newTable.Rows.Add(newRow);
            }

            newTable.AcceptChanges();

            return(newTable);
        } //-------------------------------
Example #2
0
        } //-------------------------------------

        //#########################################END CLASS LoanRemittanceEmployeeSearchList EVENTS##########################################


        #endregion

        #region Programmer-Defined Void Procedures

        //this procedure shows the search result
        private void ShowSearchResultDialog()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                String queryString = RemoteClient.ProcStatic.TrimStartEndString(ctlManager.GetSearchString);

                if (!String.IsNullOrEmpty(queryString))
                {
                    if (_forLoanType)
                    {
                        _frmLoanTypeSearch.DataSource = _loanManager.GetSearchedLoanTypeInformation(queryString);
                    }
                    else
                    {
                        ClientExchange.EmployeeSearchFilter searchFilter = new ClientExchange.EmployeeSearchFilter();

                        searchFilter.StringSearch = queryString;

                        _frmEmpSearch.DataSource = _loanManager.GetSelectedEmployeeInformation(searchFilter);
                    }
                }
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Retrieving Data");
            }
            finally
            {
                this.ctlManager.SetFocusOnSearchTextBox();

                this.Cursor = Cursors.Arrow;
            }
        } //--------------------------
        //###########################################CLASS EmployeeManager EVENTS#############################################
        //event is raised when the class is loaded
        private void ClassLoad(object sender, EventArgs e)
        {
            try
            {
                _empManager   = new EmployeeLogic(_userInfo);
                _searchFilter = new ClientExchange.EmployeeSearchFilter();

                _frmSearch = new EmployeeSearchList();
                _frmSearch.OnDoubleClickEnter += new SearchListDataGridDoubleClickEnter(_frmSearchOnDoubleClickEnter);
                _frmSearch.LocationPoint       = new Point(50, 300);
                _frmSearch.AdoptGridSize       = true;
                _frmSearch.MdiParent           = this;

                lblRecordDate.Text = "Record Date: " + DateTime.Parse(_empManager.ServerDateTime).ToString();

                if (!(RemoteServerLib.ProcStatic.IsSystemAccessAdmin(_userInfo) ||
                      RemoteServerLib.ProcStatic.IsSystemAccessVpOfFinance(_userInfo) ||
                      RemoteServerLib.ProcStatic.IsSystemAccessPayrollMaster(_userInfo)))
                {
                    throw new Exception("You are not authorized to access this module.");
                }
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog("\n" + ex.Message, "Error Authenticating");

                this.Close();
            }
        }//------------------------------
Example #4
0
        } //-----------------------------

        //this procedure gets the selected employee information for deduction
        public DataTable GetSelectedEmployeeForDeduction(ClientExchange.EmployeeSearchFilter searchFilter)
        {
            if (!searchFilter.IncludePartTime && !searchFilter.IncludeProbationary && !searchFilter.IncludeRegular)
            {
                searchFilter.IncludePartTime     = true;
                searchFilter.IncludeProbationary = true;
                searchFilter.IncludeRegular      = true;
            }

            DataTable employeeTable = RemoteClient.ProcStatic.GetEmployeeInformationFilterStatusAndType(searchFilter,
                                                                                                        _classDataSet.Tables["EmployeeInformationTable"]);

            using (DataTable newTable = new DataTable("EmployeeSearchByEmployeeNameIdCardNumberTable"))
            {
                newTable.Columns.Add("sysid_employee", System.Type.GetType("System.String"));
                newTable.Columns.Add("employee_id", System.Type.GetType("System.String"));
                newTable.Columns.Add("employee_name", System.Type.GetType("System.String"));

                searchFilter.StringSearch = searchFilter.StringSearch.Replace("*", "").Replace("%", "").Replace("'", "''");

                String strFilter = "(employee_id LIKE '%" + searchFilter.StringSearch + "%' OR " +
                                   "employee_name LIKE '%" + searchFilter.StringSearch + "%')";

                DataRow[] selectRow = employeeTable.Select(strFilter.Trim("*".ToCharArray()), "employee_name ASC");

                foreach (DataRow empRow in selectRow)
                {
                    DataRow newRow = newTable.NewRow();

                    newRow["sysid_employee"] = empRow["sysid_employee"].ToString();
                    newRow["employee_id"]    = empRow["employee_id"].ToString();
                    newRow["employee_name"]  = empRow["employee_name"].ToString();

                    newTable.Rows.Add(newRow);
                }

                newTable.AcceptChanges();

                _empTableBySearch = newTable;
            }

            return(_empTableBySearch);
        } //---------------------------
Example #5
0
        } //--------------------------------------------

        //###############################################END BUTTON btnApply EVENTS#######################################################


        #endregion

        #region Programmer-Defined Void Procedures

        //this procedure shows the search result
        private void ShowSearchResultDialog()
        {
            ClientExchange.EmployeeSearchFilter searchFilter = new ClientExchange.EmployeeSearchFilter();

            searchFilter.StringSearch                            = String.IsNullOrEmpty(ctlManager.GetSearchString) ? "" : ctlManager.GetSearchString;
            searchFilter.IncludePartTime                         = ctlManager.IncludePartTime;
            searchFilter.IncludeProbationary                     = ctlManager.IncludeProbationary;
            searchFilter.IncludeRegular                          = ctlManager.IncludeRegular;
            searchFilter.IncludeLayOff                           = false;
            searchFilter.IncludeGraduateSchoolFaculty            = ctlManager.IncludeGraduateSchoolFaculty;
            searchFilter.IncludeGraduateSchoolCollegeFaculty     = ctlManager.IncludeGraduateSchoolCollegeFaculty;
            searchFilter.IncludeGraduateSchoolHighSchoolFaculty  = ctlManager.IncludeGraduateSchoolHighSchoolFaculty;
            searchFilter.IncludeGraduateSchoolGradeKinderFaculty = ctlManager.IncludeGraduateSchoolGradeSchoolKinderFaculty;
            searchFilter.IncludeCollegeFaculty                   = ctlManager.IncludeCollegeFaculty;
            searchFilter.IncludeHighSchoolFaculty                = ctlManager.IncludeHighSchoolFaculty;
            searchFilter.IncludeGradeKinderFaculty               = ctlManager.IncludeGradeKinderFaculty;
            searchFilter.IncludeStaff                            = ctlManager.IncludeStaff;
            searchFilter.IncludeAcademic                         = ctlManager.IncludeAcademic;
            searchFilter.IncludeMaintenance                      = ctlManager.IncludeMaintenance;

            this.SetEmployeeCheckedListBox(_decManager.GetSelectedEmployeeForDeduction(searchFilter), "employee_name");

            this.ctlManager.SetFocusOnSearchTextBox();
        } //--------------------------