Esempio n. 1
0
        public virtual Apps.Models.SCV.RECEIPT.RECEIPT_CONTAINER_MODEL GetById(string id)
        {
            Apps.Models.RECEIPT_CONTAINER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //RECEIPT_CONTAINER entity = m_Rep.GetById(id);
                Apps.Models.SCV.RECEIPT.RECEIPT_CONTAINER_MODEL model = new Apps.Models.SCV.RECEIPT.RECEIPT_CONTAINER_MODEL();
                model.INTERNAL_CONTAINER_NUM    = entity.INTERNAL_CONTAINER_NUM;
                model.INTERNAL_RECEIPT_NUM      = entity.INTERNAL_RECEIPT_NUM;
                model.INTERNAL_RECEIPT_LINE_NUM = entity.INTERNAL_RECEIPT_LINE_NUM;
                model.RECEIPT_ID            = entity.RECEIPT_ID;
                model.RECEIPT_TYPE          = entity.RECEIPT_TYPE;
                model.CONTAINER_ID          = entity.CONTAINER_ID;
                model.CONTAINER_TYPE        = entity.CONTAINER_TYPE;
                model.PARENT                = entity.PARENT;
                model.COMPANY               = entity.COMPANY;
                model.ITEM                  = entity.ITEM;
                model.ITEM_DESC             = entity.ITEM_DESC;
                model.ITEM_CLASS            = entity.ITEM_CLASS;
                model.QUANTITY              = entity.QUANTITY;
                model.QUANTITY_UM           = entity.QUANTITY_UM;
                model.STATUS                = entity.STATUS;
                model.WAREHOUSE             = entity.WAREHOUSE;
                model.LOCATING_RULE         = entity.LOCATING_RULE;
                model.FROM_LOCATION         = entity.FROM_LOCATION;
                model.TO_LOCATION           = entity.TO_LOCATION;
                model.DATE_TIME_STAMP       = entity.DATE_TIME_STAMP;
                model.ATTRIBUTE_NUM         = entity.ATTRIBUTE_NUM;
                model.ATTRIBUTE1            = entity.ATTRIBUTE1;
                model.ATTRIBUTE2            = entity.ATTRIBUTE2;
                model.ATTRIBUTE3            = entity.ATTRIBUTE3;
                model.ATTRIBUTE4            = entity.ATTRIBUTE4;
                model.ATTRIBUTE5            = entity.ATTRIBUTE5;
                model.ATTRIBUTE6            = entity.ATTRIBUTE6;
                model.ATTRIBUTE7            = entity.ATTRIBUTE7;
                model.ATTRIBUTE8            = entity.ATTRIBUTE8;
                model.INVENTORY_STS         = entity.INVENTORY_STS;
                model.USER_STAMP            = entity.USER_STAMP;
                model.TASK_CREATED          = entity.TASK_CREATED;
                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.UPLOAD_INTERFACE_FLAG = entity.UPLOAD_INTERFACE_FLAG;
                model.CONVERTED_QTY         = entity.CONVERTED_QTY;
                model.CONVERTED_QTY_UM      = entity.CONVERTED_QTY_UM;
                model.RECEIVING_CART_ID     = entity.RECEIVING_CART_ID;
                model.RECEIVING_CART_POS    = entity.RECEIVING_CART_POS;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.RECEIPT.RECEIPT_CONTAINER_MODEL model)
        {
            Apps.Models.RECEIPT_CONTAINER entity = m_Rep.GetById(model.INTERNAL_CONTAINER_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.RECEIPT_CONTAINER();
            entity.INTERNAL_CONTAINER_NUM    = model.INTERNAL_CONTAINER_NUM;
            entity.INTERNAL_RECEIPT_NUM      = model.INTERNAL_RECEIPT_NUM;
            entity.INTERNAL_RECEIPT_LINE_NUM = model.INTERNAL_RECEIPT_LINE_NUM;
            entity.RECEIPT_ID            = model.RECEIPT_ID;
            entity.RECEIPT_TYPE          = model.RECEIPT_TYPE;
            entity.CONTAINER_ID          = model.CONTAINER_ID;
            entity.CONTAINER_TYPE        = model.CONTAINER_TYPE;
            entity.PARENT                = model.PARENT;
            entity.COMPANY               = model.COMPANY;
            entity.ITEM                  = model.ITEM;
            entity.ITEM_DESC             = model.ITEM_DESC;
            entity.ITEM_CLASS            = model.ITEM_CLASS;
            entity.QUANTITY              = model.QUANTITY;
            entity.QUANTITY_UM           = model.QUANTITY_UM;
            entity.STATUS                = model.STATUS;
            entity.WAREHOUSE             = model.WAREHOUSE;
            entity.LOCATING_RULE         = model.LOCATING_RULE;
            entity.FROM_LOCATION         = model.FROM_LOCATION;
            entity.TO_LOCATION           = model.TO_LOCATION;
            entity.DATE_TIME_STAMP       = model.DATE_TIME_STAMP;
            entity.ATTRIBUTE_NUM         = model.ATTRIBUTE_NUM;
            entity.ATTRIBUTE1            = model.ATTRIBUTE1;
            entity.ATTRIBUTE2            = model.ATTRIBUTE2;
            entity.ATTRIBUTE3            = model.ATTRIBUTE3;
            entity.ATTRIBUTE4            = model.ATTRIBUTE4;
            entity.ATTRIBUTE5            = model.ATTRIBUTE5;
            entity.ATTRIBUTE6            = model.ATTRIBUTE6;
            entity.ATTRIBUTE7            = model.ATTRIBUTE7;
            entity.ATTRIBUTE8            = model.ATTRIBUTE8;
            entity.INVENTORY_STS         = model.INVENTORY_STS;
            entity.USER_STAMP            = model.USER_STAMP;
            entity.TASK_CREATED          = model.TASK_CREATED;
            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.UPLOAD_INTERFACE_FLAG = model.UPLOAD_INTERFACE_FLAG;
            entity.CONVERTED_QTY         = model.CONVERTED_QTY;
            entity.CONVERTED_QTY_UM      = model.CONVERTED_QTY_UM;
            entity.RECEIVING_CART_ID     = model.RECEIVING_CART_ID;
            entity.RECEIVING_CART_POS    = model.RECEIVING_CART_POS;

            m_Rep.Create(entity);
        }
Esempio n. 3
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.RECEIPT.RECEIPT_CONTAINER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.RECEIPT_CONTAINER entity = m_Rep.GetById(model.INTERNAL_CONTAINER_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_CONTAINER_NUM    = model.INTERNAL_CONTAINER_NUM;
                entity.INTERNAL_RECEIPT_NUM      = model.INTERNAL_RECEIPT_NUM;
                entity.INTERNAL_RECEIPT_LINE_NUM = model.INTERNAL_RECEIPT_LINE_NUM;
                entity.RECEIPT_ID            = model.RECEIPT_ID;
                entity.RECEIPT_TYPE          = model.RECEIPT_TYPE;
                entity.CONTAINER_ID          = model.CONTAINER_ID;
                entity.CONTAINER_TYPE        = model.CONTAINER_TYPE;
                entity.PARENT                = model.PARENT;
                entity.COMPANY               = model.COMPANY;
                entity.ITEM                  = model.ITEM;
                entity.ITEM_DESC             = model.ITEM_DESC;
                entity.ITEM_CLASS            = model.ITEM_CLASS;
                entity.QUANTITY              = model.QUANTITY;
                entity.QUANTITY_UM           = model.QUANTITY_UM;
                entity.STATUS                = model.STATUS;
                entity.WAREHOUSE             = model.WAREHOUSE;
                entity.LOCATING_RULE         = model.LOCATING_RULE;
                entity.FROM_LOCATION         = model.FROM_LOCATION;
                entity.TO_LOCATION           = model.TO_LOCATION;
                entity.DATE_TIME_STAMP       = model.DATE_TIME_STAMP;
                entity.ATTRIBUTE_NUM         = model.ATTRIBUTE_NUM;
                entity.ATTRIBUTE1            = model.ATTRIBUTE1;
                entity.ATTRIBUTE2            = model.ATTRIBUTE2;
                entity.ATTRIBUTE3            = model.ATTRIBUTE3;
                entity.ATTRIBUTE4            = model.ATTRIBUTE4;
                entity.ATTRIBUTE5            = model.ATTRIBUTE5;
                entity.ATTRIBUTE6            = model.ATTRIBUTE6;
                entity.ATTRIBUTE7            = model.ATTRIBUTE7;
                entity.ATTRIBUTE8            = model.ATTRIBUTE8;
                entity.INVENTORY_STS         = model.INVENTORY_STS;
                entity.USER_STAMP            = model.USER_STAMP;
                entity.TASK_CREATED          = model.TASK_CREATED;
                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.UPLOAD_INTERFACE_FLAG = model.UPLOAD_INTERFACE_FLAG;
                entity.CONVERTED_QTY         = model.CONVERTED_QTY;
                entity.CONVERTED_QTY_UM      = model.CONVERTED_QTY_UM;
                entity.RECEIVING_CART_ID     = model.RECEIVING_CART_ID;
                entity.RECEIVING_CART_POS    = model.RECEIVING_CART_POS;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.RECEIPT.RECEIPT_CONTAINER_MODEL);
                Type typeE = typeof(Apps.Models.RECEIPT_CONTAINER);
                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);
        }