public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEMS_MODEL model, params string[] updateProperties)
        {
            Apps.Models.DOWNLOAD_ITEMS entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
                entity.INTERFACE_ACTION_CODE = model.INTERFACE_ACTION_CODE;
                entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
                entity.PROCESS_STAMP         = model.PROCESS_STAMP;
                entity.COMPANY         = model.COMPANY;
                entity.ITEM            = model.ITEM;
                entity.ITEM_DESC       = model.ITEM_DESC;
                entity.ATTRIBUTE_TRACK = model.ATTRIBUTE_TRACK;
                entity.ITEM_STYLE      = model.ITEM_STYLE;
                entity.DEPARTMENT      = model.DEPARTMENT;
                entity.ITEM_CATEGORY1  = model.ITEM_CATEGORY1;
                entity.ITEM_CATEGORY2  = model.ITEM_CATEGORY2;
                entity.ITEM_CATEGORY3  = model.ITEM_CATEGORY3;
                entity.ITEM_CATEGORY4  = model.ITEM_CATEGORY4;
                entity.ITEM_CATEGORY5  = model.ITEM_CATEGORY5;
                entity.ITEM_CATEGORY6  = model.ITEM_CATEGORY6;
                entity.ITEM_CATEGORY7  = model.ITEM_CATEGORY7;
                entity.ITEM_CATEGORY8  = model.ITEM_CATEGORY8;
                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;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEMS_MODEL);
                Type typeE = typeof(Apps.Models.DOWNLOAD_ITEMS);
                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.DOWNLOAD.DOWNLOAD_ITEMS_MODEL GetById(string id)
        {
            Apps.Models.DOWNLOAD_ITEMS entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //DOWNLOAD_ITEMS entity = m_Rep.GetById(id);
                Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEMS_MODEL model = new Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEMS_MODEL();
                model.INTERFACE_RECORD_ID   = entity.INTERFACE_RECORD_ID;
                model.INTERFACE_ACTION_CODE = entity.INTERFACE_ACTION_CODE;
                model.INTERFACE_CONDITION   = entity.INTERFACE_CONDITION;
                model.PROCESS_STAMP         = entity.PROCESS_STAMP;
                model.COMPANY         = entity.COMPANY;
                model.ITEM            = entity.ITEM;
                model.ITEM_DESC       = entity.ITEM_DESC;
                model.ATTRIBUTE_TRACK = entity.ATTRIBUTE_TRACK;
                model.ITEM_STYLE      = entity.ITEM_STYLE;
                model.DEPARTMENT      = entity.DEPARTMENT;
                model.ITEM_CATEGORY1  = entity.ITEM_CATEGORY1;
                model.ITEM_CATEGORY2  = entity.ITEM_CATEGORY2;
                model.ITEM_CATEGORY3  = entity.ITEM_CATEGORY3;
                model.ITEM_CATEGORY4  = entity.ITEM_CATEGORY4;
                model.ITEM_CATEGORY5  = entity.ITEM_CATEGORY5;
                model.ITEM_CATEGORY6  = entity.ITEM_CATEGORY6;
                model.ITEM_CATEGORY7  = entity.ITEM_CATEGORY7;
                model.ITEM_CATEGORY8  = entity.ITEM_CATEGORY8;
                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;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEMS_MODEL model)
        {
            Apps.Models.DOWNLOAD_ITEMS entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.DOWNLOAD_ITEMS();
            entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
            entity.INTERFACE_ACTION_CODE = model.INTERFACE_ACTION_CODE;
            entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
            entity.PROCESS_STAMP         = model.PROCESS_STAMP;
            entity.COMPANY         = model.COMPANY;
            entity.ITEM            = model.ITEM;
            entity.ITEM_DESC       = model.ITEM_DESC;
            entity.ATTRIBUTE_TRACK = model.ATTRIBUTE_TRACK;
            entity.ITEM_STYLE      = model.ITEM_STYLE;
            entity.DEPARTMENT      = model.DEPARTMENT;
            entity.ITEM_CATEGORY1  = model.ITEM_CATEGORY1;
            entity.ITEM_CATEGORY2  = model.ITEM_CATEGORY2;
            entity.ITEM_CATEGORY3  = model.ITEM_CATEGORY3;
            entity.ITEM_CATEGORY4  = model.ITEM_CATEGORY4;
            entity.ITEM_CATEGORY5  = model.ITEM_CATEGORY5;
            entity.ITEM_CATEGORY6  = model.ITEM_CATEGORY6;
            entity.ITEM_CATEGORY7  = model.ITEM_CATEGORY7;
            entity.ITEM_CATEGORY8  = model.ITEM_CATEGORY8;
            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;

            m_Rep.Create(entity);
        }