public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.WAYBILL.WAYBILL_INFO_MODEL model, params string[] updateProperties)
        {
            Apps.Models.WAYBILL_INFO 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.TRACKING_NUMBER        = model.TRACKING_NUMBER;
                entity.CARRIER                = model.CARRIER;
                entity.SHORT_ADDRESS          = model.SHORT_ADDRESS;
                entity.SHIPPING_BRANCH_CODE   = model.SHIPPING_BRANCH_CODE;
                entity.SHIPPING_BRANCH_NAME   = model.SHIPPING_BRANCH_NAME;
                entity.CONSIGNEE_BRANCH_CODE  = model.CONSIGNEE_BRANCH_CODE;
                entity.CONSIGNEE_BRANCH_NAME  = model.CONSIGNEE_BRANCH_NAME;
                entity.INTERNAL_SHIPMENT_NUM  = model.INTERNAL_SHIPMENT_NUM;
                entity.INTERNAL_CONTAINER_NUM = model.INTERNAL_CONTAINER_NUM;
                entity.NOTICE_CODE            = model.NOTICE_CODE;
                entity.PRINT_QUANTITY         = model.PRINT_QUANTITY;
                entity.NOTICE_MESSAGE         = model.NOTICE_MESSAGE;
                entity.STATUS          = model.STATUS;
                entity.REAL_USER_ID    = model.REAL_USER_ID;
                entity.VOLUME          = model.VOLUME;
                entity.WEIGHT          = model.WEIGHT;
                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.CREATE_TIME     = model.CREATE_TIME;
                entity.PICKUP_TIME     = model.PICKUP_TIME;
                entity.SIGN_TIME       = model.SIGN_TIME;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.WAYBILL.WAYBILL_INFO_MODEL);
                Type typeE = typeof(Apps.Models.WAYBILL_INFO);
                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.WAYBILL.WAYBILL_INFO_MODEL GetById(string id)
        {
            Apps.Models.WAYBILL_INFO entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //WAYBILL_INFO entity = m_Rep.GetById(id);
                Apps.Models.SCV.WAYBILL.WAYBILL_INFO_MODEL model = new Apps.Models.SCV.WAYBILL.WAYBILL_INFO_MODEL();
                model.INTERNAL_NUM           = entity.INTERNAL_NUM;
                model.TRACKING_NUMBER        = entity.TRACKING_NUMBER;
                model.CARRIER                = entity.CARRIER;
                model.SHORT_ADDRESS          = entity.SHORT_ADDRESS;
                model.SHIPPING_BRANCH_CODE   = entity.SHIPPING_BRANCH_CODE;
                model.SHIPPING_BRANCH_NAME   = entity.SHIPPING_BRANCH_NAME;
                model.CONSIGNEE_BRANCH_CODE  = entity.CONSIGNEE_BRANCH_CODE;
                model.CONSIGNEE_BRANCH_NAME  = entity.CONSIGNEE_BRANCH_NAME;
                model.INTERNAL_SHIPMENT_NUM  = entity.INTERNAL_SHIPMENT_NUM;
                model.INTERNAL_CONTAINER_NUM = entity.INTERNAL_CONTAINER_NUM;
                model.NOTICE_CODE            = entity.NOTICE_CODE;
                model.PRINT_QUANTITY         = entity.PRINT_QUANTITY;
                model.NOTICE_MESSAGE         = entity.NOTICE_MESSAGE;
                model.STATUS          = entity.STATUS;
                model.REAL_USER_ID    = entity.REAL_USER_ID;
                model.VOLUME          = entity.VOLUME;
                model.WEIGHT          = entity.WEIGHT;
                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.CREATE_TIME     = entity.CREATE_TIME;
                model.PICKUP_TIME     = entity.PICKUP_TIME;
                model.SIGN_TIME       = entity.SIGN_TIME;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.WAYBILL.WAYBILL_INFO_MODEL model)
        {
            Apps.Models.WAYBILL_INFO entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.WAYBILL_INFO();
            entity.INTERNAL_NUM           = model.INTERNAL_NUM;
            entity.TRACKING_NUMBER        = model.TRACKING_NUMBER;
            entity.CARRIER                = model.CARRIER;
            entity.SHORT_ADDRESS          = model.SHORT_ADDRESS;
            entity.SHIPPING_BRANCH_CODE   = model.SHIPPING_BRANCH_CODE;
            entity.SHIPPING_BRANCH_NAME   = model.SHIPPING_BRANCH_NAME;
            entity.CONSIGNEE_BRANCH_CODE  = model.CONSIGNEE_BRANCH_CODE;
            entity.CONSIGNEE_BRANCH_NAME  = model.CONSIGNEE_BRANCH_NAME;
            entity.INTERNAL_SHIPMENT_NUM  = model.INTERNAL_SHIPMENT_NUM;
            entity.INTERNAL_CONTAINER_NUM = model.INTERNAL_CONTAINER_NUM;
            entity.NOTICE_CODE            = model.NOTICE_CODE;
            entity.PRINT_QUANTITY         = model.PRINT_QUANTITY;
            entity.NOTICE_MESSAGE         = model.NOTICE_MESSAGE;
            entity.STATUS          = model.STATUS;
            entity.REAL_USER_ID    = model.REAL_USER_ID;
            entity.VOLUME          = model.VOLUME;
            entity.WEIGHT          = model.WEIGHT;
            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.CREATE_TIME     = model.CREATE_TIME;
            entity.PICKUP_TIME     = model.PICKUP_TIME;
            entity.SIGN_TIME       = model.SIGN_TIME;

            m_Rep.Create(entity);
        }