コード例 #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.SHIPPING.SHIPPING_LOAD_MODEL model, params string[] updateProperties)
        {
            Apps.Models.SHIPPING_LOAD entity = m_Rep.GetById(model.INTERNAL_LOAD_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_LOAD_NUM   = model.INTERNAL_LOAD_NUM;
                entity.WAREHOUSE           = model.WAREHOUSE;
                entity.TRAILING_STS        = model.TRAILING_STS;
                entity.LEADING_STS         = model.LEADING_STS;
                entity.CARRIER             = model.CARRIER;
                entity.CARRIER_SERVICE     = model.CARRIER_SERVICE;
                entity.SCHEDULED_SHIP_DATE = model.SCHEDULED_SHIP_DATE;
                entity.ACTUAL_SHIP_DATE    = model.ACTUAL_SHIP_DATE;
                entity.LOAD_SIZE_DEF       = model.LOAD_SIZE_DEF;
                entity.LOAD_CLOSED         = model.LOAD_CLOSED;
                entity.SEAL_ID             = model.SEAL_ID;
                entity.TRAILER_ID          = model.TRAILER_ID;
                entity.TOTAL_SHIPMENTS     = model.TOTAL_SHIPMENTS;
                entity.TOTAL_CONTAINERS    = model.TOTAL_CONTAINERS;
                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.USER_STAMP          = model.USER_STAMP;
                entity.DATE_TIME_STAMP     = model.DATE_TIME_STAMP;
                entity.ROUTE      = model.ROUTE;
                entity.DOCK_DOOR  = model.DOCK_DOOR;
                entity.DRIVER     = model.DRIVER;
                entity.MAX_WEIGHT = model.MAX_WEIGHT;
                entity.MAX_VOLUME = model.MAX_VOLUME;
                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.IN_CONFIRM = model.IN_CONFIRM;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.SHIPPING.SHIPPING_LOAD_MODEL);
                Type typeE = typeof(Apps.Models.SHIPPING_LOAD);
                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);
        }
コード例 #2
0
        public virtual Apps.Models.SCV.SHIPPING.SHIPPING_LOAD_MODEL GetById(string id)
        {
            Apps.Models.SHIPPING_LOAD entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //SHIPPING_LOAD entity = m_Rep.GetById(id);
                Apps.Models.SCV.SHIPPING.SHIPPING_LOAD_MODEL model = new Apps.Models.SCV.SHIPPING.SHIPPING_LOAD_MODEL();
                model.INTERNAL_LOAD_NUM   = entity.INTERNAL_LOAD_NUM;
                model.WAREHOUSE           = entity.WAREHOUSE;
                model.TRAILING_STS        = entity.TRAILING_STS;
                model.LEADING_STS         = entity.LEADING_STS;
                model.CARRIER             = entity.CARRIER;
                model.CARRIER_SERVICE     = entity.CARRIER_SERVICE;
                model.SCHEDULED_SHIP_DATE = entity.SCHEDULED_SHIP_DATE;
                model.ACTUAL_SHIP_DATE    = entity.ACTUAL_SHIP_DATE;
                model.LOAD_SIZE_DEF       = entity.LOAD_SIZE_DEF;
                model.LOAD_CLOSED         = entity.LOAD_CLOSED;
                model.SEAL_ID             = entity.SEAL_ID;
                model.TRAILER_ID          = entity.TRAILER_ID;
                model.TOTAL_SHIPMENTS     = entity.TOTAL_SHIPMENTS;
                model.TOTAL_CONTAINERS    = entity.TOTAL_CONTAINERS;
                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.USER_STAMP          = entity.USER_STAMP;
                model.DATE_TIME_STAMP     = entity.DATE_TIME_STAMP;
                model.ROUTE      = entity.ROUTE;
                model.DOCK_DOOR  = entity.DOCK_DOOR;
                model.DRIVER     = entity.DRIVER;
                model.MAX_WEIGHT = entity.MAX_WEIGHT;
                model.MAX_VOLUME = entity.MAX_VOLUME;
                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.IN_CONFIRM = entity.IN_CONFIRM;

                return(model);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.SHIPPING.SHIPPING_LOAD_MODEL model)
        {
            Apps.Models.SHIPPING_LOAD entity = m_Rep.GetById(model.INTERNAL_LOAD_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.SHIPPING_LOAD();
            entity.INTERNAL_LOAD_NUM   = model.INTERNAL_LOAD_NUM;
            entity.WAREHOUSE           = model.WAREHOUSE;
            entity.TRAILING_STS        = model.TRAILING_STS;
            entity.LEADING_STS         = model.LEADING_STS;
            entity.CARRIER             = model.CARRIER;
            entity.CARRIER_SERVICE     = model.CARRIER_SERVICE;
            entity.SCHEDULED_SHIP_DATE = model.SCHEDULED_SHIP_DATE;
            entity.ACTUAL_SHIP_DATE    = model.ACTUAL_SHIP_DATE;
            entity.LOAD_SIZE_DEF       = model.LOAD_SIZE_DEF;
            entity.LOAD_CLOSED         = model.LOAD_CLOSED;
            entity.SEAL_ID             = model.SEAL_ID;
            entity.TRAILER_ID          = model.TRAILER_ID;
            entity.TOTAL_SHIPMENTS     = model.TOTAL_SHIPMENTS;
            entity.TOTAL_CONTAINERS    = model.TOTAL_CONTAINERS;
            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.USER_STAMP          = model.USER_STAMP;
            entity.DATE_TIME_STAMP     = model.DATE_TIME_STAMP;
            entity.ROUTE      = model.ROUTE;
            entity.DOCK_DOOR  = model.DOCK_DOOR;
            entity.DRIVER     = model.DRIVER;
            entity.MAX_WEIGHT = model.MAX_WEIGHT;
            entity.MAX_VOLUME = model.MAX_VOLUME;
            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.IN_CONFIRM = model.IN_CONFIRM;

            m_Rep.Create(entity);
        }