public virtual Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_DETAIL_MODEL GetById(string id)
        {
            Apps.Models.AR_UPLOAD_RECEIPT_DETAIL entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //AR_UPLOAD_RECEIPT_DETAIL entity = m_Rep.GetById(id);
                Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_DETAIL_MODEL model = new Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_DETAIL_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.RECEIPT_ID            = entity.RECEIPT_ID;
                model.WAREHOUSE             = entity.WAREHOUSE;
                model.COMPANY            = entity.COMPANY;
                model.ITEM               = entity.ITEM;
                model.ITEM_DESC          = entity.ITEM_DESC;
                model.ITEM_CLASS         = entity.ITEM_CLASS;
                model.ATTRIBUTE_TRACK    = entity.ATTRIBUTE_TRACK;
                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.TOTAL_QTY          = entity.TOTAL_QTY;
                model.OPEN_QTY           = entity.OPEN_QTY;
                model.QUANTITY_UM        = entity.QUANTITY_UM;
                model.ERP_ORDER_ID       = entity.ERP_ORDER_ID;
                model.ERP_ORDER_LINE_NUM = entity.ERP_ORDER_LINE_NUM;
                model.LOCATING_RULE      = entity.LOCATING_RULE;
                model.USER_STAMP         = entity.USER_STAMP;
                model.DATE_TIME_STAMP    = entity.DATE_TIME_STAMP;
                model.INVENTORY_STS      = entity.INVENTORY_STS;
                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.ITEM_LIST_PRICE    = entity.ITEM_LIST_PRICE;
                model.ITEM_NET_PRICE     = entity.ITEM_NET_PRICE;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_DETAIL_MODEL model)
        {
            Apps.Models.AR_UPLOAD_RECEIPT_DETAIL entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.AR_UPLOAD_RECEIPT_DETAIL();
            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.RECEIPT_ID            = model.RECEIPT_ID;
            entity.WAREHOUSE             = model.WAREHOUSE;
            entity.COMPANY            = model.COMPANY;
            entity.ITEM               = model.ITEM;
            entity.ITEM_DESC          = model.ITEM_DESC;
            entity.ITEM_CLASS         = model.ITEM_CLASS;
            entity.ATTRIBUTE_TRACK    = model.ATTRIBUTE_TRACK;
            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.TOTAL_QTY          = model.TOTAL_QTY;
            entity.OPEN_QTY           = model.OPEN_QTY;
            entity.QUANTITY_UM        = model.QUANTITY_UM;
            entity.ERP_ORDER_ID       = model.ERP_ORDER_ID;
            entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM;
            entity.LOCATING_RULE      = model.LOCATING_RULE;
            entity.USER_STAMP         = model.USER_STAMP;
            entity.DATE_TIME_STAMP    = model.DATE_TIME_STAMP;
            entity.INVENTORY_STS      = model.INVENTORY_STS;
            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.ITEM_LIST_PRICE    = model.ITEM_LIST_PRICE;
            entity.ITEM_NET_PRICE     = model.ITEM_NET_PRICE;

            m_Rep.Create(entity);
        }
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_DETAIL_MODEL model, params string[] updateProperties)
        {
            Apps.Models.AR_UPLOAD_RECEIPT_DETAIL 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.RECEIPT_ID            = model.RECEIPT_ID;
                entity.WAREHOUSE             = model.WAREHOUSE;
                entity.COMPANY            = model.COMPANY;
                entity.ITEM               = model.ITEM;
                entity.ITEM_DESC          = model.ITEM_DESC;
                entity.ITEM_CLASS         = model.ITEM_CLASS;
                entity.ATTRIBUTE_TRACK    = model.ATTRIBUTE_TRACK;
                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.TOTAL_QTY          = model.TOTAL_QTY;
                entity.OPEN_QTY           = model.OPEN_QTY;
                entity.QUANTITY_UM        = model.QUANTITY_UM;
                entity.ERP_ORDER_ID       = model.ERP_ORDER_ID;
                entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM;
                entity.LOCATING_RULE      = model.LOCATING_RULE;
                entity.USER_STAMP         = model.USER_STAMP;
                entity.DATE_TIME_STAMP    = model.DATE_TIME_STAMP;
                entity.INVENTORY_STS      = model.INVENTORY_STS;
                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.ITEM_LIST_PRICE    = model.ITEM_LIST_PRICE;
                entity.ITEM_NET_PRICE     = model.ITEM_NET_PRICE;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_DETAIL_MODEL);
                Type typeE = typeof(Apps.Models.AR_UPLOAD_RECEIPT_DETAIL);
                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);
        }