Ejemplo n.º 1
0
        public virtual Apps.Models.SCV.SECURITY.SECURITY_FUNCTION_bak_MODEL GetById(string id)
        {
            Apps.Models.SECURITY_FUNCTION_bak entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //SECURITY_FUNCTION_bak entity = m_Rep.GetById(id);
                Apps.Models.SCV.SECURITY.SECURITY_FUNCTION_bak_MODEL model = new Apps.Models.SCV.SECURITY.SECURITY_FUNCTION_bak_MODEL();
                model.INTERNAL_NUM       = entity.INTERNAL_NUM;
                model.FUNCTION_ID        = entity.FUNCTION_ID;
                model.FUNCTION_NAME      = entity.FUNCTION_NAME;
                model.FUNCTION_TYPE      = entity.FUNCTION_TYPE;
                model.PARENT_FUNCTION_ID = entity.PARENT_FUNCTION_ID;
                model.URI             = entity.URI;
                model.ICON            = entity.ICON;
                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.USER_STAMP      = entity.USER_STAMP;
                model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP;
                model.TYPE            = entity.TYPE;
                model.SEQUENCE        = entity.SEQUENCE;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.SECURITY.SECURITY_FUNCTION_bak_MODEL model)
        {
            Apps.Models.SECURITY_FUNCTION_bak entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.SECURITY_FUNCTION_bak();
            entity.INTERNAL_NUM       = model.INTERNAL_NUM;
            entity.FUNCTION_ID        = model.FUNCTION_ID;
            entity.FUNCTION_NAME      = model.FUNCTION_NAME;
            entity.FUNCTION_TYPE      = model.FUNCTION_TYPE;
            entity.PARENT_FUNCTION_ID = model.PARENT_FUNCTION_ID;
            entity.URI             = model.URI;
            entity.ICON            = model.ICON;
            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.USER_STAMP      = model.USER_STAMP;
            entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP;
            entity.TYPE            = model.TYPE;
            entity.SEQUENCE        = model.SEQUENCE;

            m_Rep.Create(entity);
        }
Ejemplo n.º 3
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.SECURITY.SECURITY_FUNCTION_bak_MODEL model, params string[] updateProperties)
        {
            Apps.Models.SECURITY_FUNCTION_bak entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_NUM       = model.INTERNAL_NUM;
                entity.FUNCTION_ID        = model.FUNCTION_ID;
                entity.FUNCTION_NAME      = model.FUNCTION_NAME;
                entity.FUNCTION_TYPE      = model.FUNCTION_TYPE;
                entity.PARENT_FUNCTION_ID = model.PARENT_FUNCTION_ID;
                entity.URI             = model.URI;
                entity.ICON            = model.ICON;
                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.USER_STAMP      = model.USER_STAMP;
                entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP;
                entity.TYPE            = model.TYPE;
                entity.SEQUENCE        = model.SEQUENCE;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.SECURITY.SECURITY_FUNCTION_bak_MODEL);
                Type typeE = typeof(Apps.Models.SECURITY_FUNCTION_bak);
                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);
        }