Пример #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.Sys.LOCATION_MODEL model, params string[] updateProperties)
        {
            Apps.Models.LOCATION entity = m_Rep.GetById(model.INTERNAL_LOC_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_LOC_NUM          = model.INTERNAL_LOC_NUM;
                entity.LOCATION1                 = model.LOCATION1;
                entity.WAREHOUSE                 = model.WAREHOUSE;
                entity.ZONE                      = model.ZONE;
                entity.LOCATION_CLASS            = model.LOCATION_CLASS;
                entity.LOCATION_TYPE             = model.LOCATION_TYPE;
                entity.MULTI_ITEM                = model.MULTI_ITEM;
                entity.TRACK_LPN                 = model.TRACK_LPN;
                entity.LOCATION_STS              = model.LOCATION_STS;
                entity.LAST_CYCLE_COUNT_DATE     = model.LAST_CYCLE_COUNT_DATE;
                entity.ACTIVE                    = model.ACTIVE;
                entity.USER_STAMP                = model.USER_STAMP;
                entity.DATE_TIME_STAMP           = model.DATE_TIME_STAMP;
                entity.TEMPLATE_FIELD1           = model.TEMPLATE_FIELD1;
                entity.TEMPLATE_FIELD2           = model.TEMPLATE_FIELD2;
                entity.TEMPLATE_FIELD3           = model.TEMPLATE_FIELD3;
                entity.TEMPLATE_FIELD4           = model.TEMPLATE_FIELD4;
                entity.TEMPLATE_FIELD5           = model.TEMPLATE_FIELD5;
                entity.MIN_QTY_UM                = model.MIN_QTY_UM;
                entity.LAST_ACTIVITY_DATE_TIME   = model.LAST_ACTIVITY_DATE_TIME;
                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.CHECK_DIGIT               = model.CHECK_DIGIT;
                entity.MAX_LOTS                  = model.MAX_LOTS;
                entity.LOCATION_SUB_CLASS        = model.LOCATION_SUB_CLASS;
                entity.LOCATION_CATEGORY01       = model.LOCATION_CATEGORY01;
                entity.LOCATION_CATEGORY02       = model.LOCATION_CATEGORY02;
                entity.LOCATION_CATEGORY03       = model.LOCATION_CATEGORY03;
                entity.LOCATION_CATEGORY04       = model.LOCATION_CATEGORY04;
                entity.LOCATION_CATEGORY05       = model.LOCATION_CATEGORY05;
                entity.LOCATION_CATEGORY06       = model.LOCATION_CATEGORY06;
                entity.LOCATION_CATEGORY07       = model.LOCATION_CATEGORY07;
                entity.LOCATION_CATEGORY08       = model.LOCATION_CATEGORY08;
                entity.PUTAWAY_SEQ               = model.PUTAWAY_SEQ;
                entity.PICK_SEQ                  = model.PICK_SEQ;
                entity.REPLENISH_SEQ             = model.REPLENISH_SEQ;
                entity.CYCLE_COUNT_SEQ           = model.CYCLE_COUNT_SEQ;
                entity.LOCATING_ZONE             = model.LOCATING_ZONE;
                entity.ALLOCATION_ZONE           = model.ALLOCATION_ZONE;
                entity.WORK_ZONE                 = model.WORK_ZONE;
                entity.MAX_LPNS                  = model.MAX_LPNS;
                entity.BIG_ZONE                  = model.BIG_ZONE;
                entity.EDITABLE_INVENTORY_STATUS = model.EDITABLE_INVENTORY_STATUS;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.Sys.LOCATION_MODEL);
                Type typeE = typeof(Apps.Models.LOCATION);
                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.Sys.LOCATION_MODEL GetById(string id)
        {
            Apps.Models.LOCATION entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //LOCATION entity = m_Rep.GetById(id);
                Apps.Models.SCV.Sys.LOCATION_MODEL model = new Apps.Models.SCV.Sys.LOCATION_MODEL();
                model.INTERNAL_LOC_NUM          = entity.INTERNAL_LOC_NUM;
                model.LOCATION1                 = entity.LOCATION1;
                model.WAREHOUSE                 = entity.WAREHOUSE;
                model.ZONE                      = entity.ZONE;
                model.LOCATION_CLASS            = entity.LOCATION_CLASS;
                model.LOCATION_TYPE             = entity.LOCATION_TYPE;
                model.MULTI_ITEM                = entity.MULTI_ITEM;
                model.TRACK_LPN                 = entity.TRACK_LPN;
                model.LOCATION_STS              = entity.LOCATION_STS;
                model.LAST_CYCLE_COUNT_DATE     = entity.LAST_CYCLE_COUNT_DATE;
                model.ACTIVE                    = entity.ACTIVE;
                model.USER_STAMP                = entity.USER_STAMP;
                model.DATE_TIME_STAMP           = entity.DATE_TIME_STAMP;
                model.TEMPLATE_FIELD1           = entity.TEMPLATE_FIELD1;
                model.TEMPLATE_FIELD2           = entity.TEMPLATE_FIELD2;
                model.TEMPLATE_FIELD3           = entity.TEMPLATE_FIELD3;
                model.TEMPLATE_FIELD4           = entity.TEMPLATE_FIELD4;
                model.TEMPLATE_FIELD5           = entity.TEMPLATE_FIELD5;
                model.MIN_QTY_UM                = entity.MIN_QTY_UM;
                model.LAST_ACTIVITY_DATE_TIME   = entity.LAST_ACTIVITY_DATE_TIME;
                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.CHECK_DIGIT               = entity.CHECK_DIGIT;
                model.MAX_LOTS                  = entity.MAX_LOTS;
                model.LOCATION_SUB_CLASS        = entity.LOCATION_SUB_CLASS;
                model.LOCATION_CATEGORY01       = entity.LOCATION_CATEGORY01;
                model.LOCATION_CATEGORY02       = entity.LOCATION_CATEGORY02;
                model.LOCATION_CATEGORY03       = entity.LOCATION_CATEGORY03;
                model.LOCATION_CATEGORY04       = entity.LOCATION_CATEGORY04;
                model.LOCATION_CATEGORY05       = entity.LOCATION_CATEGORY05;
                model.LOCATION_CATEGORY06       = entity.LOCATION_CATEGORY06;
                model.LOCATION_CATEGORY07       = entity.LOCATION_CATEGORY07;
                model.LOCATION_CATEGORY08       = entity.LOCATION_CATEGORY08;
                model.PUTAWAY_SEQ               = entity.PUTAWAY_SEQ;
                model.PICK_SEQ                  = entity.PICK_SEQ;
                model.REPLENISH_SEQ             = entity.REPLENISH_SEQ;
                model.CYCLE_COUNT_SEQ           = entity.CYCLE_COUNT_SEQ;
                model.LOCATING_ZONE             = entity.LOCATING_ZONE;
                model.ALLOCATION_ZONE           = entity.ALLOCATION_ZONE;
                model.WORK_ZONE                 = entity.WORK_ZONE;
                model.MAX_LPNS                  = entity.MAX_LPNS;
                model.BIG_ZONE                  = entity.BIG_ZONE;
                model.EDITABLE_INVENTORY_STATUS = entity.EDITABLE_INVENTORY_STATUS;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.Sys.LOCATION_MODEL model)
        {
            Apps.Models.LOCATION entity = m_Rep.GetById(model.INTERNAL_LOC_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.LOCATION();
            entity.INTERNAL_LOC_NUM          = model.INTERNAL_LOC_NUM;
            entity.LOCATION1                 = model.LOCATION1;
            entity.WAREHOUSE                 = model.WAREHOUSE;
            entity.ZONE                      = model.ZONE;
            entity.LOCATION_CLASS            = model.LOCATION_CLASS;
            entity.LOCATION_TYPE             = model.LOCATION_TYPE;
            entity.MULTI_ITEM                = model.MULTI_ITEM;
            entity.TRACK_LPN                 = model.TRACK_LPN;
            entity.LOCATION_STS              = model.LOCATION_STS;
            entity.LAST_CYCLE_COUNT_DATE     = model.LAST_CYCLE_COUNT_DATE;
            entity.ACTIVE                    = model.ACTIVE;
            entity.USER_STAMP                = model.USER_STAMP;
            entity.DATE_TIME_STAMP           = model.DATE_TIME_STAMP;
            entity.TEMPLATE_FIELD1           = model.TEMPLATE_FIELD1;
            entity.TEMPLATE_FIELD2           = model.TEMPLATE_FIELD2;
            entity.TEMPLATE_FIELD3           = model.TEMPLATE_FIELD3;
            entity.TEMPLATE_FIELD4           = model.TEMPLATE_FIELD4;
            entity.TEMPLATE_FIELD5           = model.TEMPLATE_FIELD5;
            entity.MIN_QTY_UM                = model.MIN_QTY_UM;
            entity.LAST_ACTIVITY_DATE_TIME   = model.LAST_ACTIVITY_DATE_TIME;
            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.CHECK_DIGIT               = model.CHECK_DIGIT;
            entity.MAX_LOTS                  = model.MAX_LOTS;
            entity.LOCATION_SUB_CLASS        = model.LOCATION_SUB_CLASS;
            entity.LOCATION_CATEGORY01       = model.LOCATION_CATEGORY01;
            entity.LOCATION_CATEGORY02       = model.LOCATION_CATEGORY02;
            entity.LOCATION_CATEGORY03       = model.LOCATION_CATEGORY03;
            entity.LOCATION_CATEGORY04       = model.LOCATION_CATEGORY04;
            entity.LOCATION_CATEGORY05       = model.LOCATION_CATEGORY05;
            entity.LOCATION_CATEGORY06       = model.LOCATION_CATEGORY06;
            entity.LOCATION_CATEGORY07       = model.LOCATION_CATEGORY07;
            entity.LOCATION_CATEGORY08       = model.LOCATION_CATEGORY08;
            entity.PUTAWAY_SEQ               = model.PUTAWAY_SEQ;
            entity.PICK_SEQ                  = model.PICK_SEQ;
            entity.REPLENISH_SEQ             = model.REPLENISH_SEQ;
            entity.CYCLE_COUNT_SEQ           = model.CYCLE_COUNT_SEQ;
            entity.LOCATING_ZONE             = model.LOCATING_ZONE;
            entity.ALLOCATION_ZONE           = model.ALLOCATION_ZONE;
            entity.WORK_ZONE                 = model.WORK_ZONE;
            entity.MAX_LPNS                  = model.MAX_LPNS;
            entity.BIG_ZONE                  = model.BIG_ZONE;
            entity.EDITABLE_INVENTORY_STATUS = model.EDITABLE_INVENTORY_STATUS;

            m_Rep.Create(entity);
        }