Exemple #1
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.SHIPMENT.SHIPMENT_EXPRESS_MODEL model)
        {
            Apps.Models.SHIPMENT_EXPRESS entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.SHIPMENT_EXPRESS();
            entity.INTERNAL_NUM          = model.INTERNAL_NUM;
            entity.INTERNAL_SHIPMENT_NUM = model.INTERNAL_SHIPMENT_NUM;
            entity.SHIPMENT_ID           = model.SHIPMENT_ID;
            entity.WAREHOUSE             = model.WAREHOUSE;
            entity.COMPANY                = model.COMPANY;
            entity.INTERNAL_WAVE_NUM      = model.INTERNAL_WAVE_NUM;
            entity.INTERNAL_LOAD_NUM      = model.INTERNAL_LOAD_NUM;
            entity.CARRIER                = model.CARRIER;
            entity.EXPRESS_ID             = model.EXPRESS_ID;
            entity.STATUS                 = model.STATUS;
            entity.DATE_TIME_STAMP        = model.DATE_TIME_STAMP;
            entity.USER_STAMP             = model.USER_STAMP;
            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.CONTAINER_ID           = model.CONTAINER_ID;
            entity.INTERNAL_CONTAINER_NUM = model.INTERNAL_CONTAINER_NUM;
            entity.TOTAL_WEIGHT           = model.TOTAL_WEIGHT;

            m_Rep.Create(entity);
        }
Exemple #2
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.SHIPMENT.SHIPMENT_EXPRESS_MODEL model, params string[] updateProperties)
        {
            Apps.Models.SHIPMENT_EXPRESS 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.INTERNAL_SHIPMENT_NUM = model.INTERNAL_SHIPMENT_NUM;
                entity.SHIPMENT_ID           = model.SHIPMENT_ID;
                entity.WAREHOUSE             = model.WAREHOUSE;
                entity.COMPANY                = model.COMPANY;
                entity.INTERNAL_WAVE_NUM      = model.INTERNAL_WAVE_NUM;
                entity.INTERNAL_LOAD_NUM      = model.INTERNAL_LOAD_NUM;
                entity.CARRIER                = model.CARRIER;
                entity.EXPRESS_ID             = model.EXPRESS_ID;
                entity.STATUS                 = model.STATUS;
                entity.DATE_TIME_STAMP        = model.DATE_TIME_STAMP;
                entity.USER_STAMP             = model.USER_STAMP;
                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.CONTAINER_ID           = model.CONTAINER_ID;
                entity.INTERNAL_CONTAINER_NUM = model.INTERNAL_CONTAINER_NUM;
                entity.TOTAL_WEIGHT           = model.TOTAL_WEIGHT;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.SHIPMENT.SHIPMENT_EXPRESS_MODEL);
                Type typeE = typeof(Apps.Models.SHIPMENT_EXPRESS);
                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);
        }
Exemple #3
0
        public virtual Apps.Models.SCV.SHIPMENT.SHIPMENT_EXPRESS_MODEL GetById(string id)
        {
            Apps.Models.SHIPMENT_EXPRESS entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //SHIPMENT_EXPRESS entity = m_Rep.GetById(id);
                Apps.Models.SCV.SHIPMENT.SHIPMENT_EXPRESS_MODEL model = new Apps.Models.SCV.SHIPMENT.SHIPMENT_EXPRESS_MODEL();
                model.INTERNAL_NUM          = entity.INTERNAL_NUM;
                model.INTERNAL_SHIPMENT_NUM = entity.INTERNAL_SHIPMENT_NUM;
                model.SHIPMENT_ID           = entity.SHIPMENT_ID;
                model.WAREHOUSE             = entity.WAREHOUSE;
                model.COMPANY                = entity.COMPANY;
                model.INTERNAL_WAVE_NUM      = entity.INTERNAL_WAVE_NUM;
                model.INTERNAL_LOAD_NUM      = entity.INTERNAL_LOAD_NUM;
                model.CARRIER                = entity.CARRIER;
                model.EXPRESS_ID             = entity.EXPRESS_ID;
                model.STATUS                 = entity.STATUS;
                model.DATE_TIME_STAMP        = entity.DATE_TIME_STAMP;
                model.USER_STAMP             = entity.USER_STAMP;
                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.CONTAINER_ID           = entity.CONTAINER_ID;
                model.INTERNAL_CONTAINER_NUM = entity.INTERNAL_CONTAINER_NUM;
                model.TOTAL_WEIGHT           = entity.TOTAL_WEIGHT;

                return(model);
            }
            else
            {
                return(null);
            }
        }