Пример #1
0
 public void GetJobId(Session session)
 {
     try
     {
         CriteriaOperator   criteria_0   = new BinaryOperator("RowStatus", Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual);
         CriteriaOperator   criteria_1   = new BinaryOperator("Code", JobRegisterCode, BinaryOperatorType.Equal);
         CriteriaOperator   criteria_2   = new BinaryOperator("Code", "Accounting", BinaryOperatorType.Equal);
         CriteriaOperator   criteria     = new GroupOperator(GroupOperatorType.And, criteria_0, criteria_1);
         CriteriaOperator   criteria_cat = new GroupOperator(GroupOperatorType.And, criteria_2);
         NAS.DAL.ETL.ETLJob _ETLJob      = session.FindObject <NAS.DAL.ETL.ETLJob>(criteria);
         if (_ETLJob == null)
         {
             _ETLJob             = new NAS.DAL.ETL.ETLJob(session);
             _ETLJob.Code        = JobRegisterCode;
             _ETLJob.Description = "";
             _ETLJob.ETLCategory = session.FindObject <ETLCategory>(criteria_cat);
             _ETLJob.Is24x7      = true;
             _ETLJob.Priority    = 1;
             _ETLJob.RowStatus   = Constant.ROWSTATUS_ACTIVE;
             _ETLJob.Save();
         }
         JobId = _ETLJob.ETLJobId;
     }
     catch (Exception ex)
     {
         ETLUtils etlUtil = new ETLUtils();
         etlUtil.logs("d:/logs/Process_history.txt", DateTime.Now.ToString() + " : COGS GetJobId:" + ex.Message);
         return;
     }
 }
Пример #2
0
 public void GetJobId(Session session)
 {
     try
     {
         CriteriaOperator   criteria_0   = new BinaryOperator("RowStatus", Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual);
         CriteriaOperator   criteria_1   = new BinaryOperator("Code", JobRegisterCode, BinaryOperatorType.Equal);
         CriteriaOperator   criteria_2   = new BinaryOperator("Code", "Accounting", BinaryOperatorType.Equal);
         CriteriaOperator   criteria     = new GroupOperator(GroupOperatorType.And, criteria_0, criteria_1);
         CriteriaOperator   criteria_cat = new GroupOperator(GroupOperatorType.And, criteria_2);
         NAS.DAL.ETL.ETLJob _ETLJob      = session.FindObject <NAS.DAL.ETL.ETLJob>(criteria);
         if (_ETLJob == null)
         {
             _ETLJob             = new NAS.DAL.ETL.ETLJob(session);
             _ETLJob.Code        = JobRegisterCode;
             _ETLJob.Description = "";
             _ETLJob.ETLCategory = session.FindObject <ETLCategory>(criteria_cat);
             _ETLJob.Is24x7      = true;
             _ETLJob.Priority    = 1;
             _ETLJob.RowStatus   = Constant.ROWSTATUS_ACTIVE;
             _ETLJob.Save();
         }
         JobId = _ETLJob.ETLJobId;
     }
     catch (Exception)
     {
         return;
     }
 }