public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.Sys.REPLENISHMENT_MODEL model)
        {
            Apps.Models.REPLENISHMENT entity = m_Rep.GetById(model.INTERNAL_WAVE_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.REPLENISHMENT();
            entity.INTERNAL_WAVE_NUM      = model.INTERNAL_WAVE_NUM;
            entity.WAREHOUSE              = model.WAREHOUSE;
            entity.WAVE_NAME              = model.WAVE_NAME;
            entity.INTERNAL_NUM           = model.INTERNAL_NUM;
            entity.WAVE_MASTER            = model.WAVE_MASTER;
            entity.STATUS                 = model.STATUS;
            entity.CURRENT_WAVE_STEP      = model.CURRENT_WAVE_STEP;
            entity.WAVE_DATE_TIME_STARTED = model.WAVE_DATE_TIME_STARTED;
            entity.WAVE_DATE_TIME_ENDED   = model.WAVE_DATE_TIME_ENDED;
            entity.RELEASED               = model.RELEASED;
            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;

            m_Rep.Create(entity);
        }
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.Sys.REPLENISHMENT_MODEL model, params string[] updateProperties)
        {
            Apps.Models.REPLENISHMENT 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.INTERNAL_NUM           = model.INTERNAL_NUM;
                entity.WAVE_MASTER            = model.WAVE_MASTER;
                entity.STATUS                 = model.STATUS;
                entity.CURRENT_WAVE_STEP      = model.CURRENT_WAVE_STEP;
                entity.WAVE_DATE_TIME_STARTED = model.WAVE_DATE_TIME_STARTED;
                entity.WAVE_DATE_TIME_ENDED   = model.WAVE_DATE_TIME_ENDED;
                entity.RELEASED               = model.RELEASED;
                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;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.Sys.REPLENISHMENT_MODEL);
                Type typeE = typeof(Apps.Models.REPLENISHMENT);
                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);
        }
        public virtual Apps.Models.SCV.Sys.REPLENISHMENT_MODEL GetById(string id)
        {
            Apps.Models.REPLENISHMENT entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //REPLENISHMENT entity = m_Rep.GetById(id);
                Apps.Models.SCV.Sys.REPLENISHMENT_MODEL model = new Apps.Models.SCV.Sys.REPLENISHMENT_MODEL();
                model.INTERNAL_WAVE_NUM      = entity.INTERNAL_WAVE_NUM;
                model.WAREHOUSE              = entity.WAREHOUSE;
                model.WAVE_NAME              = entity.WAVE_NAME;
                model.INTERNAL_NUM           = entity.INTERNAL_NUM;
                model.WAVE_MASTER            = entity.WAVE_MASTER;
                model.STATUS                 = entity.STATUS;
                model.CURRENT_WAVE_STEP      = entity.CURRENT_WAVE_STEP;
                model.WAVE_DATE_TIME_STARTED = entity.WAVE_DATE_TIME_STARTED;
                model.WAVE_DATE_TIME_ENDED   = entity.WAVE_DATE_TIME_ENDED;
                model.RELEASED               = entity.RELEASED;
                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;

                return(model);
            }
            else
            {
                return(null);
            }
        }