Example #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.GENERIC.GENERIC_CONFIG_HEADER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.GENERIC_CONFIG_HEADER entity = m_Rep.GetById(model.RECORD_TYPE);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.RECORD_TYPE           = model.RECORD_TYPE;
                entity.DESCRIPTION           = model.DESCRIPTION;
                entity.FUNCTION_GROUP        = model.FUNCTION_GROUP;
                entity.SYSTEM_CREATED        = model.SYSTEM_CREATED;
                entity.USER_STAMP            = model.USER_STAMP;
                entity.DATE_TIME_STAMP       = model.DATE_TIME_STAMP;
                entity.OBJECT_ID             = model.OBJECT_ID;
                entity.FIELD1_NAME           = model.FIELD1_NAME;
                entity.FIELD1_TYPE           = model.FIELD1_TYPE;
                entity.FIELD1_REQUIRED       = model.FIELD1_REQUIRED;
                entity.FIELD2_NAME           = model.FIELD2_NAME;
                entity.FIELD2_TYPE           = model.FIELD2_TYPE;
                entity.FIELD2_REQUIRED       = model.FIELD2_REQUIRED;
                entity.FIELD3_NAME           = model.FIELD3_NAME;
                entity.FIELD3_TYPE           = model.FIELD3_TYPE;
                entity.FIELD3_REQUIRED       = model.FIELD3_REQUIRED;
                entity.FIELD4_NAME           = model.FIELD4_NAME;
                entity.FIELD4_TYPE           = model.FIELD4_TYPE;
                entity.FIELD4_REQUIRED       = model.FIELD4_REQUIRED;
                entity.FIELD5_NAME           = model.FIELD5_NAME;
                entity.FIELD5_TYPE           = model.FIELD5_TYPE;
                entity.FIELD5_REQUIRED       = model.FIELD5_REQUIRED;
                entity.FIELD6_NAME           = model.FIELD6_NAME;
                entity.FIELD6_TYPE           = model.FIELD6_TYPE;
                entity.FIELD6_REQUIRED       = model.FIELD6_REQUIRED;
                entity.FIELD7_NAME           = model.FIELD7_NAME;
                entity.FIELD7_TYPE           = model.FIELD7_TYPE;
                entity.FIELD7_REQUIRED       = model.FIELD7_REQUIRED;
                entity.FIELD8_NAME           = model.FIELD8_NAME;
                entity.FIELD8_TYPE           = model.FIELD8_TYPE;
                entity.FIELD8_REQUIRED       = model.FIELD8_REQUIRED;
                entity.FIELD1_LOOKUP_TABLE   = model.FIELD1_LOOKUP_TABLE;
                entity.FIELD1_FILTER_VALUE   = model.FIELD1_FILTER_VALUE;
                entity.FIELD1_LABEL_MEMBER   = model.FIELD1_LABEL_MEMBER;
                entity.FIELD1_DATA_MEMBER    = model.FIELD1_DATA_MEMBER;
                entity.FIELD1_SYSTEM_CREATED = model.FIELD1_SYSTEM_CREATED;
                entity.FIELD2_LOOKUP_TABLE   = model.FIELD2_LOOKUP_TABLE;
                entity.FIELD2_FILTER_VALUE   = model.FIELD2_FILTER_VALUE;
                entity.FIELD2_LABEL_MEMBER   = model.FIELD2_LABEL_MEMBER;
                entity.FIELD2_DATA_MEMBER    = model.FIELD2_DATA_MEMBER;
                entity.FIELD2_SYSTEM_CREATED = model.FIELD2_SYSTEM_CREATED;
                entity.FIELD3_LOOKUP_TABLE   = model.FIELD3_LOOKUP_TABLE;
                entity.FIELD3_FILTER_VALUE   = model.FIELD3_FILTER_VALUE;
                entity.FIELD3_LABEL_MEMBER   = model.FIELD3_LABEL_MEMBER;
                entity.FIELD3_DATA_MEMBER    = model.FIELD3_DATA_MEMBER;
                entity.FIELD3_SYSTEM_CREATED = model.FIELD3_SYSTEM_CREATED;
                entity.FIELD4_LOOKUP_TABLE   = model.FIELD4_LOOKUP_TABLE;
                entity.FIELD4_FILTER_VALUE   = model.FIELD4_FILTER_VALUE;
                entity.FIELD4_LABEL_MEMBER   = model.FIELD4_LABEL_MEMBER;
                entity.FIELD4_DATA_MEMBER    = model.FIELD4_DATA_MEMBER;
                entity.FIELD4_SYSTEM_CREATED = model.FIELD4_SYSTEM_CREATED;
                entity.FIELD5_LOOKUP_TABLE   = model.FIELD5_LOOKUP_TABLE;
                entity.FIELD5_FILTER_VALUE   = model.FIELD5_FILTER_VALUE;
                entity.FIELD5_LABEL_MEMBER   = model.FIELD5_LABEL_MEMBER;
                entity.FIELD5_DATA_MEMBER    = model.FIELD5_DATA_MEMBER;
                entity.FIELD5_SYSTEM_CREATED = model.FIELD5_SYSTEM_CREATED;
                entity.FIELD6_LOOKUP_TABLE   = model.FIELD6_LOOKUP_TABLE;
                entity.FIELD6_FILTER_VALUE   = model.FIELD6_FILTER_VALUE;
                entity.FIELD6_LABEL_MEMBER   = model.FIELD6_LABEL_MEMBER;
                entity.FIELD6_DATA_MEMBER    = model.FIELD6_DATA_MEMBER;
                entity.FIELD6_SYSTEM_CREATED = model.FIELD6_SYSTEM_CREATED;
                entity.FIELD7_LOOKUP_TABLE   = model.FIELD7_LOOKUP_TABLE;
                entity.FIELD7_FILTER_VALUE   = model.FIELD7_FILTER_VALUE;
                entity.FIELD7_LABEL_MEMBER   = model.FIELD7_LABEL_MEMBER;
                entity.FIELD7_DATA_MEMBER    = model.FIELD7_DATA_MEMBER;
                entity.FIELD7_SYSTEM_CREATED = model.FIELD7_SYSTEM_CREATED;
                entity.FIELD8_LOOKUP_TABLE   = model.FIELD8_LOOKUP_TABLE;
                entity.FIELD8_FILTER_VALUE   = model.FIELD8_FILTER_VALUE;
                entity.FIELD8_LABEL_MEMBER   = model.FIELD8_LABEL_MEMBER;
                entity.FIELD8_DATA_MEMBER    = model.FIELD8_DATA_MEMBER;
                entity.FIELD8_SYSTEM_CREATED = model.FIELD8_SYSTEM_CREATED;
                entity.FIELD1_FILTER_COLUMN  = model.FIELD1_FILTER_COLUMN;
                entity.FIELD2_FILTER_COLUMN  = model.FIELD2_FILTER_COLUMN;
                entity.FIELD3_FILTER_COLUMN  = model.FIELD3_FILTER_COLUMN;
                entity.FIELD4_FILTER_COLUMN  = model.FIELD4_FILTER_COLUMN;
                entity.FIELD5_FILTER_COLUMN  = model.FIELD5_FILTER_COLUMN;
                entity.FIELD6_FILTER_COLUMN  = model.FIELD6_FILTER_COLUMN;
                entity.FIELD7_FILTER_COLUMN  = model.FIELD7_FILTER_COLUMN;
                entity.FIELD8_FILTER_COLUMN  = model.FIELD8_FILTER_COLUMN;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.GENERIC.GENERIC_CONFIG_HEADER_MODEL);
                Type typeE = typeof(Apps.Models.GENERIC_CONFIG_HEADER);
                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);
        }
Example #2
0
        public virtual Apps.Models.SCV.GENERIC.GENERIC_CONFIG_HEADER_MODEL GetById(string id)
        {
            Apps.Models.GENERIC_CONFIG_HEADER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //GENERIC_CONFIG_HEADER entity = m_Rep.GetById(id);
                Apps.Models.SCV.GENERIC.GENERIC_CONFIG_HEADER_MODEL model = new Apps.Models.SCV.GENERIC.GENERIC_CONFIG_HEADER_MODEL();
                model.RECORD_TYPE           = entity.RECORD_TYPE;
                model.DESCRIPTION           = entity.DESCRIPTION;
                model.FUNCTION_GROUP        = entity.FUNCTION_GROUP;
                model.SYSTEM_CREATED        = entity.SYSTEM_CREATED;
                model.USER_STAMP            = entity.USER_STAMP;
                model.DATE_TIME_STAMP       = entity.DATE_TIME_STAMP;
                model.OBJECT_ID             = entity.OBJECT_ID;
                model.FIELD1_NAME           = entity.FIELD1_NAME;
                model.FIELD1_TYPE           = entity.FIELD1_TYPE;
                model.FIELD1_REQUIRED       = entity.FIELD1_REQUIRED;
                model.FIELD2_NAME           = entity.FIELD2_NAME;
                model.FIELD2_TYPE           = entity.FIELD2_TYPE;
                model.FIELD2_REQUIRED       = entity.FIELD2_REQUIRED;
                model.FIELD3_NAME           = entity.FIELD3_NAME;
                model.FIELD3_TYPE           = entity.FIELD3_TYPE;
                model.FIELD3_REQUIRED       = entity.FIELD3_REQUIRED;
                model.FIELD4_NAME           = entity.FIELD4_NAME;
                model.FIELD4_TYPE           = entity.FIELD4_TYPE;
                model.FIELD4_REQUIRED       = entity.FIELD4_REQUIRED;
                model.FIELD5_NAME           = entity.FIELD5_NAME;
                model.FIELD5_TYPE           = entity.FIELD5_TYPE;
                model.FIELD5_REQUIRED       = entity.FIELD5_REQUIRED;
                model.FIELD6_NAME           = entity.FIELD6_NAME;
                model.FIELD6_TYPE           = entity.FIELD6_TYPE;
                model.FIELD6_REQUIRED       = entity.FIELD6_REQUIRED;
                model.FIELD7_NAME           = entity.FIELD7_NAME;
                model.FIELD7_TYPE           = entity.FIELD7_TYPE;
                model.FIELD7_REQUIRED       = entity.FIELD7_REQUIRED;
                model.FIELD8_NAME           = entity.FIELD8_NAME;
                model.FIELD8_TYPE           = entity.FIELD8_TYPE;
                model.FIELD8_REQUIRED       = entity.FIELD8_REQUIRED;
                model.FIELD1_LOOKUP_TABLE   = entity.FIELD1_LOOKUP_TABLE;
                model.FIELD1_FILTER_VALUE   = entity.FIELD1_FILTER_VALUE;
                model.FIELD1_LABEL_MEMBER   = entity.FIELD1_LABEL_MEMBER;
                model.FIELD1_DATA_MEMBER    = entity.FIELD1_DATA_MEMBER;
                model.FIELD1_SYSTEM_CREATED = entity.FIELD1_SYSTEM_CREATED;
                model.FIELD2_LOOKUP_TABLE   = entity.FIELD2_LOOKUP_TABLE;
                model.FIELD2_FILTER_VALUE   = entity.FIELD2_FILTER_VALUE;
                model.FIELD2_LABEL_MEMBER   = entity.FIELD2_LABEL_MEMBER;
                model.FIELD2_DATA_MEMBER    = entity.FIELD2_DATA_MEMBER;
                model.FIELD2_SYSTEM_CREATED = entity.FIELD2_SYSTEM_CREATED;
                model.FIELD3_LOOKUP_TABLE   = entity.FIELD3_LOOKUP_TABLE;
                model.FIELD3_FILTER_VALUE   = entity.FIELD3_FILTER_VALUE;
                model.FIELD3_LABEL_MEMBER   = entity.FIELD3_LABEL_MEMBER;
                model.FIELD3_DATA_MEMBER    = entity.FIELD3_DATA_MEMBER;
                model.FIELD3_SYSTEM_CREATED = entity.FIELD3_SYSTEM_CREATED;
                model.FIELD4_LOOKUP_TABLE   = entity.FIELD4_LOOKUP_TABLE;
                model.FIELD4_FILTER_VALUE   = entity.FIELD4_FILTER_VALUE;
                model.FIELD4_LABEL_MEMBER   = entity.FIELD4_LABEL_MEMBER;
                model.FIELD4_DATA_MEMBER    = entity.FIELD4_DATA_MEMBER;
                model.FIELD4_SYSTEM_CREATED = entity.FIELD4_SYSTEM_CREATED;
                model.FIELD5_LOOKUP_TABLE   = entity.FIELD5_LOOKUP_TABLE;
                model.FIELD5_FILTER_VALUE   = entity.FIELD5_FILTER_VALUE;
                model.FIELD5_LABEL_MEMBER   = entity.FIELD5_LABEL_MEMBER;
                model.FIELD5_DATA_MEMBER    = entity.FIELD5_DATA_MEMBER;
                model.FIELD5_SYSTEM_CREATED = entity.FIELD5_SYSTEM_CREATED;
                model.FIELD6_LOOKUP_TABLE   = entity.FIELD6_LOOKUP_TABLE;
                model.FIELD6_FILTER_VALUE   = entity.FIELD6_FILTER_VALUE;
                model.FIELD6_LABEL_MEMBER   = entity.FIELD6_LABEL_MEMBER;
                model.FIELD6_DATA_MEMBER    = entity.FIELD6_DATA_MEMBER;
                model.FIELD6_SYSTEM_CREATED = entity.FIELD6_SYSTEM_CREATED;
                model.FIELD7_LOOKUP_TABLE   = entity.FIELD7_LOOKUP_TABLE;
                model.FIELD7_FILTER_VALUE   = entity.FIELD7_FILTER_VALUE;
                model.FIELD7_LABEL_MEMBER   = entity.FIELD7_LABEL_MEMBER;
                model.FIELD7_DATA_MEMBER    = entity.FIELD7_DATA_MEMBER;
                model.FIELD7_SYSTEM_CREATED = entity.FIELD7_SYSTEM_CREATED;
                model.FIELD8_LOOKUP_TABLE   = entity.FIELD8_LOOKUP_TABLE;
                model.FIELD8_FILTER_VALUE   = entity.FIELD8_FILTER_VALUE;
                model.FIELD8_LABEL_MEMBER   = entity.FIELD8_LABEL_MEMBER;
                model.FIELD8_DATA_MEMBER    = entity.FIELD8_DATA_MEMBER;
                model.FIELD8_SYSTEM_CREATED = entity.FIELD8_SYSTEM_CREATED;
                model.FIELD1_FILTER_COLUMN  = entity.FIELD1_FILTER_COLUMN;
                model.FIELD2_FILTER_COLUMN  = entity.FIELD2_FILTER_COLUMN;
                model.FIELD3_FILTER_COLUMN  = entity.FIELD3_FILTER_COLUMN;
                model.FIELD4_FILTER_COLUMN  = entity.FIELD4_FILTER_COLUMN;
                model.FIELD5_FILTER_COLUMN  = entity.FIELD5_FILTER_COLUMN;
                model.FIELD6_FILTER_COLUMN  = entity.FIELD6_FILTER_COLUMN;
                model.FIELD7_FILTER_COLUMN  = entity.FIELD7_FILTER_COLUMN;
                model.FIELD8_FILTER_COLUMN  = entity.FIELD8_FILTER_COLUMN;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.GENERIC.GENERIC_CONFIG_HEADER_MODEL model)
        {
            Apps.Models.GENERIC_CONFIG_HEADER entity = m_Rep.GetById(model.RECORD_TYPE);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity                       = new Apps.Models.GENERIC_CONFIG_HEADER();
            entity.RECORD_TYPE           = model.RECORD_TYPE;
            entity.DESCRIPTION           = model.DESCRIPTION;
            entity.FUNCTION_GROUP        = model.FUNCTION_GROUP;
            entity.SYSTEM_CREATED        = model.SYSTEM_CREATED;
            entity.USER_STAMP            = model.USER_STAMP;
            entity.DATE_TIME_STAMP       = model.DATE_TIME_STAMP;
            entity.OBJECT_ID             = model.OBJECT_ID;
            entity.FIELD1_NAME           = model.FIELD1_NAME;
            entity.FIELD1_TYPE           = model.FIELD1_TYPE;
            entity.FIELD1_REQUIRED       = model.FIELD1_REQUIRED;
            entity.FIELD2_NAME           = model.FIELD2_NAME;
            entity.FIELD2_TYPE           = model.FIELD2_TYPE;
            entity.FIELD2_REQUIRED       = model.FIELD2_REQUIRED;
            entity.FIELD3_NAME           = model.FIELD3_NAME;
            entity.FIELD3_TYPE           = model.FIELD3_TYPE;
            entity.FIELD3_REQUIRED       = model.FIELD3_REQUIRED;
            entity.FIELD4_NAME           = model.FIELD4_NAME;
            entity.FIELD4_TYPE           = model.FIELD4_TYPE;
            entity.FIELD4_REQUIRED       = model.FIELD4_REQUIRED;
            entity.FIELD5_NAME           = model.FIELD5_NAME;
            entity.FIELD5_TYPE           = model.FIELD5_TYPE;
            entity.FIELD5_REQUIRED       = model.FIELD5_REQUIRED;
            entity.FIELD6_NAME           = model.FIELD6_NAME;
            entity.FIELD6_TYPE           = model.FIELD6_TYPE;
            entity.FIELD6_REQUIRED       = model.FIELD6_REQUIRED;
            entity.FIELD7_NAME           = model.FIELD7_NAME;
            entity.FIELD7_TYPE           = model.FIELD7_TYPE;
            entity.FIELD7_REQUIRED       = model.FIELD7_REQUIRED;
            entity.FIELD8_NAME           = model.FIELD8_NAME;
            entity.FIELD8_TYPE           = model.FIELD8_TYPE;
            entity.FIELD8_REQUIRED       = model.FIELD8_REQUIRED;
            entity.FIELD1_LOOKUP_TABLE   = model.FIELD1_LOOKUP_TABLE;
            entity.FIELD1_FILTER_VALUE   = model.FIELD1_FILTER_VALUE;
            entity.FIELD1_LABEL_MEMBER   = model.FIELD1_LABEL_MEMBER;
            entity.FIELD1_DATA_MEMBER    = model.FIELD1_DATA_MEMBER;
            entity.FIELD1_SYSTEM_CREATED = model.FIELD1_SYSTEM_CREATED;
            entity.FIELD2_LOOKUP_TABLE   = model.FIELD2_LOOKUP_TABLE;
            entity.FIELD2_FILTER_VALUE   = model.FIELD2_FILTER_VALUE;
            entity.FIELD2_LABEL_MEMBER   = model.FIELD2_LABEL_MEMBER;
            entity.FIELD2_DATA_MEMBER    = model.FIELD2_DATA_MEMBER;
            entity.FIELD2_SYSTEM_CREATED = model.FIELD2_SYSTEM_CREATED;
            entity.FIELD3_LOOKUP_TABLE   = model.FIELD3_LOOKUP_TABLE;
            entity.FIELD3_FILTER_VALUE   = model.FIELD3_FILTER_VALUE;
            entity.FIELD3_LABEL_MEMBER   = model.FIELD3_LABEL_MEMBER;
            entity.FIELD3_DATA_MEMBER    = model.FIELD3_DATA_MEMBER;
            entity.FIELD3_SYSTEM_CREATED = model.FIELD3_SYSTEM_CREATED;
            entity.FIELD4_LOOKUP_TABLE   = model.FIELD4_LOOKUP_TABLE;
            entity.FIELD4_FILTER_VALUE   = model.FIELD4_FILTER_VALUE;
            entity.FIELD4_LABEL_MEMBER   = model.FIELD4_LABEL_MEMBER;
            entity.FIELD4_DATA_MEMBER    = model.FIELD4_DATA_MEMBER;
            entity.FIELD4_SYSTEM_CREATED = model.FIELD4_SYSTEM_CREATED;
            entity.FIELD5_LOOKUP_TABLE   = model.FIELD5_LOOKUP_TABLE;
            entity.FIELD5_FILTER_VALUE   = model.FIELD5_FILTER_VALUE;
            entity.FIELD5_LABEL_MEMBER   = model.FIELD5_LABEL_MEMBER;
            entity.FIELD5_DATA_MEMBER    = model.FIELD5_DATA_MEMBER;
            entity.FIELD5_SYSTEM_CREATED = model.FIELD5_SYSTEM_CREATED;
            entity.FIELD6_LOOKUP_TABLE   = model.FIELD6_LOOKUP_TABLE;
            entity.FIELD6_FILTER_VALUE   = model.FIELD6_FILTER_VALUE;
            entity.FIELD6_LABEL_MEMBER   = model.FIELD6_LABEL_MEMBER;
            entity.FIELD6_DATA_MEMBER    = model.FIELD6_DATA_MEMBER;
            entity.FIELD6_SYSTEM_CREATED = model.FIELD6_SYSTEM_CREATED;
            entity.FIELD7_LOOKUP_TABLE   = model.FIELD7_LOOKUP_TABLE;
            entity.FIELD7_FILTER_VALUE   = model.FIELD7_FILTER_VALUE;
            entity.FIELD7_LABEL_MEMBER   = model.FIELD7_LABEL_MEMBER;
            entity.FIELD7_DATA_MEMBER    = model.FIELD7_DATA_MEMBER;
            entity.FIELD7_SYSTEM_CREATED = model.FIELD7_SYSTEM_CREATED;
            entity.FIELD8_LOOKUP_TABLE   = model.FIELD8_LOOKUP_TABLE;
            entity.FIELD8_FILTER_VALUE   = model.FIELD8_FILTER_VALUE;
            entity.FIELD8_LABEL_MEMBER   = model.FIELD8_LABEL_MEMBER;
            entity.FIELD8_DATA_MEMBER    = model.FIELD8_DATA_MEMBER;
            entity.FIELD8_SYSTEM_CREATED = model.FIELD8_SYSTEM_CREATED;
            entity.FIELD1_FILTER_COLUMN  = model.FIELD1_FILTER_COLUMN;
            entity.FIELD2_FILTER_COLUMN  = model.FIELD2_FILTER_COLUMN;
            entity.FIELD3_FILTER_COLUMN  = model.FIELD3_FILTER_COLUMN;
            entity.FIELD4_FILTER_COLUMN  = model.FIELD4_FILTER_COLUMN;
            entity.FIELD5_FILTER_COLUMN  = model.FIELD5_FILTER_COLUMN;
            entity.FIELD6_FILTER_COLUMN  = model.FIELD6_FILTER_COLUMN;
            entity.FIELD7_FILTER_COLUMN  = model.FIELD7_FILTER_COLUMN;
            entity.FIELD8_FILTER_COLUMN  = model.FIELD8_FILTER_COLUMN;

            m_Rep.Create(entity);
        }