public virtual Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_CONTAINER_MODEL GetById(string id)
        {
            Apps.Models.AR_UPLOAD_RECEIPT_CONTAINER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //AR_UPLOAD_RECEIPT_CONTAINER entity = m_Rep.GetById(id);
                Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_CONTAINER_MODEL model = new Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_CONTAINER_MODEL();
                model.INTERFACE_RECORD_ID       = entity.INTERFACE_RECORD_ID;
                model.INTERFACE_LINK_ID         = entity.INTERFACE_LINK_ID;
                model.INTERFACE_ACTION_CODE     = entity.INTERFACE_ACTION_CODE;
                model.INTERFACE_CONDITION       = entity.INTERFACE_CONDITION;
                model.PROCESS_STAMP             = entity.PROCESS_STAMP;
                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.ERP_ORDER_LINE_NUM = entity.ERP_ORDER_LINE_NUM;
                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;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_CONTAINER_MODEL model)
        {
            Apps.Models.AR_UPLOAD_RECEIPT_CONTAINER entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.AR_UPLOAD_RECEIPT_CONTAINER();
            entity.INTERFACE_RECORD_ID       = model.INTERFACE_RECORD_ID;
            entity.INTERFACE_LINK_ID         = model.INTERFACE_LINK_ID;
            entity.INTERFACE_ACTION_CODE     = model.INTERFACE_ACTION_CODE;
            entity.INTERFACE_CONDITION       = model.INTERFACE_CONDITION;
            entity.PROCESS_STAMP             = model.PROCESS_STAMP;
            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.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM;
            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;

            m_Rep.Create(entity);
        }
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_CONTAINER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.AR_UPLOAD_RECEIPT_CONTAINER entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERFACE_RECORD_ID       = model.INTERFACE_RECORD_ID;
                entity.INTERFACE_LINK_ID         = model.INTERFACE_LINK_ID;
                entity.INTERFACE_ACTION_CODE     = model.INTERFACE_ACTION_CODE;
                entity.INTERFACE_CONDITION       = model.INTERFACE_CONDITION;
                entity.PROCESS_STAMP             = model.PROCESS_STAMP;
                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.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM;
                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;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_CONTAINER_MODEL);
                Type typeE = typeof(Apps.Models.AR_UPLOAD_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);
        }