public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.SHIPMENT.SHIPMENT_DETAIL_MODEL model, params string[] updateProperties)
        {
            Apps.Models.SHIPMENT_DETAIL entity = m_Rep.GetById(model.INTERNAL_SHIPMENT_LINE_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_SHIPMENT_LINE_NUM = model.INTERNAL_SHIPMENT_LINE_NUM;
                entity.INTERNAL_SHIPMENT_NUM      = model.INTERNAL_SHIPMENT_NUM;
                entity.WAREHOUSE          = model.WAREHOUSE;
                entity.COMPANY            = model.COMPANY;
                entity.SHIPMENT_ID        = model.SHIPMENT_ID;
                entity.ERP_ORDER          = model.ERP_ORDER;
                entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM;
                entity.SHIPMENT_TYPE      = model.SHIPMENT_TYPE;
                entity.ITEM                      = model.ITEM;
                entity.ITEM_DESC                 = model.ITEM_DESC;
                entity.TOTAL_QTY                 = model.TOTAL_QTY;
                entity.REQUEST_QTY               = model.REQUEST_QTY;
                entity.QUANTITY_UM               = model.QUANTITY_UM;
                entity.ALLOCATION_RULE           = model.ALLOCATION_RULE;
                entity.PICK_LOC                  = model.PICK_LOC;
                entity.USER_STAMP                = model.USER_STAMP;
                entity.DATE_TIME_STAMP           = model.DATE_TIME_STAMP;
                entity.ATTRIBUTE_TRACK           = model.ATTRIBUTE_TRACK;
                entity.ATTRIBUTE1                = model.ATTRIBUTE1;
                entity.ATTRIBUTE2                = model.ATTRIBUTE2;
                entity.ATTRIBUTE3                = model.ATTRIBUTE3;
                entity.ATTRIBUTE4                = model.ATTRIBUTE4;
                entity.ATTRIBUTE5                = model.ATTRIBUTE5;
                entity.ATTRIBUTE6                = model.ATTRIBUTE6;
                entity.ATTRIBUTE7                = model.ATTRIBUTE7;
                entity.ATTRIBUTE8                = model.ATTRIBUTE8;
                entity.INVENTORY_STS             = model.INVENTORY_STS;
                entity.DOCK_LOC                  = model.DOCK_LOC;
                entity.PACKING_CLASS             = model.PACKING_CLASS;
                entity.STATUS                    = model.STATUS;
                entity.INTERNAL_WAVE_NUM         = model.INTERNAL_WAVE_NUM;
                entity.TOTAL_WEIGHT              = model.TOTAL_WEIGHT;
                entity.WEIGHT_UM                 = model.WEIGHT_UM;
                entity.TOTAL_VOLUME              = model.TOTAL_VOLUME;
                entity.VOLUME_UM                 = model.VOLUME_UM;
                entity.BACK_ORDER_LINE_NUM       = model.BACK_ORDER_LINE_NUM;
                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_DEF9                 = model.USER_DEF9;
                entity.USER_DEF10                = model.USER_DEF10;
                entity.ITEM_LIST_PRICE           = model.ITEM_LIST_PRICE;
                entity.ITEM_NET_PRICE            = model.ITEM_NET_PRICE;
                entity.SERIAL_NUM_TRACK          = model.SERIAL_NUM_TRACK;
                entity.ORIGINAL_ORDER_NUM        = model.ORIGINAL_ORDER_NUM;
                entity.CREATE_DATE_TIME          = model.CREATE_DATE_TIME;
                entity.CREATE_USER               = model.CREATE_USER;
                entity.HOST_ITEM                 = model.HOST_ITEM;
                entity.UPLOAD_INTERFACE_REQUIRED = model.UPLOAD_INTERFACE_REQUIRED;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.SHIPMENT.SHIPMENT_DETAIL_MODEL);
                Type typeE = typeof(Apps.Models.SHIPMENT_DETAIL);
                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_DETAIL_MODEL GetById(string id)
        {
            Apps.Models.SHIPMENT_DETAIL entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //SHIPMENT_DETAIL entity = m_Rep.GetById(id);
                Apps.Models.SCV.SHIPMENT.SHIPMENT_DETAIL_MODEL model = new Apps.Models.SCV.SHIPMENT.SHIPMENT_DETAIL_MODEL();
                model.INTERNAL_SHIPMENT_LINE_NUM = entity.INTERNAL_SHIPMENT_LINE_NUM;
                model.INTERNAL_SHIPMENT_NUM      = entity.INTERNAL_SHIPMENT_NUM;
                model.WAREHOUSE          = entity.WAREHOUSE;
                model.COMPANY            = entity.COMPANY;
                model.SHIPMENT_ID        = entity.SHIPMENT_ID;
                model.ERP_ORDER          = entity.ERP_ORDER;
                model.ERP_ORDER_LINE_NUM = entity.ERP_ORDER_LINE_NUM;
                model.SHIPMENT_TYPE      = entity.SHIPMENT_TYPE;
                model.ITEM                      = entity.ITEM;
                model.ITEM_DESC                 = entity.ITEM_DESC;
                model.TOTAL_QTY                 = entity.TOTAL_QTY;
                model.REQUEST_QTY               = entity.REQUEST_QTY;
                model.QUANTITY_UM               = entity.QUANTITY_UM;
                model.ALLOCATION_RULE           = entity.ALLOCATION_RULE;
                model.PICK_LOC                  = entity.PICK_LOC;
                model.USER_STAMP                = entity.USER_STAMP;
                model.DATE_TIME_STAMP           = entity.DATE_TIME_STAMP;
                model.ATTRIBUTE_TRACK           = entity.ATTRIBUTE_TRACK;
                model.ATTRIBUTE1                = entity.ATTRIBUTE1;
                model.ATTRIBUTE2                = entity.ATTRIBUTE2;
                model.ATTRIBUTE3                = entity.ATTRIBUTE3;
                model.ATTRIBUTE4                = entity.ATTRIBUTE4;
                model.ATTRIBUTE5                = entity.ATTRIBUTE5;
                model.ATTRIBUTE6                = entity.ATTRIBUTE6;
                model.ATTRIBUTE7                = entity.ATTRIBUTE7;
                model.ATTRIBUTE8                = entity.ATTRIBUTE8;
                model.INVENTORY_STS             = entity.INVENTORY_STS;
                model.DOCK_LOC                  = entity.DOCK_LOC;
                model.PACKING_CLASS             = entity.PACKING_CLASS;
                model.STATUS                    = entity.STATUS;
                model.INTERNAL_WAVE_NUM         = entity.INTERNAL_WAVE_NUM;
                model.TOTAL_WEIGHT              = entity.TOTAL_WEIGHT;
                model.WEIGHT_UM                 = entity.WEIGHT_UM;
                model.TOTAL_VOLUME              = entity.TOTAL_VOLUME;
                model.VOLUME_UM                 = entity.VOLUME_UM;
                model.BACK_ORDER_LINE_NUM       = entity.BACK_ORDER_LINE_NUM;
                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_DEF9                 = entity.USER_DEF9;
                model.USER_DEF10                = entity.USER_DEF10;
                model.ITEM_LIST_PRICE           = entity.ITEM_LIST_PRICE;
                model.ITEM_NET_PRICE            = entity.ITEM_NET_PRICE;
                model.SERIAL_NUM_TRACK          = entity.SERIAL_NUM_TRACK;
                model.ORIGINAL_ORDER_NUM        = entity.ORIGINAL_ORDER_NUM;
                model.CREATE_DATE_TIME          = entity.CREATE_DATE_TIME;
                model.CREATE_USER               = entity.CREATE_USER;
                model.HOST_ITEM                 = entity.HOST_ITEM;
                model.UPLOAD_INTERFACE_REQUIRED = entity.UPLOAD_INTERFACE_REQUIRED;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.SHIPMENT.SHIPMENT_DETAIL_MODEL model)
        {
            Apps.Models.SHIPMENT_DETAIL entity = m_Rep.GetById(model.INTERNAL_SHIPMENT_LINE_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.SHIPMENT_DETAIL();
            entity.INTERNAL_SHIPMENT_LINE_NUM = model.INTERNAL_SHIPMENT_LINE_NUM;
            entity.INTERNAL_SHIPMENT_NUM      = model.INTERNAL_SHIPMENT_NUM;
            entity.WAREHOUSE          = model.WAREHOUSE;
            entity.COMPANY            = model.COMPANY;
            entity.SHIPMENT_ID        = model.SHIPMENT_ID;
            entity.ERP_ORDER          = model.ERP_ORDER;
            entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM;
            entity.SHIPMENT_TYPE      = model.SHIPMENT_TYPE;
            entity.ITEM                      = model.ITEM;
            entity.ITEM_DESC                 = model.ITEM_DESC;
            entity.TOTAL_QTY                 = model.TOTAL_QTY;
            entity.REQUEST_QTY               = model.REQUEST_QTY;
            entity.QUANTITY_UM               = model.QUANTITY_UM;
            entity.ALLOCATION_RULE           = model.ALLOCATION_RULE;
            entity.PICK_LOC                  = model.PICK_LOC;
            entity.USER_STAMP                = model.USER_STAMP;
            entity.DATE_TIME_STAMP           = model.DATE_TIME_STAMP;
            entity.ATTRIBUTE_TRACK           = model.ATTRIBUTE_TRACK;
            entity.ATTRIBUTE1                = model.ATTRIBUTE1;
            entity.ATTRIBUTE2                = model.ATTRIBUTE2;
            entity.ATTRIBUTE3                = model.ATTRIBUTE3;
            entity.ATTRIBUTE4                = model.ATTRIBUTE4;
            entity.ATTRIBUTE5                = model.ATTRIBUTE5;
            entity.ATTRIBUTE6                = model.ATTRIBUTE6;
            entity.ATTRIBUTE7                = model.ATTRIBUTE7;
            entity.ATTRIBUTE8                = model.ATTRIBUTE8;
            entity.INVENTORY_STS             = model.INVENTORY_STS;
            entity.DOCK_LOC                  = model.DOCK_LOC;
            entity.PACKING_CLASS             = model.PACKING_CLASS;
            entity.STATUS                    = model.STATUS;
            entity.INTERNAL_WAVE_NUM         = model.INTERNAL_WAVE_NUM;
            entity.TOTAL_WEIGHT              = model.TOTAL_WEIGHT;
            entity.WEIGHT_UM                 = model.WEIGHT_UM;
            entity.TOTAL_VOLUME              = model.TOTAL_VOLUME;
            entity.VOLUME_UM                 = model.VOLUME_UM;
            entity.BACK_ORDER_LINE_NUM       = model.BACK_ORDER_LINE_NUM;
            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_DEF9                 = model.USER_DEF9;
            entity.USER_DEF10                = model.USER_DEF10;
            entity.ITEM_LIST_PRICE           = model.ITEM_LIST_PRICE;
            entity.ITEM_NET_PRICE            = model.ITEM_NET_PRICE;
            entity.SERIAL_NUM_TRACK          = model.SERIAL_NUM_TRACK;
            entity.ORIGINAL_ORDER_NUM        = model.ORIGINAL_ORDER_NUM;
            entity.CREATE_DATE_TIME          = model.CREATE_DATE_TIME;
            entity.CREATE_USER               = model.CREATE_USER;
            entity.HOST_ITEM                 = model.HOST_ITEM;
            entity.UPLOAD_INTERFACE_REQUIRED = model.UPLOAD_INTERFACE_REQUIRED;

            m_Rep.Create(entity);
        }