public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.SHIPMENT.SHIPMENT_ALLOC_REQUEST_MODEL model, params string[] updateProperties)
        {
            Apps.Models.SHIPMENT_ALLOC_REQUEST entity = m_Rep.GetById(model.INTERNAL_SHIP_ALLOC_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_SHIP_ALLOC_NUM    = model.INTERNAL_SHIP_ALLOC_NUM;
                entity.INTERNAL_SHIPMENT_LINE_NUM = model.INTERNAL_SHIPMENT_LINE_NUM;
                entity.INTERNAL_SHIPMENT_NUM      = model.INTERNAL_SHIPMENT_NUM;
                entity.SHIPMENT_ID         = model.SHIPMENT_ID;
                entity.SHIPMENT_TYPE       = model.SHIPMENT_TYPE;
                entity.PRIORITY            = model.PRIORITY;
                entity.WAREHOUSE           = model.WAREHOUSE;
                entity.ITEM                = model.ITEM;
                entity.COMPANY             = model.COMPANY;
                entity.ITEM_DESC           = model.ITEM_DESC;
                entity.REQUESTED_QTY       = model.REQUESTED_QTY;
                entity.ALLOCATED_QTY       = model.ALLOCATED_QTY;
                entity.QUANTITY_UM         = model.QUANTITY_UM;
                entity.ATTRIBUTE_NUM       = model.ATTRIBUTE_NUM;
                entity.FROM_LOC            = model.FROM_LOC;
                entity.TO_LOC              = model.TO_LOC;
                entity.FROM_ZONE           = model.FROM_ZONE;
                entity.TO_ZONE             = model.TO_ZONE;
                entity.FROM_LPN            = model.FROM_LPN;
                entity.FROM_PARENT_LPN     = model.FROM_PARENT_LPN;
                entity.CUSTOMER            = model.CUSTOMER;
                entity.SHIP_TO             = model.SHIP_TO;
                entity.INTERNAL_WAVE_NUM   = model.INTERNAL_WAVE_NUM;
                entity.PACKING_CLASS       = model.PACKING_CLASS;
                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;
                entity.CONVERTED_ALLOC_QTY = model.CONVERTED_ALLOC_QTY;
                entity.CONVERTED_QTY_UM    = model.CONVERTED_QTY_UM;
                entity.FROM_TEMPL_FIELD1   = model.FROM_TEMPL_FIELD1;
                entity.FROM_TEMPL_FIELD2   = model.FROM_TEMPL_FIELD2;
                entity.FROM_TEMPL_FIELD3   = model.FROM_TEMPL_FIELD3;
                entity.FROM_TEMPL_FIELD4   = model.FROM_TEMPL_FIELD4;
                entity.FROM_TEMPL_FIELD5   = model.FROM_TEMPL_FIELD5;
                entity.TO_TEMPL_FIELD1     = model.TO_TEMPL_FIELD1;
                entity.TO_TEMPL_FIELD2     = model.TO_TEMPL_FIELD2;
                entity.TO_TEMPL_FIELD3     = model.TO_TEMPL_FIELD3;
                entity.TO_TEMPL_FIELD4     = model.TO_TEMPL_FIELD4;
                entity.TO_TEMPL_FIELD5     = model.TO_TEMPL_FIELD5;
                entity.TASK_CREATED        = model.TASK_CREATED;
                entity.TREAT_AS_LOOSE      = model.TREAT_AS_LOOSE;
                entity.INVENTORY_STS       = model.INVENTORY_STS;
                entity.REPLENISHMENT_REQD  = model.REPLENISHMENT_REQD;
                entity.CONTAINER_WEIGHT    = model.CONTAINER_WEIGHT;
                entity.CONTAINER_HEIGHT    = model.CONTAINER_HEIGHT;
                entity.CONTAINER_WIDTH     = model.CONTAINER_WIDTH;
                entity.CONTAINER_LENGTH    = model.CONTAINER_LENGTH;
                entity.DIMENSION_UM        = model.DIMENSION_UM;
                entity.WEIGHT_UM           = model.WEIGHT_UM;
                entity.ITEM_LENGTH         = model.ITEM_LENGTH;
                entity.ITEM_WIDTH          = model.ITEM_WIDTH;
                entity.ITEM_HEIGHT         = model.ITEM_HEIGHT;
                entity.ITEM_WEIGHT         = model.ITEM_WEIGHT;
                entity.BIG_ZONE            = model.BIG_ZONE;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.SHIPMENT.SHIPMENT_ALLOC_REQUEST_MODEL);
                Type typeE = typeof(Apps.Models.SHIPMENT_ALLOC_REQUEST);
                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.SHIPMENT.SHIPMENT_ALLOC_REQUEST_MODEL GetById(string id)
        {
            Apps.Models.SHIPMENT_ALLOC_REQUEST entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //SHIPMENT_ALLOC_REQUEST entity = m_Rep.GetById(id);
                Apps.Models.SCV.SHIPMENT.SHIPMENT_ALLOC_REQUEST_MODEL model = new Apps.Models.SCV.SHIPMENT.SHIPMENT_ALLOC_REQUEST_MODEL();
                model.INTERNAL_SHIP_ALLOC_NUM    = entity.INTERNAL_SHIP_ALLOC_NUM;
                model.INTERNAL_SHIPMENT_LINE_NUM = entity.INTERNAL_SHIPMENT_LINE_NUM;
                model.INTERNAL_SHIPMENT_NUM      = entity.INTERNAL_SHIPMENT_NUM;
                model.SHIPMENT_ID         = entity.SHIPMENT_ID;
                model.SHIPMENT_TYPE       = entity.SHIPMENT_TYPE;
                model.PRIORITY            = entity.PRIORITY;
                model.WAREHOUSE           = entity.WAREHOUSE;
                model.ITEM                = entity.ITEM;
                model.COMPANY             = entity.COMPANY;
                model.ITEM_DESC           = entity.ITEM_DESC;
                model.REQUESTED_QTY       = entity.REQUESTED_QTY;
                model.ALLOCATED_QTY       = entity.ALLOCATED_QTY;
                model.QUANTITY_UM         = entity.QUANTITY_UM;
                model.ATTRIBUTE_NUM       = entity.ATTRIBUTE_NUM;
                model.FROM_LOC            = entity.FROM_LOC;
                model.TO_LOC              = entity.TO_LOC;
                model.FROM_ZONE           = entity.FROM_ZONE;
                model.TO_ZONE             = entity.TO_ZONE;
                model.FROM_LPN            = entity.FROM_LPN;
                model.FROM_PARENT_LPN     = entity.FROM_PARENT_LPN;
                model.CUSTOMER            = entity.CUSTOMER;
                model.SHIP_TO             = entity.SHIP_TO;
                model.INTERNAL_WAVE_NUM   = entity.INTERNAL_WAVE_NUM;
                model.PACKING_CLASS       = entity.PACKING_CLASS;
                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;
                model.CONVERTED_ALLOC_QTY = entity.CONVERTED_ALLOC_QTY;
                model.CONVERTED_QTY_UM    = entity.CONVERTED_QTY_UM;
                model.FROM_TEMPL_FIELD1   = entity.FROM_TEMPL_FIELD1;
                model.FROM_TEMPL_FIELD2   = entity.FROM_TEMPL_FIELD2;
                model.FROM_TEMPL_FIELD3   = entity.FROM_TEMPL_FIELD3;
                model.FROM_TEMPL_FIELD4   = entity.FROM_TEMPL_FIELD4;
                model.FROM_TEMPL_FIELD5   = entity.FROM_TEMPL_FIELD5;
                model.TO_TEMPL_FIELD1     = entity.TO_TEMPL_FIELD1;
                model.TO_TEMPL_FIELD2     = entity.TO_TEMPL_FIELD2;
                model.TO_TEMPL_FIELD3     = entity.TO_TEMPL_FIELD3;
                model.TO_TEMPL_FIELD4     = entity.TO_TEMPL_FIELD4;
                model.TO_TEMPL_FIELD5     = entity.TO_TEMPL_FIELD5;
                model.TASK_CREATED        = entity.TASK_CREATED;
                model.TREAT_AS_LOOSE      = entity.TREAT_AS_LOOSE;
                model.INVENTORY_STS       = entity.INVENTORY_STS;
                model.REPLENISHMENT_REQD  = entity.REPLENISHMENT_REQD;
                model.CONTAINER_WEIGHT    = entity.CONTAINER_WEIGHT;
                model.CONTAINER_HEIGHT    = entity.CONTAINER_HEIGHT;
                model.CONTAINER_WIDTH     = entity.CONTAINER_WIDTH;
                model.CONTAINER_LENGTH    = entity.CONTAINER_LENGTH;
                model.DIMENSION_UM        = entity.DIMENSION_UM;
                model.WEIGHT_UM           = entity.WEIGHT_UM;
                model.ITEM_LENGTH         = entity.ITEM_LENGTH;
                model.ITEM_WIDTH          = entity.ITEM_WIDTH;
                model.ITEM_HEIGHT         = entity.ITEM_HEIGHT;
                model.ITEM_WEIGHT         = entity.ITEM_WEIGHT;
                model.BIG_ZONE            = entity.BIG_ZONE;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.SHIPMENT.SHIPMENT_ALLOC_REQUEST_MODEL model)
        {
            Apps.Models.SHIPMENT_ALLOC_REQUEST entity = m_Rep.GetById(model.INTERNAL_SHIP_ALLOC_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.SHIPMENT_ALLOC_REQUEST();
            entity.INTERNAL_SHIP_ALLOC_NUM    = model.INTERNAL_SHIP_ALLOC_NUM;
            entity.INTERNAL_SHIPMENT_LINE_NUM = model.INTERNAL_SHIPMENT_LINE_NUM;
            entity.INTERNAL_SHIPMENT_NUM      = model.INTERNAL_SHIPMENT_NUM;
            entity.SHIPMENT_ID         = model.SHIPMENT_ID;
            entity.SHIPMENT_TYPE       = model.SHIPMENT_TYPE;
            entity.PRIORITY            = model.PRIORITY;
            entity.WAREHOUSE           = model.WAREHOUSE;
            entity.ITEM                = model.ITEM;
            entity.COMPANY             = model.COMPANY;
            entity.ITEM_DESC           = model.ITEM_DESC;
            entity.REQUESTED_QTY       = model.REQUESTED_QTY;
            entity.ALLOCATED_QTY       = model.ALLOCATED_QTY;
            entity.QUANTITY_UM         = model.QUANTITY_UM;
            entity.ATTRIBUTE_NUM       = model.ATTRIBUTE_NUM;
            entity.FROM_LOC            = model.FROM_LOC;
            entity.TO_LOC              = model.TO_LOC;
            entity.FROM_ZONE           = model.FROM_ZONE;
            entity.TO_ZONE             = model.TO_ZONE;
            entity.FROM_LPN            = model.FROM_LPN;
            entity.FROM_PARENT_LPN     = model.FROM_PARENT_LPN;
            entity.CUSTOMER            = model.CUSTOMER;
            entity.SHIP_TO             = model.SHIP_TO;
            entity.INTERNAL_WAVE_NUM   = model.INTERNAL_WAVE_NUM;
            entity.PACKING_CLASS       = model.PACKING_CLASS;
            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;
            entity.CONVERTED_ALLOC_QTY = model.CONVERTED_ALLOC_QTY;
            entity.CONVERTED_QTY_UM    = model.CONVERTED_QTY_UM;
            entity.FROM_TEMPL_FIELD1   = model.FROM_TEMPL_FIELD1;
            entity.FROM_TEMPL_FIELD2   = model.FROM_TEMPL_FIELD2;
            entity.FROM_TEMPL_FIELD3   = model.FROM_TEMPL_FIELD3;
            entity.FROM_TEMPL_FIELD4   = model.FROM_TEMPL_FIELD4;
            entity.FROM_TEMPL_FIELD5   = model.FROM_TEMPL_FIELD5;
            entity.TO_TEMPL_FIELD1     = model.TO_TEMPL_FIELD1;
            entity.TO_TEMPL_FIELD2     = model.TO_TEMPL_FIELD2;
            entity.TO_TEMPL_FIELD3     = model.TO_TEMPL_FIELD3;
            entity.TO_TEMPL_FIELD4     = model.TO_TEMPL_FIELD4;
            entity.TO_TEMPL_FIELD5     = model.TO_TEMPL_FIELD5;
            entity.TASK_CREATED        = model.TASK_CREATED;
            entity.TREAT_AS_LOOSE      = model.TREAT_AS_LOOSE;
            entity.INVENTORY_STS       = model.INVENTORY_STS;
            entity.REPLENISHMENT_REQD  = model.REPLENISHMENT_REQD;
            entity.CONTAINER_WEIGHT    = model.CONTAINER_WEIGHT;
            entity.CONTAINER_HEIGHT    = model.CONTAINER_HEIGHT;
            entity.CONTAINER_WIDTH     = model.CONTAINER_WIDTH;
            entity.CONTAINER_LENGTH    = model.CONTAINER_LENGTH;
            entity.DIMENSION_UM        = model.DIMENSION_UM;
            entity.WEIGHT_UM           = model.WEIGHT_UM;
            entity.ITEM_LENGTH         = model.ITEM_LENGTH;
            entity.ITEM_WIDTH          = model.ITEM_WIDTH;
            entity.ITEM_HEIGHT         = model.ITEM_HEIGHT;
            entity.ITEM_WEIGHT         = model.ITEM_WEIGHT;
            entity.BIG_ZONE            = model.BIG_ZONE;

            m_Rep.Create(entity);
        }