public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.WAREHOUSE.WAREHOUSE_ISSUE_MODEL model, params string[] updateProperties)
        {
            Apps.Models.WAREHOUSE_ISSUE 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.WAREHOUSE        = model.WAREHOUSE;
                entity.COMPANY          = model.COMPANY;
                entity.ISSUE_TYPE       = model.ISSUE_TYPE;
                entity.ISSUE_DESC       = model.ISSUE_DESC;
                entity.STATUS           = model.STATUS;
                entity.WORKBENCH        = model.WORKBENCH;
                entity.REFERENCE_NUM1   = model.REFERENCE_NUM1;
                entity.REFERENCE_ID1    = model.REFERENCE_ID1;
                entity.REFERENCE_TYPE1  = model.REFERENCE_TYPE1;
                entity.REFERENCE_NUM2   = model.REFERENCE_NUM2;
                entity.REFERENCE_ID2    = model.REFERENCE_ID2;
                entity.REFERENCE_TYPE2  = model.REFERENCE_TYPE2;
                entity.REFERENCE_NUM3   = model.REFERENCE_NUM3;
                entity.REFERENCE_ID3    = model.REFERENCE_ID3;
                entity.REFERENCE_TYPE3  = model.REFERENCE_TYPE3;
                entity.REFERENCE_NUM4   = model.REFERENCE_NUM4;
                entity.REFERENCE_ID4    = model.REFERENCE_ID4;
                entity.REFERENCE_TYPE4  = model.REFERENCE_TYPE4;
                entity.REFERENCE_STATUS = model.REFERENCE_STATUS;
                entity.CREATE_USER      = model.CREATE_USER;
                entity.CREATE_DATE_TIME = model.CREATE_DATE_TIME;
                entity.USER_STAMP       = model.USER_STAMP;
                entity.DATE_TIME_STAMP  = model.DATE_TIME_STAMP;
                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;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.WAREHOUSE.WAREHOUSE_ISSUE_MODEL);
                Type typeE = typeof(Apps.Models.WAREHOUSE_ISSUE);
                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.WAREHOUSE.WAREHOUSE_ISSUE_MODEL GetById(string id)
        {
            Apps.Models.WAREHOUSE_ISSUE entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //WAREHOUSE_ISSUE entity = m_Rep.GetById(id);
                Apps.Models.SCV.WAREHOUSE.WAREHOUSE_ISSUE_MODEL model = new Apps.Models.SCV.WAREHOUSE.WAREHOUSE_ISSUE_MODEL();
                model.INTERNAL_NUM     = entity.INTERNAL_NUM;
                model.WAREHOUSE        = entity.WAREHOUSE;
                model.COMPANY          = entity.COMPANY;
                model.ISSUE_TYPE       = entity.ISSUE_TYPE;
                model.ISSUE_DESC       = entity.ISSUE_DESC;
                model.STATUS           = entity.STATUS;
                model.WORKBENCH        = entity.WORKBENCH;
                model.REFERENCE_NUM1   = entity.REFERENCE_NUM1;
                model.REFERENCE_ID1    = entity.REFERENCE_ID1;
                model.REFERENCE_TYPE1  = entity.REFERENCE_TYPE1;
                model.REFERENCE_NUM2   = entity.REFERENCE_NUM2;
                model.REFERENCE_ID2    = entity.REFERENCE_ID2;
                model.REFERENCE_TYPE2  = entity.REFERENCE_TYPE2;
                model.REFERENCE_NUM3   = entity.REFERENCE_NUM3;
                model.REFERENCE_ID3    = entity.REFERENCE_ID3;
                model.REFERENCE_TYPE3  = entity.REFERENCE_TYPE3;
                model.REFERENCE_NUM4   = entity.REFERENCE_NUM4;
                model.REFERENCE_ID4    = entity.REFERENCE_ID4;
                model.REFERENCE_TYPE4  = entity.REFERENCE_TYPE4;
                model.REFERENCE_STATUS = entity.REFERENCE_STATUS;
                model.CREATE_USER      = entity.CREATE_USER;
                model.CREATE_DATE_TIME = entity.CREATE_DATE_TIME;
                model.USER_STAMP       = entity.USER_STAMP;
                model.DATE_TIME_STAMP  = entity.DATE_TIME_STAMP;
                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;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.WAREHOUSE.WAREHOUSE_ISSUE_MODEL model)
        {
            Apps.Models.WAREHOUSE_ISSUE entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.WAREHOUSE_ISSUE();
            entity.INTERNAL_NUM     = model.INTERNAL_NUM;
            entity.WAREHOUSE        = model.WAREHOUSE;
            entity.COMPANY          = model.COMPANY;
            entity.ISSUE_TYPE       = model.ISSUE_TYPE;
            entity.ISSUE_DESC       = model.ISSUE_DESC;
            entity.STATUS           = model.STATUS;
            entity.WORKBENCH        = model.WORKBENCH;
            entity.REFERENCE_NUM1   = model.REFERENCE_NUM1;
            entity.REFERENCE_ID1    = model.REFERENCE_ID1;
            entity.REFERENCE_TYPE1  = model.REFERENCE_TYPE1;
            entity.REFERENCE_NUM2   = model.REFERENCE_NUM2;
            entity.REFERENCE_ID2    = model.REFERENCE_ID2;
            entity.REFERENCE_TYPE2  = model.REFERENCE_TYPE2;
            entity.REFERENCE_NUM3   = model.REFERENCE_NUM3;
            entity.REFERENCE_ID3    = model.REFERENCE_ID3;
            entity.REFERENCE_TYPE3  = model.REFERENCE_TYPE3;
            entity.REFERENCE_NUM4   = model.REFERENCE_NUM4;
            entity.REFERENCE_ID4    = model.REFERENCE_ID4;
            entity.REFERENCE_TYPE4  = model.REFERENCE_TYPE4;
            entity.REFERENCE_STATUS = model.REFERENCE_STATUS;
            entity.CREATE_USER      = model.CREATE_USER;
            entity.CREATE_DATE_TIME = model.CREATE_DATE_TIME;
            entity.USER_STAMP       = model.USER_STAMP;
            entity.DATE_TIME_STAMP  = model.DATE_TIME_STAMP;
            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;

            m_Rep.Create(entity);
        }