Exemple #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.RECEIVING.RECEIVING_PREFERENCE_MODEL model, params string[] updateProperties)
        {
            Apps.Models.RECEIVING_PREFERENCE entity = m_Rep.GetById(model.INTERNAL_PREF_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_PREF_NUM    = model.INTERNAL_PREF_NUM;
                entity.PREFERENCE_NAME      = model.PREFERENCE_NAME;
                entity.WAREHOUSE            = model.WAREHOUSE;
                entity.AUTO_ASSIGN_LPN      = model.AUTO_ASSIGN_LPN;
                entity.AUTO_PUTAWAY         = model.AUTO_PUTAWAY;
                entity.ALLOW_OVER_RECEIVING = model.ALLOW_OVER_RECEIVING;
                entity.ACTIVE                    = model.ACTIVE;
                entity.AUTO_LOCATE               = model.AUTO_LOCATE;
                entity.AUTO_CHECKIN              = model.AUTO_CHECKIN;
                entity.SHOW_OPEN_QTY             = model.SHOW_OPEN_QTY;
                entity.RECEIPT_TYPES             = model.RECEIPT_TYPES;
                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.GROUP_PUTAWAY             = model.GROUP_PUTAWAY;
                entity.NEST_DURING_CHECKIN       = model.NEST_DURING_CHECKIN;
                entity.MANUALLY_BUILD_LPN        = model.MANUALLY_BUILD_LPN;
                entity.CREATE_DATE_TIME          = model.CREATE_DATE_TIME;
                entity.CREATE_USER               = model.CREATE_USER;
                entity.LAST_MODIFY_DATE_TIME     = model.LAST_MODIFY_DATE_TIME;
                entity.LAST_MODIFY_USER          = model.LAST_MODIFY_USER;
                entity.RULE_ASSIGNMENT           = model.RULE_ASSIGNMENT;
                entity.RECEIPT_BY_PIECE          = model.RECEIPT_BY_PIECE;
                entity.RECEIPT_AUTOMATIC_CONFIRM = model.RECEIPT_AUTOMATIC_CONFIRM;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.RECEIVING.RECEIVING_PREFERENCE_MODEL);
                Type typeE = typeof(Apps.Models.RECEIVING_PREFERENCE);
                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);
        }
Exemple #2
0
        public virtual Apps.Models.SCV.RECEIVING.RECEIVING_PREFERENCE_MODEL GetById(string id)
        {
            Apps.Models.RECEIVING_PREFERENCE entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //RECEIVING_PREFERENCE entity = m_Rep.GetById(id);
                Apps.Models.SCV.RECEIVING.RECEIVING_PREFERENCE_MODEL model = new Apps.Models.SCV.RECEIVING.RECEIVING_PREFERENCE_MODEL();
                model.INTERNAL_PREF_NUM    = entity.INTERNAL_PREF_NUM;
                model.PREFERENCE_NAME      = entity.PREFERENCE_NAME;
                model.WAREHOUSE            = entity.WAREHOUSE;
                model.AUTO_ASSIGN_LPN      = entity.AUTO_ASSIGN_LPN;
                model.AUTO_PUTAWAY         = entity.AUTO_PUTAWAY;
                model.ALLOW_OVER_RECEIVING = entity.ALLOW_OVER_RECEIVING;
                model.ACTIVE                    = entity.ACTIVE;
                model.AUTO_LOCATE               = entity.AUTO_LOCATE;
                model.AUTO_CHECKIN              = entity.AUTO_CHECKIN;
                model.SHOW_OPEN_QTY             = entity.SHOW_OPEN_QTY;
                model.RECEIPT_TYPES             = entity.RECEIPT_TYPES;
                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.GROUP_PUTAWAY             = entity.GROUP_PUTAWAY;
                model.NEST_DURING_CHECKIN       = entity.NEST_DURING_CHECKIN;
                model.MANUALLY_BUILD_LPN        = entity.MANUALLY_BUILD_LPN;
                model.CREATE_DATE_TIME          = entity.CREATE_DATE_TIME;
                model.CREATE_USER               = entity.CREATE_USER;
                model.LAST_MODIFY_DATE_TIME     = entity.LAST_MODIFY_DATE_TIME;
                model.LAST_MODIFY_USER          = entity.LAST_MODIFY_USER;
                model.RULE_ASSIGNMENT           = entity.RULE_ASSIGNMENT;
                model.RECEIPT_BY_PIECE          = entity.RECEIPT_BY_PIECE;
                model.RECEIPT_AUTOMATIC_CONFIRM = entity.RECEIPT_AUTOMATIC_CONFIRM;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemple #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.RECEIVING.RECEIVING_PREFERENCE_MODEL model)
        {
            Apps.Models.RECEIVING_PREFERENCE entity = m_Rep.GetById(model.INTERNAL_PREF_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.RECEIVING_PREFERENCE();
            entity.INTERNAL_PREF_NUM    = model.INTERNAL_PREF_NUM;
            entity.PREFERENCE_NAME      = model.PREFERENCE_NAME;
            entity.WAREHOUSE            = model.WAREHOUSE;
            entity.AUTO_ASSIGN_LPN      = model.AUTO_ASSIGN_LPN;
            entity.AUTO_PUTAWAY         = model.AUTO_PUTAWAY;
            entity.ALLOW_OVER_RECEIVING = model.ALLOW_OVER_RECEIVING;
            entity.ACTIVE                    = model.ACTIVE;
            entity.AUTO_LOCATE               = model.AUTO_LOCATE;
            entity.AUTO_CHECKIN              = model.AUTO_CHECKIN;
            entity.SHOW_OPEN_QTY             = model.SHOW_OPEN_QTY;
            entity.RECEIPT_TYPES             = model.RECEIPT_TYPES;
            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.GROUP_PUTAWAY             = model.GROUP_PUTAWAY;
            entity.NEST_DURING_CHECKIN       = model.NEST_DURING_CHECKIN;
            entity.MANUALLY_BUILD_LPN        = model.MANUALLY_BUILD_LPN;
            entity.CREATE_DATE_TIME          = model.CREATE_DATE_TIME;
            entity.CREATE_USER               = model.CREATE_USER;
            entity.LAST_MODIFY_DATE_TIME     = model.LAST_MODIFY_DATE_TIME;
            entity.LAST_MODIFY_USER          = model.LAST_MODIFY_USER;
            entity.RULE_ASSIGNMENT           = model.RULE_ASSIGNMENT;
            entity.RECEIPT_BY_PIECE          = model.RECEIPT_BY_PIECE;
            entity.RECEIPT_AUTOMATIC_CONFIRM = model.RECEIPT_AUTOMATIC_CONFIRM;

            m_Rep.Create(entity);
        }