예제 #1
0
        public virtual Apps.Models.SCV.GENERIC.GENERIC_CONFIG_DETAIL_MODEL GetById(string id)
        {
            Apps.Models.GENERIC_CONFIG_DETAIL entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //GENERIC_CONFIG_DETAIL entity = m_Rep.GetById(id);
                Apps.Models.SCV.GENERIC.GENERIC_CONFIG_DETAIL_MODEL model = new Apps.Models.SCV.GENERIC.GENERIC_CONFIG_DETAIL_MODEL();
                model.RECORD_TYPE     = entity.RECORD_TYPE;
                model.IDENTIFIER      = entity.IDENTIFIER;
                model.SEQUENCE        = entity.SEQUENCE;
                model.DESCRIPTION     = entity.DESCRIPTION;
                model.SYSTEM_CREATED  = entity.SYSTEM_CREATED;
                model.VALUE1          = entity.VALUE1;
                model.VALUE2          = entity.VALUE2;
                model.VALUE3          = entity.VALUE3;
                model.VALUE4          = entity.VALUE4;
                model.VALUE5          = entity.VALUE5;
                model.VALUE6          = entity.VALUE6;
                model.VALUE7          = entity.VALUE7;
                model.VALUE8          = entity.VALUE8;
                model.ACTIVE          = entity.ACTIVE;
                model.USER_STAMP      = entity.USER_STAMP;
                model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP;
                model.OBJECT_ID       = entity.OBJECT_ID;

                return(model);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.GENERIC.GENERIC_CONFIG_DETAIL_MODEL model)
        {
            Apps.Models.GENERIC_CONFIG_DETAIL entity = m_Rep.GetById(model.RECORD_TYPE);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity                 = new Apps.Models.GENERIC_CONFIG_DETAIL();
            entity.RECORD_TYPE     = model.RECORD_TYPE;
            entity.IDENTIFIER      = model.IDENTIFIER;
            entity.SEQUENCE        = model.SEQUENCE;
            entity.DESCRIPTION     = model.DESCRIPTION;
            entity.SYSTEM_CREATED  = model.SYSTEM_CREATED;
            entity.VALUE1          = model.VALUE1;
            entity.VALUE2          = model.VALUE2;
            entity.VALUE3          = model.VALUE3;
            entity.VALUE4          = model.VALUE4;
            entity.VALUE5          = model.VALUE5;
            entity.VALUE6          = model.VALUE6;
            entity.VALUE7          = model.VALUE7;
            entity.VALUE8          = model.VALUE8;
            entity.ACTIVE          = model.ACTIVE;
            entity.USER_STAMP      = model.USER_STAMP;
            entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP;
            entity.OBJECT_ID       = model.OBJECT_ID;

            m_Rep.Create(entity);
        }
예제 #3
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.GENERIC.GENERIC_CONFIG_DETAIL_MODEL model, params string[] updateProperties)
        {
            Apps.Models.GENERIC_CONFIG_DETAIL 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.IDENTIFIER      = model.IDENTIFIER;
                entity.SEQUENCE        = model.SEQUENCE;
                entity.DESCRIPTION     = model.DESCRIPTION;
                entity.SYSTEM_CREATED  = model.SYSTEM_CREATED;
                entity.VALUE1          = model.VALUE1;
                entity.VALUE2          = model.VALUE2;
                entity.VALUE3          = model.VALUE3;
                entity.VALUE4          = model.VALUE4;
                entity.VALUE5          = model.VALUE5;
                entity.VALUE6          = model.VALUE6;
                entity.VALUE7          = model.VALUE7;
                entity.VALUE8          = model.VALUE8;
                entity.ACTIVE          = model.ACTIVE;
                entity.USER_STAMP      = model.USER_STAMP;
                entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP;
                entity.OBJECT_ID       = model.OBJECT_ID;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.GENERIC.GENERIC_CONFIG_DETAIL_MODEL);
                Type typeE = typeof(Apps.Models.GENERIC_CONFIG_DETAIL);
                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);
        }