Beispiel #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.CONTAINER.CONTAINER_TYPE_MODEL model, params string[] updateProperties)
        {
            Apps.Models.CONTAINER_TYPE 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.CONTAINER_TYPE1  = model.CONTAINER_TYPE1;
                entity.DESCRIPTION      = model.DESCRIPTION;
                entity.CONTAINER_CLASS  = model.CONTAINER_CLASS;
                entity.CONTAINER_GROUP  = model.CONTAINER_GROUP;
                entity.SEQUENCE         = model.SEQUENCE;
                entity.EMPTY_WEIGHT     = model.EMPTY_WEIGHT;
                entity.WEIGHT_UM        = model.WEIGHT_UM;
                entity.LENGTH           = model.LENGTH;
                entity.WIDTH            = model.WIDTH;
                entity.HEIGHT           = model.HEIGHT;
                entity.DIMENSION_UM     = model.DIMENSION_UM;
                entity.MAXIMUM_WEIGHT   = model.MAXIMUM_WEIGHT;
                entity.WEIGHT_TOLERANCE = model.WEIGHT_TOLERANCE;
                entity.FILL_PERCENT     = model.FILL_PERCENT;
                entity.USE_AS_DEFAULT   = model.USE_AS_DEFAULT;
                entity.RATING_SYMBOL    = model.RATING_SYMBOL;
                entity.ACTIVE           = model.ACTIVE;
                entity.PROCESS_STAMP    = model.PROCESS_STAMP;
                entity.DATE_TIME_STAMP  = model.DATE_TIME_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.USER_STAMP       = model.USER_STAMP;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.CONTAINER.CONTAINER_TYPE_MODEL);
                Type typeE = typeof(Apps.Models.CONTAINER_TYPE);
                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);
        }
Beispiel #2
0
        public virtual Apps.Models.SCV.CONTAINER.CONTAINER_TYPE_MODEL GetById(string id)
        {
            Apps.Models.CONTAINER_TYPE entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //CONTAINER_TYPE entity = m_Rep.GetById(id);
                Apps.Models.SCV.CONTAINER.CONTAINER_TYPE_MODEL model = new Apps.Models.SCV.CONTAINER.CONTAINER_TYPE_MODEL();
                model.INTERNAL_NUM     = entity.INTERNAL_NUM;
                model.CONTAINER_TYPE1  = entity.CONTAINER_TYPE1;
                model.DESCRIPTION      = entity.DESCRIPTION;
                model.CONTAINER_CLASS  = entity.CONTAINER_CLASS;
                model.CONTAINER_GROUP  = entity.CONTAINER_GROUP;
                model.SEQUENCE         = entity.SEQUENCE;
                model.EMPTY_WEIGHT     = entity.EMPTY_WEIGHT;
                model.WEIGHT_UM        = entity.WEIGHT_UM;
                model.LENGTH           = entity.LENGTH;
                model.WIDTH            = entity.WIDTH;
                model.HEIGHT           = entity.HEIGHT;
                model.DIMENSION_UM     = entity.DIMENSION_UM;
                model.MAXIMUM_WEIGHT   = entity.MAXIMUM_WEIGHT;
                model.WEIGHT_TOLERANCE = entity.WEIGHT_TOLERANCE;
                model.FILL_PERCENT     = entity.FILL_PERCENT;
                model.USE_AS_DEFAULT   = entity.USE_AS_DEFAULT;
                model.RATING_SYMBOL    = entity.RATING_SYMBOL;
                model.ACTIVE           = entity.ACTIVE;
                model.PROCESS_STAMP    = entity.PROCESS_STAMP;
                model.DATE_TIME_STAMP  = entity.DATE_TIME_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.USER_STAMP       = entity.USER_STAMP;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.CONTAINER.CONTAINER_TYPE_MODEL model)
        {
            Apps.Models.CONTAINER_TYPE entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.CONTAINER_TYPE();
            entity.INTERNAL_NUM     = model.INTERNAL_NUM;
            entity.CONTAINER_TYPE1  = model.CONTAINER_TYPE1;
            entity.DESCRIPTION      = model.DESCRIPTION;
            entity.CONTAINER_CLASS  = model.CONTAINER_CLASS;
            entity.CONTAINER_GROUP  = model.CONTAINER_GROUP;
            entity.SEQUENCE         = model.SEQUENCE;
            entity.EMPTY_WEIGHT     = model.EMPTY_WEIGHT;
            entity.WEIGHT_UM        = model.WEIGHT_UM;
            entity.LENGTH           = model.LENGTH;
            entity.WIDTH            = model.WIDTH;
            entity.HEIGHT           = model.HEIGHT;
            entity.DIMENSION_UM     = model.DIMENSION_UM;
            entity.MAXIMUM_WEIGHT   = model.MAXIMUM_WEIGHT;
            entity.WEIGHT_TOLERANCE = model.WEIGHT_TOLERANCE;
            entity.FILL_PERCENT     = model.FILL_PERCENT;
            entity.USE_AS_DEFAULT   = model.USE_AS_DEFAULT;
            entity.RATING_SYMBOL    = model.RATING_SYMBOL;
            entity.ACTIVE           = model.ACTIVE;
            entity.PROCESS_STAMP    = model.PROCESS_STAMP;
            entity.DATE_TIME_STAMP  = model.DATE_TIME_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.USER_STAMP       = model.USER_STAMP;

            m_Rep.Create(entity);
        }