コード例 #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.AR.AR_DOWNLOAD_ITEM_MODEL model, params string[] updateProperties)
        {
            Apps.Models.AR_DOWNLOAD_ITEM entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
                entity.INTERFACE_ACTION_CODE = model.INTERFACE_ACTION_CODE;
                entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
                entity.PROCESS_STAMP         = model.PROCESS_STAMP;
                entity.ITEM                     = model.ITEM;
                entity.COMPANY                  = model.COMPANY;
                entity.ITEM_DESC                = model.ITEM_DESC;
                entity.STORAGE_TEMPLATE         = model.STORAGE_TEMPLATE;
                entity.ITEM_CLASS               = model.ITEM_CLASS;
                entity.PACKING_CLASS            = model.PACKING_CLASS;
                entity.ATTRIBUTE_TRACK          = model.ATTRIBUTE_TRACK;
                entity.DAYS_TO_EXPIRE           = model.DAYS_TO_EXPIRE;
                entity.LOCATING_RULE            = model.LOCATING_RULE;
                entity.ALLOCATION_RULE          = model.ALLOCATION_RULE;
                entity.REPLENISHMENT_RULE       = model.REPLENISHMENT_RULE;
                entity.EMPTY_LOC_RULE           = model.EMPTY_LOC_RULE;
                entity.ITEM_CATEGORY1           = model.ITEM_CATEGORY1;
                entity.ITEM_CATEGORY2           = model.ITEM_CATEGORY2;
                entity.ITEM_CATEGORY3           = model.ITEM_CATEGORY3;
                entity.ITEM_CATEGORY4           = model.ITEM_CATEGORY4;
                entity.ITEM_CATEGORY5           = model.ITEM_CATEGORY5;
                entity.ITEM_CATEGORY6           = model.ITEM_CATEGORY6;
                entity.ITEM_CATEGORY7           = model.ITEM_CATEGORY7;
                entity.ITEM_CATEGORY8           = model.ITEM_CATEGORY8;
                entity.USER_STAMP               = model.USER_STAMP;
                entity.DATE_TIME_STAMP          = model.DATE_TIME_STAMP;
                entity.ACTIVE                   = model.ACTIVE;
                entity.ATTRIBUTE_TEMPLATE_NAME  = model.ATTRIBUTE_TEMPLATE_NAME;
                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.SERIAL_NUM_TRACK         = model.SERIAL_NUM_TRACK;
                entity.SERIAL_NUM_TEMPLATE_NAME = model.SERIAL_NUM_TEMPLATE_NAME;
                entity.BRAND                    = model.BRAND;
                entity.DIVISION                 = model.DIVISION;
                entity.DEPARTMENT               = model.DEPARTMENT;
                entity.COST                     = model.COST;
                entity.ITEM_SIZE                = model.ITEM_SIZE;
                entity.ITEM_COLOR               = model.ITEM_COLOR;
                entity.ITEM_STYLE               = model.ITEM_STYLE;
                entity.LIST_PRICE               = model.LIST_PRICE;
                entity.NET_PRICE                = model.NET_PRICE;
                entity.PLACE_OF_ORIGIN          = model.PLACE_OF_ORIGIN;
                entity.ITEM_ATTRIBUTE1          = model.ITEM_ATTRIBUTE1;
                entity.ITEM_ATTRIBUTE2          = model.ITEM_ATTRIBUTE2;
                entity.ITEM_ATTRIBUTE3          = model.ITEM_ATTRIBUTE3;
                entity.ITEM_ATTRIBUTE4          = model.ITEM_ATTRIBUTE4;
                entity.ITEM_ATTRIBUTE5          = model.ITEM_ATTRIBUTE5;
                entity.ITEM_ATTRIBUTE6          = model.ITEM_ATTRIBUTE6;
                entity.ITEM_ATTRIBUTE7          = model.ITEM_ATTRIBUTE7;
                entity.ITEM_ATTRIBUTE8          = model.ITEM_ATTRIBUTE8;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.AR.AR_DOWNLOAD_ITEM_MODEL);
                Type typeE = typeof(Apps.Models.AR_DOWNLOAD_ITEM);
                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.AR.AR_DOWNLOAD_ITEM_MODEL GetById(string id)
        {
            Apps.Models.AR_DOWNLOAD_ITEM entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //AR_DOWNLOAD_ITEM entity = m_Rep.GetById(id);
                Apps.Models.SCV.AR.AR_DOWNLOAD_ITEM_MODEL model = new Apps.Models.SCV.AR.AR_DOWNLOAD_ITEM_MODEL();
                model.INTERFACE_RECORD_ID   = entity.INTERFACE_RECORD_ID;
                model.INTERFACE_ACTION_CODE = entity.INTERFACE_ACTION_CODE;
                model.INTERFACE_CONDITION   = entity.INTERFACE_CONDITION;
                model.PROCESS_STAMP         = entity.PROCESS_STAMP;
                model.ITEM                     = entity.ITEM;
                model.COMPANY                  = entity.COMPANY;
                model.ITEM_DESC                = entity.ITEM_DESC;
                model.STORAGE_TEMPLATE         = entity.STORAGE_TEMPLATE;
                model.ITEM_CLASS               = entity.ITEM_CLASS;
                model.PACKING_CLASS            = entity.PACKING_CLASS;
                model.ATTRIBUTE_TRACK          = entity.ATTRIBUTE_TRACK;
                model.DAYS_TO_EXPIRE           = entity.DAYS_TO_EXPIRE;
                model.LOCATING_RULE            = entity.LOCATING_RULE;
                model.ALLOCATION_RULE          = entity.ALLOCATION_RULE;
                model.REPLENISHMENT_RULE       = entity.REPLENISHMENT_RULE;
                model.EMPTY_LOC_RULE           = entity.EMPTY_LOC_RULE;
                model.ITEM_CATEGORY1           = entity.ITEM_CATEGORY1;
                model.ITEM_CATEGORY2           = entity.ITEM_CATEGORY2;
                model.ITEM_CATEGORY3           = entity.ITEM_CATEGORY3;
                model.ITEM_CATEGORY4           = entity.ITEM_CATEGORY4;
                model.ITEM_CATEGORY5           = entity.ITEM_CATEGORY5;
                model.ITEM_CATEGORY6           = entity.ITEM_CATEGORY6;
                model.ITEM_CATEGORY7           = entity.ITEM_CATEGORY7;
                model.ITEM_CATEGORY8           = entity.ITEM_CATEGORY8;
                model.USER_STAMP               = entity.USER_STAMP;
                model.DATE_TIME_STAMP          = entity.DATE_TIME_STAMP;
                model.ACTIVE                   = entity.ACTIVE;
                model.ATTRIBUTE_TEMPLATE_NAME  = entity.ATTRIBUTE_TEMPLATE_NAME;
                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.SERIAL_NUM_TRACK         = entity.SERIAL_NUM_TRACK;
                model.SERIAL_NUM_TEMPLATE_NAME = entity.SERIAL_NUM_TEMPLATE_NAME;
                model.BRAND                    = entity.BRAND;
                model.DIVISION                 = entity.DIVISION;
                model.DEPARTMENT               = entity.DEPARTMENT;
                model.COST                     = entity.COST;
                model.ITEM_SIZE                = entity.ITEM_SIZE;
                model.ITEM_COLOR               = entity.ITEM_COLOR;
                model.ITEM_STYLE               = entity.ITEM_STYLE;
                model.LIST_PRICE               = entity.LIST_PRICE;
                model.NET_PRICE                = entity.NET_PRICE;
                model.PLACE_OF_ORIGIN          = entity.PLACE_OF_ORIGIN;
                model.ITEM_ATTRIBUTE1          = entity.ITEM_ATTRIBUTE1;
                model.ITEM_ATTRIBUTE2          = entity.ITEM_ATTRIBUTE2;
                model.ITEM_ATTRIBUTE3          = entity.ITEM_ATTRIBUTE3;
                model.ITEM_ATTRIBUTE4          = entity.ITEM_ATTRIBUTE4;
                model.ITEM_ATTRIBUTE5          = entity.ITEM_ATTRIBUTE5;
                model.ITEM_ATTRIBUTE6          = entity.ITEM_ATTRIBUTE6;
                model.ITEM_ATTRIBUTE7          = entity.ITEM_ATTRIBUTE7;
                model.ITEM_ATTRIBUTE8          = entity.ITEM_ATTRIBUTE8;

                return(model);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.AR.AR_DOWNLOAD_ITEM_MODEL model)
        {
            Apps.Models.AR_DOWNLOAD_ITEM entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.AR_DOWNLOAD_ITEM();
            entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
            entity.INTERFACE_ACTION_CODE = model.INTERFACE_ACTION_CODE;
            entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
            entity.PROCESS_STAMP         = model.PROCESS_STAMP;
            entity.ITEM                     = model.ITEM;
            entity.COMPANY                  = model.COMPANY;
            entity.ITEM_DESC                = model.ITEM_DESC;
            entity.STORAGE_TEMPLATE         = model.STORAGE_TEMPLATE;
            entity.ITEM_CLASS               = model.ITEM_CLASS;
            entity.PACKING_CLASS            = model.PACKING_CLASS;
            entity.ATTRIBUTE_TRACK          = model.ATTRIBUTE_TRACK;
            entity.DAYS_TO_EXPIRE           = model.DAYS_TO_EXPIRE;
            entity.LOCATING_RULE            = model.LOCATING_RULE;
            entity.ALLOCATION_RULE          = model.ALLOCATION_RULE;
            entity.REPLENISHMENT_RULE       = model.REPLENISHMENT_RULE;
            entity.EMPTY_LOC_RULE           = model.EMPTY_LOC_RULE;
            entity.ITEM_CATEGORY1           = model.ITEM_CATEGORY1;
            entity.ITEM_CATEGORY2           = model.ITEM_CATEGORY2;
            entity.ITEM_CATEGORY3           = model.ITEM_CATEGORY3;
            entity.ITEM_CATEGORY4           = model.ITEM_CATEGORY4;
            entity.ITEM_CATEGORY5           = model.ITEM_CATEGORY5;
            entity.ITEM_CATEGORY6           = model.ITEM_CATEGORY6;
            entity.ITEM_CATEGORY7           = model.ITEM_CATEGORY7;
            entity.ITEM_CATEGORY8           = model.ITEM_CATEGORY8;
            entity.USER_STAMP               = model.USER_STAMP;
            entity.DATE_TIME_STAMP          = model.DATE_TIME_STAMP;
            entity.ACTIVE                   = model.ACTIVE;
            entity.ATTRIBUTE_TEMPLATE_NAME  = model.ATTRIBUTE_TEMPLATE_NAME;
            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.SERIAL_NUM_TRACK         = model.SERIAL_NUM_TRACK;
            entity.SERIAL_NUM_TEMPLATE_NAME = model.SERIAL_NUM_TEMPLATE_NAME;
            entity.BRAND                    = model.BRAND;
            entity.DIVISION                 = model.DIVISION;
            entity.DEPARTMENT               = model.DEPARTMENT;
            entity.COST                     = model.COST;
            entity.ITEM_SIZE                = model.ITEM_SIZE;
            entity.ITEM_COLOR               = model.ITEM_COLOR;
            entity.ITEM_STYLE               = model.ITEM_STYLE;
            entity.LIST_PRICE               = model.LIST_PRICE;
            entity.NET_PRICE                = model.NET_PRICE;
            entity.PLACE_OF_ORIGIN          = model.PLACE_OF_ORIGIN;
            entity.ITEM_ATTRIBUTE1          = model.ITEM_ATTRIBUTE1;
            entity.ITEM_ATTRIBUTE2          = model.ITEM_ATTRIBUTE2;
            entity.ITEM_ATTRIBUTE3          = model.ITEM_ATTRIBUTE3;
            entity.ITEM_ATTRIBUTE4          = model.ITEM_ATTRIBUTE4;
            entity.ITEM_ATTRIBUTE5          = model.ITEM_ATTRIBUTE5;
            entity.ITEM_ATTRIBUTE6          = model.ITEM_ATTRIBUTE6;
            entity.ITEM_ATTRIBUTE7          = model.ITEM_ATTRIBUTE7;
            entity.ITEM_ATTRIBUTE8          = model.ITEM_ATTRIBUTE8;

            m_Rep.Create(entity);
        }