Пример #1
0
        public void CreatETLEntryObjectHistory(Session session, Guid jobId, Int64 businessObjectId, int ErrorCode)
        {
            try
            {
                ETLJob job = session.GetObjectByKey <ETLJob>(jobId);
                if (job == null)
                {
                    return;
                }

                BusinessObject businessObject = session.GetObjectByKey <BusinessObject>(businessObjectId);
                if (businessObject == null)
                {
                    return;
                }

                ObjectEntryLogBO objectEntryLogBO     = new ObjectEntryLogBO();
                ETLLogBO         etlLogBO             = new ETLLogBO();
                ObjectEntryLog   newestObjectEntryLog = objectEntryLogBO.GetNewestObjectEntryLog(session, businessObjectId);
                if (newestObjectEntryLog == null)
                {
                    return;
                }

                ETLBusinessObject etlBusinessObject = etlLogBO.GetETLBusinessObject(session, jobId, businessObjectId);
                if (etlBusinessObject == null)
                {
                    return;
                }

                ETLEntryObjectHistory etlEntryObjectHistory = new ETLEntryObjectHistory(session);
                etlEntryObjectHistory.ErrorCode           = ErrorCode;
                etlEntryObjectHistory.ETLBusinessObjectId = etlBusinessObject;
                etlEntryObjectHistory.ObjectEntryLogId    = newestObjectEntryLog;
                etlEntryObjectHistory.RowTimeStamp        = DateTime.Now;
                etlEntryObjectHistory.RowStatus           = 0;
                etlEntryObjectHistory.Save();
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        public ETLEntryObjectHistory GetETLEntryObjectHistory(Session session, Guid jobId, Int64 businessObjectId)
        {
            ETLEntryObjectHistory etlEntryObjectHistory = null;

            try
            {
                ETLJob job = session.GetObjectByKey <ETLJob>(jobId);
                if (job == null)
                {
                    return(null);
                }

                BusinessObject businessObject = session.GetObjectByKey <BusinessObject>(businessObjectId);
                if (businessObject == null)
                {
                    return(null);
                }

                ObjectEntryLogBO objectEntryLogBO     = new ObjectEntryLogBO();
                ETLLogBO         etlLogBO             = new ETLLogBO();
                ObjectEntryLog   newestObjectEntryLog = objectEntryLogBO.GetNewestObjectEntryLog(session, businessObjectId);

                ETLBusinessObject etlBusinessObject = etlLogBO.GetETLBusinessObject(session, jobId, businessObjectId);
                if (etlBusinessObject == null)
                {
                    return(null);
                }

                CriteriaOperator criteria_0 = new BinaryOperator("ETLBusinessObjectId", etlBusinessObject, BinaryOperatorType.Equal);
                CriteriaOperator criteria_1 = new BinaryOperator(new OperandProperty("ObjectEntryLogId.BusinessObjectId.BusinessObjectId"), businessObject.BusinessObjectId, BinaryOperatorType.Equal);
                CriteriaOperator criteria   = GroupOperator.Combine(GroupOperatorType.And, criteria_0, criteria_1);

                etlEntryObjectHistory = session.FindObject <ETLEntryObjectHistory>(criteria);
            }
            catch (Exception)
            {
                throw;
            }
            return(etlEntryObjectHistory);
        }