示例#1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.Sys.WAVE_MODEL model, params string[] updateProperties)
        {
            Apps.Models.WAVE entity = m_Rep.GetById(model.INTERNAL_WAVE_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_WAVE_NUM      = model.INTERNAL_WAVE_NUM;
                entity.WAREHOUSE              = model.WAREHOUSE;
                entity.WAVE_NAME              = model.WAVE_NAME;
                entity.WAVE_MASTER            = model.WAVE_MASTER;
                entity.STATUS                 = model.STATUS;
                entity.CURRENT_WAVE_STEP      = model.CURRENT_WAVE_STEP;
                entity.LAST_WAVE_STEP         = model.LAST_WAVE_STEP;
                entity.TOTAL_SHIPMENTS        = model.TOTAL_SHIPMENTS;
                entity.TOTAL_LINES            = model.TOTAL_LINES;
                entity.TOTAL_QTY              = model.TOTAL_QTY;
                entity.QUANTITY_UM            = model.QUANTITY_UM;
                entity.WAVE_DATE_TIME_STARTED = model.WAVE_DATE_TIME_STARTED;
                entity.WAVE_DATE_TIME_ENDED   = model.WAVE_DATE_TIME_ENDED;
                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.USER_STAMP             = model.USER_STAMP;
                entity.DATE_TIME_STAMP        = model.DATE_TIME_STAMP;
                entity.WAVE_MODE              = model.WAVE_MODE;
                entity.ERROR_MESSAGE          = model.ERROR_MESSAGE;
                entity.LOCKED                 = model.LOCKED;
                entity.REPLENISHMENT_REQD     = model.REPLENISHMENT_REQD;
                entity.PROCESS_STAMP          = model.PROCESS_STAMP;
                entity.MESSAGE_ID             = model.MESSAGE_ID;
                entity.RUN_USER               = model.RUN_USER;
                entity.RELESAE_USER           = model.RELESAE_USER;
                entity.RELESAE_DATE_TIME      = model.RELESAE_DATE_TIME;
                entity.PRINT = model.PRINT;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.Sys.WAVE_MODEL);
                Type typeE = typeof(Apps.Models.WAVE);
                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);
        }
示例#2
0
        public virtual Apps.Models.SCV.Sys.WAVE_MODEL GetById(string id)
        {
            Apps.Models.WAVE entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //WAVE entity = m_Rep.GetById(id);
                Apps.Models.SCV.Sys.WAVE_MODEL model = new Apps.Models.SCV.Sys.WAVE_MODEL();
                model.INTERNAL_WAVE_NUM      = entity.INTERNAL_WAVE_NUM;
                model.WAREHOUSE              = entity.WAREHOUSE;
                model.WAVE_NAME              = entity.WAVE_NAME;
                model.WAVE_MASTER            = entity.WAVE_MASTER;
                model.STATUS                 = entity.STATUS;
                model.CURRENT_WAVE_STEP      = entity.CURRENT_WAVE_STEP;
                model.LAST_WAVE_STEP         = entity.LAST_WAVE_STEP;
                model.TOTAL_SHIPMENTS        = entity.TOTAL_SHIPMENTS;
                model.TOTAL_LINES            = entity.TOTAL_LINES;
                model.TOTAL_QTY              = entity.TOTAL_QTY;
                model.QUANTITY_UM            = entity.QUANTITY_UM;
                model.WAVE_DATE_TIME_STARTED = entity.WAVE_DATE_TIME_STARTED;
                model.WAVE_DATE_TIME_ENDED   = entity.WAVE_DATE_TIME_ENDED;
                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.USER_STAMP             = entity.USER_STAMP;
                model.DATE_TIME_STAMP        = entity.DATE_TIME_STAMP;
                model.WAVE_MODE              = entity.WAVE_MODE;
                model.ERROR_MESSAGE          = entity.ERROR_MESSAGE;
                model.LOCKED                 = entity.LOCKED;
                model.REPLENISHMENT_REQD     = entity.REPLENISHMENT_REQD;
                model.PROCESS_STAMP          = entity.PROCESS_STAMP;
                model.MESSAGE_ID             = entity.MESSAGE_ID;
                model.RUN_USER               = entity.RUN_USER;
                model.RELESAE_USER           = entity.RELESAE_USER;
                model.RELESAE_DATE_TIME      = entity.RELESAE_DATE_TIME;
                model.PRINT = entity.PRINT;

                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.Sys.WAVE_MODEL model)
        {
            Apps.Models.WAVE entity = m_Rep.GetById(model.INTERNAL_WAVE_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.WAVE();
            entity.INTERNAL_WAVE_NUM      = model.INTERNAL_WAVE_NUM;
            entity.WAREHOUSE              = model.WAREHOUSE;
            entity.WAVE_NAME              = model.WAVE_NAME;
            entity.WAVE_MASTER            = model.WAVE_MASTER;
            entity.STATUS                 = model.STATUS;
            entity.CURRENT_WAVE_STEP      = model.CURRENT_WAVE_STEP;
            entity.LAST_WAVE_STEP         = model.LAST_WAVE_STEP;
            entity.TOTAL_SHIPMENTS        = model.TOTAL_SHIPMENTS;
            entity.TOTAL_LINES            = model.TOTAL_LINES;
            entity.TOTAL_QTY              = model.TOTAL_QTY;
            entity.QUANTITY_UM            = model.QUANTITY_UM;
            entity.WAVE_DATE_TIME_STARTED = model.WAVE_DATE_TIME_STARTED;
            entity.WAVE_DATE_TIME_ENDED   = model.WAVE_DATE_TIME_ENDED;
            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.USER_STAMP             = model.USER_STAMP;
            entity.DATE_TIME_STAMP        = model.DATE_TIME_STAMP;
            entity.WAVE_MODE              = model.WAVE_MODE;
            entity.ERROR_MESSAGE          = model.ERROR_MESSAGE;
            entity.LOCKED                 = model.LOCKED;
            entity.REPLENISHMENT_REQD     = model.REPLENISHMENT_REQD;
            entity.PROCESS_STAMP          = model.PROCESS_STAMP;
            entity.MESSAGE_ID             = model.MESSAGE_ID;
            entity.RUN_USER               = model.RUN_USER;
            entity.RELESAE_USER           = model.RELESAE_USER;
            entity.RELESAE_DATE_TIME      = model.RELESAE_DATE_TIME;
            entity.PRINT = model.PRINT;

            m_Rep.Create(entity);
        }