public virtual Apps.Models.SCV.RECEIPT.RECEIPT_LOCATE_REQUEST_MODEL GetById(string id)
        {
            Apps.Models.RECEIPT_LOCATE_REQUEST entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //RECEIPT_LOCATE_REQUEST entity = m_Rep.GetById(id);
                Apps.Models.SCV.RECEIPT.RECEIPT_LOCATE_REQUEST_MODEL model = new Apps.Models.SCV.RECEIPT.RECEIPT_LOCATE_REQUEST_MODEL();
                model.INTERNAL_REC_LOC_NUM = entity.INTERNAL_REC_LOC_NUM;
                model.WAREHOUSE            = entity.WAREHOUSE;
                model.COMPANY = entity.COMPANY;
                model.INTERNAL_CONTAINER_NUM = entity.INTERNAL_CONTAINER_NUM;
                model.CONTAINER_ID           = entity.CONTAINER_ID;
                model.ITEM                      = entity.ITEM;
                model.ITEM_DESC                 = entity.ITEM_DESC;
                model.LOCATE_QTY                = entity.LOCATE_QTY;
                model.QUANTITY_UM               = entity.QUANTITY_UM;
                model.ATTRIBUTE_NUM             = entity.ATTRIBUTE_NUM;
                model.INVENTORY_STS             = entity.INVENTORY_STS;
                model.FROM_LOC                  = entity.FROM_LOC;
                model.TO_LOC                    = entity.TO_LOC;
                model.FROM_TEMPLATE_FIELD1      = entity.FROM_TEMPLATE_FIELD1;
                model.FROM_TEMPLATE_FIELD2      = entity.FROM_TEMPLATE_FIELD2;
                model.FROM_TEMPLATE_FIELD3      = entity.FROM_TEMPLATE_FIELD3;
                model.FROM_TEMPLATE_FIELD4      = entity.FROM_TEMPLATE_FIELD4;
                model.FROM_TEMPLATE_FIELD5      = entity.FROM_TEMPLATE_FIELD5;
                model.TO_TEMPLATE_FIELD1        = entity.TO_TEMPLATE_FIELD1;
                model.TO_TEMPLATE_FIELD2        = entity.TO_TEMPLATE_FIELD2;
                model.TO_TEMPLATE_FIELD3        = entity.TO_TEMPLATE_FIELD3;
                model.TO_TEMPLATE_FIELD4        = entity.TO_TEMPLATE_FIELD4;
                model.TO_TEMPLATE_FIELD5        = entity.TO_TEMPLATE_FIELD5;
                model.ZONE                      = entity.ZONE;
                model.CONVERTED_QTY             = entity.CONVERTED_QTY;
                model.CONVERTED_QTY_UM          = entity.CONVERTED_QTY_UM;
                model.TASK_CREATED              = entity.TASK_CREATED;
                model.RECEIPT_ID                = entity.RECEIPT_ID;
                model.RECEIPT_TYPE              = entity.RECEIPT_TYPE;
                model.RECEIPT_DATE              = entity.RECEIPT_DATE;
                model.PARENT_CONTAINER_NUM      = entity.PARENT_CONTAINER_NUM;
                model.PARENT_CONTAINER_ID       = entity.PARENT_CONTAINER_ID;
                model.INTERNAL_RECEIPT_NUM      = entity.INTERNAL_RECEIPT_NUM;
                model.INTERNAL_RECEIPT_LINE_NUM = entity.INTERNAL_RECEIPT_LINE_NUM;
                model.USER_STAMP                = entity.USER_STAMP;
                model.DATE_TIME_STAMP           = entity.DATE_TIME_STAMP;
                model.INTERNAL_WAVE_NUM         = entity.INTERNAL_WAVE_NUM;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.RECEIPT.RECEIPT_LOCATE_REQUEST_MODEL model)
        {
            Apps.Models.RECEIPT_LOCATE_REQUEST entity = m_Rep.GetById(model.INTERNAL_REC_LOC_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.RECEIPT_LOCATE_REQUEST();
            entity.INTERNAL_REC_LOC_NUM = model.INTERNAL_REC_LOC_NUM;
            entity.WAREHOUSE            = model.WAREHOUSE;
            entity.COMPANY = model.COMPANY;
            entity.INTERNAL_CONTAINER_NUM = model.INTERNAL_CONTAINER_NUM;
            entity.CONTAINER_ID           = model.CONTAINER_ID;
            entity.ITEM                      = model.ITEM;
            entity.ITEM_DESC                 = model.ITEM_DESC;
            entity.LOCATE_QTY                = model.LOCATE_QTY;
            entity.QUANTITY_UM               = model.QUANTITY_UM;
            entity.ATTRIBUTE_NUM             = model.ATTRIBUTE_NUM;
            entity.INVENTORY_STS             = model.INVENTORY_STS;
            entity.FROM_LOC                  = model.FROM_LOC;
            entity.TO_LOC                    = model.TO_LOC;
            entity.FROM_TEMPLATE_FIELD1      = model.FROM_TEMPLATE_FIELD1;
            entity.FROM_TEMPLATE_FIELD2      = model.FROM_TEMPLATE_FIELD2;
            entity.FROM_TEMPLATE_FIELD3      = model.FROM_TEMPLATE_FIELD3;
            entity.FROM_TEMPLATE_FIELD4      = model.FROM_TEMPLATE_FIELD4;
            entity.FROM_TEMPLATE_FIELD5      = model.FROM_TEMPLATE_FIELD5;
            entity.TO_TEMPLATE_FIELD1        = model.TO_TEMPLATE_FIELD1;
            entity.TO_TEMPLATE_FIELD2        = model.TO_TEMPLATE_FIELD2;
            entity.TO_TEMPLATE_FIELD3        = model.TO_TEMPLATE_FIELD3;
            entity.TO_TEMPLATE_FIELD4        = model.TO_TEMPLATE_FIELD4;
            entity.TO_TEMPLATE_FIELD5        = model.TO_TEMPLATE_FIELD5;
            entity.ZONE                      = model.ZONE;
            entity.CONVERTED_QTY             = model.CONVERTED_QTY;
            entity.CONVERTED_QTY_UM          = model.CONVERTED_QTY_UM;
            entity.TASK_CREATED              = model.TASK_CREATED;
            entity.RECEIPT_ID                = model.RECEIPT_ID;
            entity.RECEIPT_TYPE              = model.RECEIPT_TYPE;
            entity.RECEIPT_DATE              = model.RECEIPT_DATE;
            entity.PARENT_CONTAINER_NUM      = model.PARENT_CONTAINER_NUM;
            entity.PARENT_CONTAINER_ID       = model.PARENT_CONTAINER_ID;
            entity.INTERNAL_RECEIPT_NUM      = model.INTERNAL_RECEIPT_NUM;
            entity.INTERNAL_RECEIPT_LINE_NUM = model.INTERNAL_RECEIPT_LINE_NUM;
            entity.USER_STAMP                = model.USER_STAMP;
            entity.DATE_TIME_STAMP           = model.DATE_TIME_STAMP;
            entity.INTERNAL_WAVE_NUM         = model.INTERNAL_WAVE_NUM;

            m_Rep.Create(entity);
        }
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.RECEIPT.RECEIPT_LOCATE_REQUEST_MODEL model, params string[] updateProperties)
        {
            Apps.Models.RECEIPT_LOCATE_REQUEST entity = m_Rep.GetById(model.INTERNAL_REC_LOC_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_REC_LOC_NUM = model.INTERNAL_REC_LOC_NUM;
                entity.WAREHOUSE            = model.WAREHOUSE;
                entity.COMPANY = model.COMPANY;
                entity.INTERNAL_CONTAINER_NUM = model.INTERNAL_CONTAINER_NUM;
                entity.CONTAINER_ID           = model.CONTAINER_ID;
                entity.ITEM                      = model.ITEM;
                entity.ITEM_DESC                 = model.ITEM_DESC;
                entity.LOCATE_QTY                = model.LOCATE_QTY;
                entity.QUANTITY_UM               = model.QUANTITY_UM;
                entity.ATTRIBUTE_NUM             = model.ATTRIBUTE_NUM;
                entity.INVENTORY_STS             = model.INVENTORY_STS;
                entity.FROM_LOC                  = model.FROM_LOC;
                entity.TO_LOC                    = model.TO_LOC;
                entity.FROM_TEMPLATE_FIELD1      = model.FROM_TEMPLATE_FIELD1;
                entity.FROM_TEMPLATE_FIELD2      = model.FROM_TEMPLATE_FIELD2;
                entity.FROM_TEMPLATE_FIELD3      = model.FROM_TEMPLATE_FIELD3;
                entity.FROM_TEMPLATE_FIELD4      = model.FROM_TEMPLATE_FIELD4;
                entity.FROM_TEMPLATE_FIELD5      = model.FROM_TEMPLATE_FIELD5;
                entity.TO_TEMPLATE_FIELD1        = model.TO_TEMPLATE_FIELD1;
                entity.TO_TEMPLATE_FIELD2        = model.TO_TEMPLATE_FIELD2;
                entity.TO_TEMPLATE_FIELD3        = model.TO_TEMPLATE_FIELD3;
                entity.TO_TEMPLATE_FIELD4        = model.TO_TEMPLATE_FIELD4;
                entity.TO_TEMPLATE_FIELD5        = model.TO_TEMPLATE_FIELD5;
                entity.ZONE                      = model.ZONE;
                entity.CONVERTED_QTY             = model.CONVERTED_QTY;
                entity.CONVERTED_QTY_UM          = model.CONVERTED_QTY_UM;
                entity.TASK_CREATED              = model.TASK_CREATED;
                entity.RECEIPT_ID                = model.RECEIPT_ID;
                entity.RECEIPT_TYPE              = model.RECEIPT_TYPE;
                entity.RECEIPT_DATE              = model.RECEIPT_DATE;
                entity.PARENT_CONTAINER_NUM      = model.PARENT_CONTAINER_NUM;
                entity.PARENT_CONTAINER_ID       = model.PARENT_CONTAINER_ID;
                entity.INTERNAL_RECEIPT_NUM      = model.INTERNAL_RECEIPT_NUM;
                entity.INTERNAL_RECEIPT_LINE_NUM = model.INTERNAL_RECEIPT_LINE_NUM;
                entity.USER_STAMP                = model.USER_STAMP;
                entity.DATE_TIME_STAMP           = model.DATE_TIME_STAMP;
                entity.INTERNAL_WAVE_NUM         = model.INTERNAL_WAVE_NUM;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.RECEIPT.RECEIPT_LOCATE_REQUEST_MODEL);
                Type typeE = typeof(Apps.Models.RECEIPT_LOCATE_REQUEST);
                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);
        }