public virtual Apps.Models.SCV.ITEM.ITEM_LOCATION_CAPACITY_MODEL GetById(string id)
        {
            Apps.Models.ITEM_LOCATION_CAPACITY entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //ITEM_LOCATION_CAPACITY entity = m_Rep.GetById(id);
                Apps.Models.SCV.ITEM.ITEM_LOCATION_CAPACITY_MODEL model = new Apps.Models.SCV.ITEM.ITEM_LOCATION_CAPACITY_MODEL();
                model.WAREHOUSE = entity.WAREHOUSE;
                model.INTERNAL_ITEM_CAPACITY_NUM = entity.INTERNAL_ITEM_CAPACITY_NUM;
                model.COMPANY          = entity.COMPANY;
                model.ITEM             = entity.ITEM;
                model.ITEM_CLASS       = entity.ITEM_CLASS;
                model.LOCATION         = entity.LOCATION;
                model.LOCATION_TYPE    = entity.LOCATION_TYPE;
                model.MAXIMUM_QTY      = entity.MAXIMUM_QTY;
                model.QUANTITY_UM      = entity.QUANTITY_UM;
                model.MINIMUM_RPLN_PCT = entity.MINIMUM_RPLN_PCT;
                model.USER_STAMP       = entity.USER_STAMP;
                model.DATE_TIME_STAMP  = entity.DATE_TIME_STAMP;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.ITEM.ITEM_LOCATION_CAPACITY_MODEL model, params string[] updateProperties)
        {
            Apps.Models.ITEM_LOCATION_CAPACITY entity = m_Rep.GetById(model.WAREHOUSE);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.WAREHOUSE = model.WAREHOUSE;
                entity.INTERNAL_ITEM_CAPACITY_NUM = model.INTERNAL_ITEM_CAPACITY_NUM;
                entity.COMPANY          = model.COMPANY;
                entity.ITEM             = model.ITEM;
                entity.ITEM_CLASS       = model.ITEM_CLASS;
                entity.LOCATION         = model.LOCATION;
                entity.LOCATION_TYPE    = model.LOCATION_TYPE;
                entity.MAXIMUM_QTY      = model.MAXIMUM_QTY;
                entity.QUANTITY_UM      = model.QUANTITY_UM;
                entity.MINIMUM_RPLN_PCT = model.MINIMUM_RPLN_PCT;
                entity.USER_STAMP       = model.USER_STAMP;
                entity.DATE_TIME_STAMP  = model.DATE_TIME_STAMP;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.ITEM.ITEM_LOCATION_CAPACITY_MODEL);
                Type typeE = typeof(Apps.Models.ITEM_LOCATION_CAPACITY);
                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.ITEM.ITEM_LOCATION_CAPACITY_MODEL model)
        {
            Apps.Models.ITEM_LOCATION_CAPACITY entity = m_Rep.GetById(model.WAREHOUSE);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity           = new Apps.Models.ITEM_LOCATION_CAPACITY();
            entity.WAREHOUSE = model.WAREHOUSE;
            entity.INTERNAL_ITEM_CAPACITY_NUM = model.INTERNAL_ITEM_CAPACITY_NUM;
            entity.COMPANY          = model.COMPANY;
            entity.ITEM             = model.ITEM;
            entity.ITEM_CLASS       = model.ITEM_CLASS;
            entity.LOCATION         = model.LOCATION;
            entity.LOCATION_TYPE    = model.LOCATION_TYPE;
            entity.MAXIMUM_QTY      = model.MAXIMUM_QTY;
            entity.QUANTITY_UM      = model.QUANTITY_UM;
            entity.MINIMUM_RPLN_PCT = model.MINIMUM_RPLN_PCT;
            entity.USER_STAMP       = model.USER_STAMP;
            entity.DATE_TIME_STAMP  = model.DATE_TIME_STAMP;

            m_Rep.Create(entity);
        }