Exemplo n.º 1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.DOWNLOAD.DOWNLOAD_RECEIPTS_MODEL model, params string[] updateProperties)
        {
            Apps.Models.DOWNLOAD_RECEIPTS 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_ACTION_CODE = model.INTERFACE_ACTION_CODE;
                entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
                entity.PROCESS_STAMP         = model.PROCESS_STAMP;
                entity.INTERFACE_GUID        = model.INTERFACE_GUID;
                entity.WAREHOUSE             = model.WAREHOUSE;
                entity.COMPANY                 = model.COMPANY;
                entity.RECEIPT_ID              = model.RECEIPT_ID;
                entity.RECEIPT_TYPE            = model.RECEIPT_TYPE;
                entity.PRIORITY                = model.PRIORITY;
                entity.ERP_ORDER_ID            = model.ERP_ORDER_ID;
                entity.SHIP_FROM               = model.SHIP_FROM;
                entity.SHIP_FROM_ADDRESS1      = model.SHIP_FROM_ADDRESS1;
                entity.SHIP_FROM_ADDRESS2      = model.SHIP_FROM_ADDRESS2;
                entity.SHIP_FROM_CITY          = model.SHIP_FROM_CITY;
                entity.SHIP_FROM_STATE         = model.SHIP_FROM_STATE;
                entity.SHIP_FROM_COUNTRY       = model.SHIP_FROM_COUNTRY;
                entity.SHIP_FROM_POSTAL_CODE   = model.SHIP_FROM_POSTAL_CODE;
                entity.SHIP_FROM_NAME          = model.SHIP_FROM_NAME;
                entity.SHIP_FROM_ATTENTION_TO  = model.SHIP_FROM_ATTENTION_TO;
                entity.SHIP_FROM_EMAIL_ADDRESS = model.SHIP_FROM_EMAIL_ADDRESS;
                entity.SHIP_FROM_PHONE_NUM     = model.SHIP_FROM_PHONE_NUM;
                entity.SHIP_FROM_FAX_NUM       = model.SHIP_FROM_FAX_NUM;
                entity.SCHEDULED_ARRIVE_DATE   = model.SCHEDULED_ARRIVE_DATE;
                entity.ACTUAL_ARRIVE_DATE      = model.ACTUAL_ARRIVE_DATE;
                entity.USER_STAMP              = model.USER_STAMP;
                entity.DATE_TIME_STAMP         = model.DATE_TIME_STAMP;
                entity.TOTAL_QTY               = model.TOTAL_QTY;
                entity.TOTAL_LINES             = model.TOTAL_LINES;
                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.USER_DEF9               = model.USER_DEF9;
                entity.USER_DEF10              = model.USER_DEF10;
                entity.USER_DEF11              = model.USER_DEF11;
                entity.USER_DEF12              = model.USER_DEF12;
                entity.USER_DEF13              = model.USER_DEF13;
                entity.USER_DEF14              = model.USER_DEF14;
                entity.USER_DEF15              = model.USER_DEF15;
                entity.USER_DEF16              = model.USER_DEF16;
                entity.USER_DEF17              = model.USER_DEF17;
                entity.USER_DEF18              = model.USER_DEF18;
                entity.USER_DEF19              = model.USER_DEF19;
                entity.USER_DEF20              = model.USER_DEF20;
                entity.ITEM               = model.ITEM;
                entity.ITEM_DESC          = model.ITEM_DESC;
                entity.TOTAL_QTY_DETAIL   = model.TOTAL_QTY_DETAIL;
                entity.QUANTITY_UM        = model.QUANTITY_UM;
                entity.ATTRIBUTE1         = model.ATTRIBUTE1;
                entity.ATTRIBUTE2         = model.ATTRIBUTE2;
                entity.ATTRIBUTE3         = model.ATTRIBUTE3;
                entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM;
                entity.ITEM_LIST_PRICE    = model.ITEM_LIST_PRICE;
                entity.ITEM_NET_PRICE     = model.ITEM_NET_PRICE;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.DOWNLOAD.DOWNLOAD_RECEIPTS_MODEL);
                Type typeE = typeof(Apps.Models.DOWNLOAD_RECEIPTS);
                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);
        }
Exemplo n.º 2
0
        public virtual Apps.Models.SCV.DOWNLOAD.DOWNLOAD_RECEIPTS_MODEL GetById(string id)
        {
            Apps.Models.DOWNLOAD_RECEIPTS entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //DOWNLOAD_RECEIPTS entity = m_Rep.GetById(id);
                Apps.Models.SCV.DOWNLOAD.DOWNLOAD_RECEIPTS_MODEL model = new Apps.Models.SCV.DOWNLOAD.DOWNLOAD_RECEIPTS_MODEL();
                model.INTERFACE_RECORD_ID   = entity.INTERFACE_RECORD_ID;
                model.INTERFACE_ACTION_CODE = entity.INTERFACE_ACTION_CODE;
                model.INTERFACE_CONDITION   = entity.INTERFACE_CONDITION;
                model.PROCESS_STAMP         = entity.PROCESS_STAMP;
                model.INTERFACE_GUID        = entity.INTERFACE_GUID;
                model.WAREHOUSE             = entity.WAREHOUSE;
                model.COMPANY                 = entity.COMPANY;
                model.RECEIPT_ID              = entity.RECEIPT_ID;
                model.RECEIPT_TYPE            = entity.RECEIPT_TYPE;
                model.PRIORITY                = entity.PRIORITY;
                model.ERP_ORDER_ID            = entity.ERP_ORDER_ID;
                model.SHIP_FROM               = entity.SHIP_FROM;
                model.SHIP_FROM_ADDRESS1      = entity.SHIP_FROM_ADDRESS1;
                model.SHIP_FROM_ADDRESS2      = entity.SHIP_FROM_ADDRESS2;
                model.SHIP_FROM_CITY          = entity.SHIP_FROM_CITY;
                model.SHIP_FROM_STATE         = entity.SHIP_FROM_STATE;
                model.SHIP_FROM_COUNTRY       = entity.SHIP_FROM_COUNTRY;
                model.SHIP_FROM_POSTAL_CODE   = entity.SHIP_FROM_POSTAL_CODE;
                model.SHIP_FROM_NAME          = entity.SHIP_FROM_NAME;
                model.SHIP_FROM_ATTENTION_TO  = entity.SHIP_FROM_ATTENTION_TO;
                model.SHIP_FROM_EMAIL_ADDRESS = entity.SHIP_FROM_EMAIL_ADDRESS;
                model.SHIP_FROM_PHONE_NUM     = entity.SHIP_FROM_PHONE_NUM;
                model.SHIP_FROM_FAX_NUM       = entity.SHIP_FROM_FAX_NUM;
                model.SCHEDULED_ARRIVE_DATE   = entity.SCHEDULED_ARRIVE_DATE;
                model.ACTUAL_ARRIVE_DATE      = entity.ACTUAL_ARRIVE_DATE;
                model.USER_STAMP              = entity.USER_STAMP;
                model.DATE_TIME_STAMP         = entity.DATE_TIME_STAMP;
                model.TOTAL_QTY               = entity.TOTAL_QTY;
                model.TOTAL_LINES             = entity.TOTAL_LINES;
                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.USER_DEF9               = entity.USER_DEF9;
                model.USER_DEF10              = entity.USER_DEF10;
                model.USER_DEF11              = entity.USER_DEF11;
                model.USER_DEF12              = entity.USER_DEF12;
                model.USER_DEF13              = entity.USER_DEF13;
                model.USER_DEF14              = entity.USER_DEF14;
                model.USER_DEF15              = entity.USER_DEF15;
                model.USER_DEF16              = entity.USER_DEF16;
                model.USER_DEF17              = entity.USER_DEF17;
                model.USER_DEF18              = entity.USER_DEF18;
                model.USER_DEF19              = entity.USER_DEF19;
                model.USER_DEF20              = entity.USER_DEF20;
                model.ITEM               = entity.ITEM;
                model.ITEM_DESC          = entity.ITEM_DESC;
                model.TOTAL_QTY_DETAIL   = entity.TOTAL_QTY_DETAIL;
                model.QUANTITY_UM        = entity.QUANTITY_UM;
                model.ATTRIBUTE1         = entity.ATTRIBUTE1;
                model.ATTRIBUTE2         = entity.ATTRIBUTE2;
                model.ATTRIBUTE3         = entity.ATTRIBUTE3;
                model.ERP_ORDER_LINE_NUM = entity.ERP_ORDER_LINE_NUM;
                model.ITEM_LIST_PRICE    = entity.ITEM_LIST_PRICE;
                model.ITEM_NET_PRICE     = entity.ITEM_NET_PRICE;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.DOWNLOAD.DOWNLOAD_RECEIPTS_MODEL model)
        {
            Apps.Models.DOWNLOAD_RECEIPTS entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.DOWNLOAD_RECEIPTS();
            entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
            entity.INTERFACE_ACTION_CODE = model.INTERFACE_ACTION_CODE;
            entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
            entity.PROCESS_STAMP         = model.PROCESS_STAMP;
            entity.INTERFACE_GUID        = model.INTERFACE_GUID;
            entity.WAREHOUSE             = model.WAREHOUSE;
            entity.COMPANY                 = model.COMPANY;
            entity.RECEIPT_ID              = model.RECEIPT_ID;
            entity.RECEIPT_TYPE            = model.RECEIPT_TYPE;
            entity.PRIORITY                = model.PRIORITY;
            entity.ERP_ORDER_ID            = model.ERP_ORDER_ID;
            entity.SHIP_FROM               = model.SHIP_FROM;
            entity.SHIP_FROM_ADDRESS1      = model.SHIP_FROM_ADDRESS1;
            entity.SHIP_FROM_ADDRESS2      = model.SHIP_FROM_ADDRESS2;
            entity.SHIP_FROM_CITY          = model.SHIP_FROM_CITY;
            entity.SHIP_FROM_STATE         = model.SHIP_FROM_STATE;
            entity.SHIP_FROM_COUNTRY       = model.SHIP_FROM_COUNTRY;
            entity.SHIP_FROM_POSTAL_CODE   = model.SHIP_FROM_POSTAL_CODE;
            entity.SHIP_FROM_NAME          = model.SHIP_FROM_NAME;
            entity.SHIP_FROM_ATTENTION_TO  = model.SHIP_FROM_ATTENTION_TO;
            entity.SHIP_FROM_EMAIL_ADDRESS = model.SHIP_FROM_EMAIL_ADDRESS;
            entity.SHIP_FROM_PHONE_NUM     = model.SHIP_FROM_PHONE_NUM;
            entity.SHIP_FROM_FAX_NUM       = model.SHIP_FROM_FAX_NUM;
            entity.SCHEDULED_ARRIVE_DATE   = model.SCHEDULED_ARRIVE_DATE;
            entity.ACTUAL_ARRIVE_DATE      = model.ACTUAL_ARRIVE_DATE;
            entity.USER_STAMP              = model.USER_STAMP;
            entity.DATE_TIME_STAMP         = model.DATE_TIME_STAMP;
            entity.TOTAL_QTY               = model.TOTAL_QTY;
            entity.TOTAL_LINES             = model.TOTAL_LINES;
            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.USER_DEF9               = model.USER_DEF9;
            entity.USER_DEF10              = model.USER_DEF10;
            entity.USER_DEF11              = model.USER_DEF11;
            entity.USER_DEF12              = model.USER_DEF12;
            entity.USER_DEF13              = model.USER_DEF13;
            entity.USER_DEF14              = model.USER_DEF14;
            entity.USER_DEF15              = model.USER_DEF15;
            entity.USER_DEF16              = model.USER_DEF16;
            entity.USER_DEF17              = model.USER_DEF17;
            entity.USER_DEF18              = model.USER_DEF18;
            entity.USER_DEF19              = model.USER_DEF19;
            entity.USER_DEF20              = model.USER_DEF20;
            entity.ITEM               = model.ITEM;
            entity.ITEM_DESC          = model.ITEM_DESC;
            entity.TOTAL_QTY_DETAIL   = model.TOTAL_QTY_DETAIL;
            entity.QUANTITY_UM        = model.QUANTITY_UM;
            entity.ATTRIBUTE1         = model.ATTRIBUTE1;
            entity.ATTRIBUTE2         = model.ATTRIBUTE2;
            entity.ATTRIBUTE3         = model.ATTRIBUTE3;
            entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM;
            entity.ITEM_LIST_PRICE    = model.ITEM_LIST_PRICE;
            entity.ITEM_NET_PRICE     = model.ITEM_NET_PRICE;

            m_Rep.Create(entity);
        }