Esempio n. 1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.ATTRIBUTE.ATTRIBUTE_TEMPLATE_MODEL model, params string[] updateProperties)
        {
            Apps.Models.ATTRIBUTE_TEMPLATE entity = m_Rep.GetById(model.INTERNAL_TEMPLATE_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_TEMPLATE_NUM   = model.INTERNAL_TEMPLATE_NUM;
                entity.ATTRIBUTE_TEMPLATE_NAME = model.ATTRIBUTE_TEMPLATE_NAME;
                entity.ACTIVE            = model.ACTIVE;
                entity.ATTRIBUTE_NAME1   = model.ATTRIBUTE_NAME1;
                entity.AUTO_FILL1        = model.AUTO_FILL1;
                entity.AUTO_FILL_FORMAT1 = model.AUTO_FILL_FORMAT1;
                entity.PATTERN1          = model.PATTERN1;
                entity.ACTIVE1           = model.ACTIVE1;
                entity.READY_ONLY1       = model.READY_ONLY1;
                entity.ATTRIBUTE_NAME2   = model.ATTRIBUTE_NAME2;
                entity.AUTO_FILL2        = model.AUTO_FILL2;
                entity.AUTO_FILL_FORMAT2 = model.AUTO_FILL_FORMAT2;
                entity.PATTERN2          = model.PATTERN2;
                entity.ACTIVE2           = model.ACTIVE2;
                entity.READY_ONLY2       = model.READY_ONLY2;
                entity.ATTRIBUTE_NAME3   = model.ATTRIBUTE_NAME3;
                entity.AUTO_FILL3        = model.AUTO_FILL3;
                entity.AUTO_FILL_FORMAT3 = model.AUTO_FILL_FORMAT3;
                entity.PATTERN3          = model.PATTERN3;
                entity.ACTIVE3           = model.ACTIVE3;
                entity.READY_ONLY3       = model.READY_ONLY3;
                entity.ATTRIBUTE_NAME4   = model.ATTRIBUTE_NAME4;
                entity.AUTO_FILL4        = model.AUTO_FILL4;
                entity.AUTO_FILL_FORMAT4 = model.AUTO_FILL_FORMAT4;
                entity.PATTERN4          = model.PATTERN4;
                entity.ACTIVE4           = model.ACTIVE4;
                entity.READY_ONLY4       = model.READY_ONLY4;
                entity.ATTRIBUTE_NAME5   = model.ATTRIBUTE_NAME5;
                entity.AUTO_FILL5        = model.AUTO_FILL5;
                entity.AUTO_FILL_FORMAT5 = model.AUTO_FILL_FORMAT5;
                entity.PATTERN5          = model.PATTERN5;
                entity.ACTIVE5           = model.ACTIVE5;
                entity.READY_ONLY5       = model.READY_ONLY5;
                entity.ATTRIBUTE_NAME6   = model.ATTRIBUTE_NAME6;
                entity.AUTO_FILL6        = model.AUTO_FILL6;
                entity.AUTO_FILL_FORMAT6 = model.AUTO_FILL_FORMAT6;
                entity.PATTERN6          = model.PATTERN6;
                entity.ACTIVE6           = model.ACTIVE6;
                entity.READY_ONLY6       = model.READY_ONLY6;
                entity.ATTRIBUTE_NAME7   = model.ATTRIBUTE_NAME7;
                entity.AUTO_FILL7        = model.AUTO_FILL7;
                entity.AUTO_FILL_FORMAT7 = model.AUTO_FILL_FORMAT7;
                entity.PATTERN7          = model.PATTERN7;
                entity.ACTIVE7           = model.ACTIVE7;
                entity.READY_ONLY7       = model.READY_ONLY7;
                entity.ATTRIBUTE_NAME8   = model.ATTRIBUTE_NAME8;
                entity.AUTO_FILL8        = model.AUTO_FILL8;
                entity.AUTO_FILL_FORMAT8 = model.AUTO_FILL_FORMAT8;
                entity.PATTERN8          = model.PATTERN8;
                entity.ACTIVE8           = model.ACTIVE8;
                entity.READY_ONLY8       = model.READY_ONLY8;
                entity.USER_STAMP        = model.USER_STAMP;
                entity.DATE_TIME_STAMP   = model.DATE_TIME_STAMP;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.ATTRIBUTE.ATTRIBUTE_TEMPLATE_MODEL);
                Type typeE = typeof(Apps.Models.ATTRIBUTE_TEMPLATE);
                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);
        }
Esempio n. 2
0
        public virtual Apps.Models.SCV.ATTRIBUTE.ATTRIBUTE_TEMPLATE_MODEL GetById(string id)
        {
            Apps.Models.ATTRIBUTE_TEMPLATE entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //ATTRIBUTE_TEMPLATE entity = m_Rep.GetById(id);
                Apps.Models.SCV.ATTRIBUTE.ATTRIBUTE_TEMPLATE_MODEL model = new Apps.Models.SCV.ATTRIBUTE.ATTRIBUTE_TEMPLATE_MODEL();
                model.INTERNAL_TEMPLATE_NUM   = entity.INTERNAL_TEMPLATE_NUM;
                model.ATTRIBUTE_TEMPLATE_NAME = entity.ATTRIBUTE_TEMPLATE_NAME;
                model.ACTIVE            = entity.ACTIVE;
                model.ATTRIBUTE_NAME1   = entity.ATTRIBUTE_NAME1;
                model.AUTO_FILL1        = entity.AUTO_FILL1;
                model.AUTO_FILL_FORMAT1 = entity.AUTO_FILL_FORMAT1;
                model.PATTERN1          = entity.PATTERN1;
                model.ACTIVE1           = entity.ACTIVE1;
                model.READY_ONLY1       = entity.READY_ONLY1;
                model.ATTRIBUTE_NAME2   = entity.ATTRIBUTE_NAME2;
                model.AUTO_FILL2        = entity.AUTO_FILL2;
                model.AUTO_FILL_FORMAT2 = entity.AUTO_FILL_FORMAT2;
                model.PATTERN2          = entity.PATTERN2;
                model.ACTIVE2           = entity.ACTIVE2;
                model.READY_ONLY2       = entity.READY_ONLY2;
                model.ATTRIBUTE_NAME3   = entity.ATTRIBUTE_NAME3;
                model.AUTO_FILL3        = entity.AUTO_FILL3;
                model.AUTO_FILL_FORMAT3 = entity.AUTO_FILL_FORMAT3;
                model.PATTERN3          = entity.PATTERN3;
                model.ACTIVE3           = entity.ACTIVE3;
                model.READY_ONLY3       = entity.READY_ONLY3;
                model.ATTRIBUTE_NAME4   = entity.ATTRIBUTE_NAME4;
                model.AUTO_FILL4        = entity.AUTO_FILL4;
                model.AUTO_FILL_FORMAT4 = entity.AUTO_FILL_FORMAT4;
                model.PATTERN4          = entity.PATTERN4;
                model.ACTIVE4           = entity.ACTIVE4;
                model.READY_ONLY4       = entity.READY_ONLY4;
                model.ATTRIBUTE_NAME5   = entity.ATTRIBUTE_NAME5;
                model.AUTO_FILL5        = entity.AUTO_FILL5;
                model.AUTO_FILL_FORMAT5 = entity.AUTO_FILL_FORMAT5;
                model.PATTERN5          = entity.PATTERN5;
                model.ACTIVE5           = entity.ACTIVE5;
                model.READY_ONLY5       = entity.READY_ONLY5;
                model.ATTRIBUTE_NAME6   = entity.ATTRIBUTE_NAME6;
                model.AUTO_FILL6        = entity.AUTO_FILL6;
                model.AUTO_FILL_FORMAT6 = entity.AUTO_FILL_FORMAT6;
                model.PATTERN6          = entity.PATTERN6;
                model.ACTIVE6           = entity.ACTIVE6;
                model.READY_ONLY6       = entity.READY_ONLY6;
                model.ATTRIBUTE_NAME7   = entity.ATTRIBUTE_NAME7;
                model.AUTO_FILL7        = entity.AUTO_FILL7;
                model.AUTO_FILL_FORMAT7 = entity.AUTO_FILL_FORMAT7;
                model.PATTERN7          = entity.PATTERN7;
                model.ACTIVE7           = entity.ACTIVE7;
                model.READY_ONLY7       = entity.READY_ONLY7;
                model.ATTRIBUTE_NAME8   = entity.ATTRIBUTE_NAME8;
                model.AUTO_FILL8        = entity.AUTO_FILL8;
                model.AUTO_FILL_FORMAT8 = entity.AUTO_FILL_FORMAT8;
                model.PATTERN8          = entity.PATTERN8;
                model.ACTIVE8           = entity.ACTIVE8;
                model.READY_ONLY8       = entity.READY_ONLY8;
                model.USER_STAMP        = entity.USER_STAMP;
                model.DATE_TIME_STAMP   = entity.DATE_TIME_STAMP;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.ATTRIBUTE.ATTRIBUTE_TEMPLATE_MODEL model)
        {
            Apps.Models.ATTRIBUTE_TEMPLATE entity = m_Rep.GetById(model.INTERNAL_TEMPLATE_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.ATTRIBUTE_TEMPLATE();
            entity.INTERNAL_TEMPLATE_NUM   = model.INTERNAL_TEMPLATE_NUM;
            entity.ATTRIBUTE_TEMPLATE_NAME = model.ATTRIBUTE_TEMPLATE_NAME;
            entity.ACTIVE            = model.ACTIVE;
            entity.ATTRIBUTE_NAME1   = model.ATTRIBUTE_NAME1;
            entity.AUTO_FILL1        = model.AUTO_FILL1;
            entity.AUTO_FILL_FORMAT1 = model.AUTO_FILL_FORMAT1;
            entity.PATTERN1          = model.PATTERN1;
            entity.ACTIVE1           = model.ACTIVE1;
            entity.READY_ONLY1       = model.READY_ONLY1;
            entity.ATTRIBUTE_NAME2   = model.ATTRIBUTE_NAME2;
            entity.AUTO_FILL2        = model.AUTO_FILL2;
            entity.AUTO_FILL_FORMAT2 = model.AUTO_FILL_FORMAT2;
            entity.PATTERN2          = model.PATTERN2;
            entity.ACTIVE2           = model.ACTIVE2;
            entity.READY_ONLY2       = model.READY_ONLY2;
            entity.ATTRIBUTE_NAME3   = model.ATTRIBUTE_NAME3;
            entity.AUTO_FILL3        = model.AUTO_FILL3;
            entity.AUTO_FILL_FORMAT3 = model.AUTO_FILL_FORMAT3;
            entity.PATTERN3          = model.PATTERN3;
            entity.ACTIVE3           = model.ACTIVE3;
            entity.READY_ONLY3       = model.READY_ONLY3;
            entity.ATTRIBUTE_NAME4   = model.ATTRIBUTE_NAME4;
            entity.AUTO_FILL4        = model.AUTO_FILL4;
            entity.AUTO_FILL_FORMAT4 = model.AUTO_FILL_FORMAT4;
            entity.PATTERN4          = model.PATTERN4;
            entity.ACTIVE4           = model.ACTIVE4;
            entity.READY_ONLY4       = model.READY_ONLY4;
            entity.ATTRIBUTE_NAME5   = model.ATTRIBUTE_NAME5;
            entity.AUTO_FILL5        = model.AUTO_FILL5;
            entity.AUTO_FILL_FORMAT5 = model.AUTO_FILL_FORMAT5;
            entity.PATTERN5          = model.PATTERN5;
            entity.ACTIVE5           = model.ACTIVE5;
            entity.READY_ONLY5       = model.READY_ONLY5;
            entity.ATTRIBUTE_NAME6   = model.ATTRIBUTE_NAME6;
            entity.AUTO_FILL6        = model.AUTO_FILL6;
            entity.AUTO_FILL_FORMAT6 = model.AUTO_FILL_FORMAT6;
            entity.PATTERN6          = model.PATTERN6;
            entity.ACTIVE6           = model.ACTIVE6;
            entity.READY_ONLY6       = model.READY_ONLY6;
            entity.ATTRIBUTE_NAME7   = model.ATTRIBUTE_NAME7;
            entity.AUTO_FILL7        = model.AUTO_FILL7;
            entity.AUTO_FILL_FORMAT7 = model.AUTO_FILL_FORMAT7;
            entity.PATTERN7          = model.PATTERN7;
            entity.ACTIVE7           = model.ACTIVE7;
            entity.READY_ONLY7       = model.READY_ONLY7;
            entity.ATTRIBUTE_NAME8   = model.ATTRIBUTE_NAME8;
            entity.AUTO_FILL8        = model.AUTO_FILL8;
            entity.AUTO_FILL_FORMAT8 = model.AUTO_FILL_FORMAT8;
            entity.PATTERN8          = model.PATTERN8;
            entity.ACTIVE8           = model.ACTIVE8;
            entity.READY_ONLY8       = model.READY_ONLY8;
            entity.USER_STAMP        = model.USER_STAMP;
            entity.DATE_TIME_STAMP   = model.DATE_TIME_STAMP;

            m_Rep.Create(entity);
        }