public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.CYCLE.CYCLE_COUNT_HEADER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.CYCLE_COUNT_HEADER entity = m_Rep.GetById(model.INTERNAL_CYCLE_COUNT_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_CYCLE_COUNT_NUM = model.INTERNAL_CYCLE_COUNT_NUM;
                entity.ORIGINAL_CYCLE_COUNT_NUM = model.ORIGINAL_CYCLE_COUNT_NUM;
                entity.ROUND                   = model.ROUND;
                entity.MASTER_ID               = model.MASTER_ID;
                entity.COUNT_TYPE              = model.COUNT_TYPE;
                entity.CONDITION               = model.CONDITION;
                entity.COUNT_ATTRIBUTE         = model.COUNT_ATTRIBUTE;
                entity.REFERENCE_ID            = model.REFERENCE_ID;
                entity.REMARK                  = model.REMARK;
                entity.TOTAL_LOCS              = model.TOTAL_LOCS;
                entity.TOTAL_ITEMS             = model.TOTAL_ITEMS;
                entity.INVENTORY_STSES         = model.INVENTORY_STSES;
                entity.ITEMS                   = model.ITEMS;
                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.CREATED_USER            = model.CREATED_USER;
                entity.CREATED_DATE_TIME       = model.CREATED_DATE_TIME;
                entity.RELEASED_USER           = model.RELEASED_USER;
                entity.RELEASED_DATE_TIME      = model.RELEASED_DATE_TIME;
                entity.CLOSED_USER             = model.CLOSED_USER;
                entity.CLOSED_DATE_TIME        = model.CLOSED_DATE_TIME;
                entity.LAST_MODIFIED_USER      = model.LAST_MODIFIED_USER;
                entity.LAST_MODIFIED_DATE_TIME = model.LAST_MODIFIED_DATE_TIME;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.CYCLE.CYCLE_COUNT_HEADER_MODEL);
                Type typeE = typeof(Apps.Models.CYCLE_COUNT_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 Apps.Models.SCV.CYCLE.CYCLE_COUNT_HEADER_MODEL GetById(string id)
        {
            Apps.Models.CYCLE_COUNT_HEADER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //CYCLE_COUNT_HEADER entity = m_Rep.GetById(id);
                Apps.Models.SCV.CYCLE.CYCLE_COUNT_HEADER_MODEL model = new Apps.Models.SCV.CYCLE.CYCLE_COUNT_HEADER_MODEL();
                model.INTERNAL_CYCLE_COUNT_NUM = entity.INTERNAL_CYCLE_COUNT_NUM;
                model.ORIGINAL_CYCLE_COUNT_NUM = entity.ORIGINAL_CYCLE_COUNT_NUM;
                model.ROUND                   = entity.ROUND;
                model.MASTER_ID               = entity.MASTER_ID;
                model.COUNT_TYPE              = entity.COUNT_TYPE;
                model.CONDITION               = entity.CONDITION;
                model.COUNT_ATTRIBUTE         = entity.COUNT_ATTRIBUTE;
                model.REFERENCE_ID            = entity.REFERENCE_ID;
                model.REMARK                  = entity.REMARK;
                model.TOTAL_LOCS              = entity.TOTAL_LOCS;
                model.TOTAL_ITEMS             = entity.TOTAL_ITEMS;
                model.INVENTORY_STSES         = entity.INVENTORY_STSES;
                model.ITEMS                   = entity.ITEMS;
                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.CREATED_USER            = entity.CREATED_USER;
                model.CREATED_DATE_TIME       = entity.CREATED_DATE_TIME;
                model.RELEASED_USER           = entity.RELEASED_USER;
                model.RELEASED_DATE_TIME      = entity.RELEASED_DATE_TIME;
                model.CLOSED_USER             = entity.CLOSED_USER;
                model.CLOSED_DATE_TIME        = entity.CLOSED_DATE_TIME;
                model.LAST_MODIFIED_USER      = entity.LAST_MODIFIED_USER;
                model.LAST_MODIFIED_DATE_TIME = entity.LAST_MODIFIED_DATE_TIME;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.CYCLE.CYCLE_COUNT_HEADER_MODEL model)
        {
            Apps.Models.CYCLE_COUNT_HEADER entity = m_Rep.GetById(model.INTERNAL_CYCLE_COUNT_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.CYCLE_COUNT_HEADER();
            entity.INTERNAL_CYCLE_COUNT_NUM = model.INTERNAL_CYCLE_COUNT_NUM;
            entity.ORIGINAL_CYCLE_COUNT_NUM = model.ORIGINAL_CYCLE_COUNT_NUM;
            entity.ROUND                   = model.ROUND;
            entity.MASTER_ID               = model.MASTER_ID;
            entity.COUNT_TYPE              = model.COUNT_TYPE;
            entity.CONDITION               = model.CONDITION;
            entity.COUNT_ATTRIBUTE         = model.COUNT_ATTRIBUTE;
            entity.REFERENCE_ID            = model.REFERENCE_ID;
            entity.REMARK                  = model.REMARK;
            entity.TOTAL_LOCS              = model.TOTAL_LOCS;
            entity.TOTAL_ITEMS             = model.TOTAL_ITEMS;
            entity.INVENTORY_STSES         = model.INVENTORY_STSES;
            entity.ITEMS                   = model.ITEMS;
            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.CREATED_USER            = model.CREATED_USER;
            entity.CREATED_DATE_TIME       = model.CREATED_DATE_TIME;
            entity.RELEASED_USER           = model.RELEASED_USER;
            entity.RELEASED_DATE_TIME      = model.RELEASED_DATE_TIME;
            entity.CLOSED_USER             = model.CLOSED_USER;
            entity.CLOSED_DATE_TIME        = model.CLOSED_DATE_TIME;
            entity.LAST_MODIFIED_USER      = model.LAST_MODIFIED_USER;
            entity.LAST_MODIFIED_DATE_TIME = model.LAST_MODIFIED_DATE_TIME;

            m_Rep.Create(entity);
        }