예제 #1
0
 public void ProcessPayrollRunFromQueue(RunQueue runQueue)
 {
     if (runQueue.PayCategoryType == "T")
     {
         busTimeAttendanceRun.Calculate_TimeAttendance_From_TimeSheets(runQueue.UserNo, runQueue.CompanyNo, runQueue.PayCategoryNumberArray, runQueue.PayCategoryType, runQueue.PayPeriodDate);
     }
     else
     {
         busTimeAttendanceRun.Calculate_Payroll_From_TimeSheets(runQueue.UserNo, runQueue.CompanyNo, runQueue.PayCategoryNumberArray, runQueue.PayCategoryType, runQueue.PayPeriodDate);
     }
 }
예제 #2
0
        private void ProcessRunQueue()
        {
            DataSet DataSetProcessRunQueue = 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.PAYROLL_RUN_QUEUE");

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

                intWhere = 1;

                clsDBConnectionObjectsProcessRunQueue.Create_DataTable(strQry.ToString(), DataSetProcessRunQueue, "JobQueue", -1);

                intWhere = 2;

                if (DataSetProcessRunQueue.Tables["JobQueue"].Rows.Count > 0)
                {
                    intWhere = 3;

                    List <RunQueue> runQueueList = new List <RunQueue>();

                    intWhere = 4;

                    for (int intRow = 0; intRow < DataSetProcessRunQueue.Tables["JobQueue"].Rows.Count; intRow++)
                    {
                        intWhere = 5;

                        RunQueue runQueue = new RunQueue();

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

                        intWhere = 6;

                        runQueueList.Add(runQueue);
                    }

                    intWhere = 7;

                    ProcessRunQueueParallel(runQueueList);
                }
            }
            catch (Exception ex)
            {
                WriteExceptionErrorLog("ProcessRunQueue " + intWhere.ToString(), ex);
            }
            finally
            {
                DataSetProcessRunQueue.Dispose();
            }
        }