Beispiel #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.SCHEDULE.SCHEDULE_JOB_MODEL model, params string[] updateProperties)
        {
            Apps.Models.SCHEDULE_JOB entity = m_Rep.GetById(model.JOB_NAME);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.JOB_NAME          = model.JOB_NAME;
                entity.JOB_GROUP         = model.JOB_GROUP;
                entity.DESCRIPTION       = model.DESCRIPTION;
                entity.IS_DURABLE        = model.IS_DURABLE;
                entity.IS_NONCONCURRENT  = model.IS_NONCONCURRENT;
                entity.IS_UPDATE_DATA    = model.IS_UPDATE_DATA;
                entity.REQUESTS_RECOVERY = model.REQUESTS_RECOVERY;
                entity.JOB_TYPE          = model.JOB_TYPE;
                entity.CRON_EXPRESSION   = model.CRON_EXPRESSION;
                entity.NEXT_FIRE_TIME    = model.NEXT_FIRE_TIME;
                entity.PREV_FIRE_TIME    = model.PREV_FIRE_TIME;
                entity.ACTIVE            = model.ACTIVE;
                entity.SYSTEM_CREATED    = model.SYSTEM_CREATED;
                entity.USER_STAMP        = model.USER_STAMP;
                entity.DATE_TIME_STAMP   = model.DATE_TIME_STAMP;
                entity.PROCESS_STAMP     = model.PROCESS_STAMP;
                entity.PARA1_VALUE       = model.PARA1_VALUE;
                entity.PARA2_VALUE       = model.PARA2_VALUE;
                entity.PARA3_VALUE       = model.PARA3_VALUE;
                entity.PARA4_VALUE       = model.PARA4_VALUE;
                entity.PARA5_VALUE       = model.PARA5_VALUE;
                entity.PARA6_VALUE       = model.PARA6_VALUE;
                entity.PARA7_VALUE       = model.PARA7_VALUE;
                entity.PARA8_VALUE       = model.PARA8_VALUE;
                entity.USER_DEF1         = model.USER_DEF1;
                entity.USER_DEF2         = model.USER_DEF2;
                entity.USER_DEF3         = model.USER_DEF3;
                entity.USER_DEF4         = model.USER_DEF4;
                entity.USER_DEF5         = model.USER_DEF5;
                entity.USER_DEF6         = model.USER_DEF6;
                entity.USER_DEF7         = model.USER_DEF7;
                entity.USER_DEF8         = model.USER_DEF8;
                entity.JOB_STATUS        = model.JOB_STATUS;
                entity.RUNNED            = model.RUNNED;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.SCHEDULE.SCHEDULE_JOB_MODEL);
                Type typeE = typeof(Apps.Models.SCHEDULE_JOB);
                foreach (var item in updateProperties)
                {
                    System.Reflection.PropertyInfo pi  = type.GetProperty(item);
                    System.Reflection.PropertyInfo piE = typeE.GetProperty(item);
                    piE.SetValue(entity, pi.GetValue(model), null);
                }
            }


            m_Rep.Modify(entity, updateProperties);
        }
Beispiel #2
0
        public virtual Apps.Models.SCV.SCHEDULE.SCHEDULE_JOB_MODEL GetById(string id)
        {
            Apps.Models.SCHEDULE_JOB entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //SCHEDULE_JOB entity = m_Rep.GetById(id);
                Apps.Models.SCV.SCHEDULE.SCHEDULE_JOB_MODEL model = new Apps.Models.SCV.SCHEDULE.SCHEDULE_JOB_MODEL();
                model.JOB_NAME          = entity.JOB_NAME;
                model.JOB_GROUP         = entity.JOB_GROUP;
                model.DESCRIPTION       = entity.DESCRIPTION;
                model.IS_DURABLE        = entity.IS_DURABLE;
                model.IS_NONCONCURRENT  = entity.IS_NONCONCURRENT;
                model.IS_UPDATE_DATA    = entity.IS_UPDATE_DATA;
                model.REQUESTS_RECOVERY = entity.REQUESTS_RECOVERY;
                model.JOB_TYPE          = entity.JOB_TYPE;
                model.CRON_EXPRESSION   = entity.CRON_EXPRESSION;
                model.NEXT_FIRE_TIME    = entity.NEXT_FIRE_TIME;
                model.PREV_FIRE_TIME    = entity.PREV_FIRE_TIME;
                model.ACTIVE            = entity.ACTIVE;
                model.SYSTEM_CREATED    = entity.SYSTEM_CREATED;
                model.USER_STAMP        = entity.USER_STAMP;
                model.DATE_TIME_STAMP   = entity.DATE_TIME_STAMP;
                model.PROCESS_STAMP     = entity.PROCESS_STAMP;
                model.PARA1_VALUE       = entity.PARA1_VALUE;
                model.PARA2_VALUE       = entity.PARA2_VALUE;
                model.PARA3_VALUE       = entity.PARA3_VALUE;
                model.PARA4_VALUE       = entity.PARA4_VALUE;
                model.PARA5_VALUE       = entity.PARA5_VALUE;
                model.PARA6_VALUE       = entity.PARA6_VALUE;
                model.PARA7_VALUE       = entity.PARA7_VALUE;
                model.PARA8_VALUE       = entity.PARA8_VALUE;
                model.USER_DEF1         = entity.USER_DEF1;
                model.USER_DEF2         = entity.USER_DEF2;
                model.USER_DEF3         = entity.USER_DEF3;
                model.USER_DEF4         = entity.USER_DEF4;
                model.USER_DEF5         = entity.USER_DEF5;
                model.USER_DEF6         = entity.USER_DEF6;
                model.USER_DEF7         = entity.USER_DEF7;
                model.USER_DEF8         = entity.USER_DEF8;
                model.JOB_STATUS        = entity.JOB_STATUS;
                model.RUNNED            = entity.RUNNED;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.SCHEDULE.SCHEDULE_JOB_MODEL model)
        {
            Apps.Models.SCHEDULE_JOB entity = m_Rep.GetById(model.JOB_NAME);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity                   = new Apps.Models.SCHEDULE_JOB();
            entity.JOB_NAME          = model.JOB_NAME;
            entity.JOB_GROUP         = model.JOB_GROUP;
            entity.DESCRIPTION       = model.DESCRIPTION;
            entity.IS_DURABLE        = model.IS_DURABLE;
            entity.IS_NONCONCURRENT  = model.IS_NONCONCURRENT;
            entity.IS_UPDATE_DATA    = model.IS_UPDATE_DATA;
            entity.REQUESTS_RECOVERY = model.REQUESTS_RECOVERY;
            entity.JOB_TYPE          = model.JOB_TYPE;
            entity.CRON_EXPRESSION   = model.CRON_EXPRESSION;
            entity.NEXT_FIRE_TIME    = model.NEXT_FIRE_TIME;
            entity.PREV_FIRE_TIME    = model.PREV_FIRE_TIME;
            entity.ACTIVE            = model.ACTIVE;
            entity.SYSTEM_CREATED    = model.SYSTEM_CREATED;
            entity.USER_STAMP        = model.USER_STAMP;
            entity.DATE_TIME_STAMP   = model.DATE_TIME_STAMP;
            entity.PROCESS_STAMP     = model.PROCESS_STAMP;
            entity.PARA1_VALUE       = model.PARA1_VALUE;
            entity.PARA2_VALUE       = model.PARA2_VALUE;
            entity.PARA3_VALUE       = model.PARA3_VALUE;
            entity.PARA4_VALUE       = model.PARA4_VALUE;
            entity.PARA5_VALUE       = model.PARA5_VALUE;
            entity.PARA6_VALUE       = model.PARA6_VALUE;
            entity.PARA7_VALUE       = model.PARA7_VALUE;
            entity.PARA8_VALUE       = model.PARA8_VALUE;
            entity.USER_DEF1         = model.USER_DEF1;
            entity.USER_DEF2         = model.USER_DEF2;
            entity.USER_DEF3         = model.USER_DEF3;
            entity.USER_DEF4         = model.USER_DEF4;
            entity.USER_DEF5         = model.USER_DEF5;
            entity.USER_DEF6         = model.USER_DEF6;
            entity.USER_DEF7         = model.USER_DEF7;
            entity.USER_DEF8         = model.USER_DEF8;
            entity.JOB_STATUS        = model.JOB_STATUS;
            entity.RUNNED            = model.RUNNED;

            m_Rep.Create(entity);
        }