Beispiel #1
0
 public void ProcessOpenRunFromQueue(OpenRunQueue openRunQueue)
 {
     if (openRunQueue.PayCategoryType == "W")
     {
         busOpenPayrollRun.Insert_Wage_Run_Records(openRunQueue.CompanyNo, openRunQueue.PayPeriodDate, openRunQueue.PayCategoryNumberArray);
     }
     else
     {
         if (openRunQueue.PayCategoryType == "S")
         {
             busOpenPayrollRun.Insert_Salary_Run_Records(openRunQueue.CompanyNo, openRunQueue.PayPeriodDate, openRunQueue.PayCategoryNumberArray);
         }
         else
         {
             busOpenPayrollRun.Insert_TimeAttendance_Run_Records(openRunQueue.CompanyNo, openRunQueue.PayPeriodDate, openRunQueue.PayCategoryNumberArray);
         }
     }
 }
        private void ProcessOpenRunQueue()
        {
            DataSet DataSetProcessOpenRunQueue = new DataSet();

            int intWhere = 0;

            try
            {
                StringBuilder strQry = new StringBuilder();

                strQry.Clear();

                strQry.AppendLine(" SELECT TOP 2 ");
                strQry.AppendLine(" USER_NO");
                strQry.AppendLine(",COMPANY_NO");
                strQry.AppendLine(",PAY_CATEGORY_TYPE");
                strQry.AppendLine(",PAY_PERIOD_DATE");
                strQry.AppendLine(",PAY_CATEGORY_NUMBERS");

                strQry.AppendLine(" FROM InteractPayroll.dbo.OPEN_RUN_QUEUE");

                strQry.AppendLine(" WHERE OPEN_RUN_QUEUE_IND IS NULL");

                intWhere = 1;

                clsDBConnectionObjectsProcessOpenRunQueue.Create_DataTable(strQry.ToString(), DataSetProcessOpenRunQueue, "OpenRunQueue", -1);

                intWhere = 2;

                if (DataSetProcessOpenRunQueue.Tables["OpenRunQueue"].Rows.Count > 0)
                {
                    List <OpenRunQueue> openRunQueueList = new List <OpenRunQueue>();

                    intWhere = 3;

                    for (int intRow = 0; intRow < DataSetProcessOpenRunQueue.Tables["OpenRunQueue"].Rows.Count; intRow++)
                    {
                        OpenRunQueue openRunQueue = new OpenRunQueue();

                        openRunQueue.UserNo                 = Convert.ToInt64(DataSetProcessOpenRunQueue.Tables["OpenRunQueue"].Rows[intRow]["USER_NO"]);
                        openRunQueue.CompanyNo              = Convert.ToInt64(DataSetProcessOpenRunQueue.Tables["OpenRunQueue"].Rows[intRow]["COMPANY_NO"]);
                        openRunQueue.PayCategoryType        = DataSetProcessOpenRunQueue.Tables["OpenRunQueue"].Rows[intRow]["PAY_CATEGORY_TYPE"].ToString();
                        openRunQueue.PayCategoryNumberArray = DataSetProcessOpenRunQueue.Tables["OpenRunQueue"].Rows[intRow]["PAY_CATEGORY_NUMBERS"].ToString();
                        openRunQueue.PayPeriodDate          = Convert.ToDateTime(DataSetProcessOpenRunQueue.Tables["OpenRunQueue"].Rows[intRow]["PAY_PERIOD_DATE"]);

                        intWhere = 4;

                        openRunQueueList.Add(openRunQueue);
                    }

                    intWhere = 5;

                    ProcessOpenRunQueueParallel(openRunQueueList);
                }
            }
            catch (Exception ex)
            {
                WriteExceptionErrorLog("ProcessOpenRunQueue " + intWhere.ToString(), ex);
            }
            finally
            {
                DataSetProcessOpenRunQueue.Dispose();
            }
        }