public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.ALLOCATION.ALLOCATION_RULE_HEADER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.ALLOCATION_RULE_HEADER entity = m_Rep.GetById(model.ALLOCATION_RULE);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.ALLOCATION_RULE = model.ALLOCATION_RULE;
                entity.DESCRIPTION     = model.DESCRIPTION;
                entity.ACTIVE          = model.ACTIVE;
                entity.OBJECT_ID       = model.OBJECT_ID;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.ALLOCATION.ALLOCATION_RULE_HEADER_MODEL);
                Type typeE = typeof(Apps.Models.ALLOCATION_RULE_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);
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.ALLOCATION.ALLOCATION_RULE_HEADER_MODEL model)
        {
            Apps.Models.ALLOCATION_RULE_HEADER entity = m_Rep.GetById(model.ALLOCATION_RULE);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.ALLOCATION_RULE_HEADER();
            entity.ALLOCATION_RULE = model.ALLOCATION_RULE;
            entity.DESCRIPTION     = model.DESCRIPTION;
            entity.ACTIVE          = model.ACTIVE;
            entity.OBJECT_ID       = model.OBJECT_ID;

            m_Rep.Create(entity);
        }
        public virtual Apps.Models.SCV.ALLOCATION.ALLOCATION_RULE_HEADER_MODEL GetById(string id)
        {
            Apps.Models.ALLOCATION_RULE_HEADER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //ALLOCATION_RULE_HEADER entity = m_Rep.GetById(id);
                Apps.Models.SCV.ALLOCATION.ALLOCATION_RULE_HEADER_MODEL model = new Apps.Models.SCV.ALLOCATION.ALLOCATION_RULE_HEADER_MODEL();
                model.ALLOCATION_RULE = entity.ALLOCATION_RULE;
                model.DESCRIPTION     = entity.DESCRIPTION;
                model.ACTIVE          = entity.ACTIVE;
                model.OBJECT_ID       = entity.OBJECT_ID;

                return(model);
            }
            else
            {
                return(null);
            }
        }