public virtual Apps.Models.SCV.UPLOAD.UPLOAD_RECEIPTS_MODEL GetById(string id) { Apps.Models.UPLOAD_RECEIPTS entity = m_Rep.GetById(id); if (entity != null) { //UPLOAD_RECEIPTS entity = m_Rep.GetById(id); Apps.Models.SCV.UPLOAD.UPLOAD_RECEIPTS_MODEL model = new Apps.Models.SCV.UPLOAD.UPLOAD_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.CLOSE_DATE = entity.CLOSE_DATE; model.ITEM = entity.ITEM; model.ATTRIBUTE1 = entity.ATTRIBUTE1; model.ATTRIBUTE2 = entity.ATTRIBUTE2; model.ATTRIBUTE3 = entity.ATTRIBUTE3; model.TOTAL_QTY = entity.TOTAL_QTY; model.INVENTORY_STS = entity.INVENTORY_STS; model.ERP_ORDER_ID = entity.ERP_ORDER_ID; model.ERP_ORDER_LINE_NUM = entity.ERP_ORDER_LINE_NUM; 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; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.UPLOAD.UPLOAD_RECEIPTS_MODEL model) { Apps.Models.UPLOAD_RECEIPTS entity = m_Rep.GetById(model.INTERFACE_RECORD_ID); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.UPLOAD_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.CLOSE_DATE = model.CLOSE_DATE; entity.ITEM = model.ITEM; entity.ATTRIBUTE1 = model.ATTRIBUTE1; entity.ATTRIBUTE2 = model.ATTRIBUTE2; entity.ATTRIBUTE3 = model.ATTRIBUTE3; entity.TOTAL_QTY = model.TOTAL_QTY; entity.INVENTORY_STS = model.INVENTORY_STS; entity.ERP_ORDER_ID = model.ERP_ORDER_ID; entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM; 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; m_Rep.Create(entity); }
public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.UPLOAD.UPLOAD_RECEIPTS_MODEL model, params string[] updateProperties) { Apps.Models.UPLOAD_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.CLOSE_DATE = model.CLOSE_DATE; entity.ITEM = model.ITEM; entity.ATTRIBUTE1 = model.ATTRIBUTE1; entity.ATTRIBUTE2 = model.ATTRIBUTE2; entity.ATTRIBUTE3 = model.ATTRIBUTE3; entity.TOTAL_QTY = model.TOTAL_QTY; entity.INVENTORY_STS = model.INVENTORY_STS; entity.ERP_ORDER_ID = model.ERP_ORDER_ID; entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM; 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; } else { Type type = typeof(Apps.Models.SCV.UPLOAD.UPLOAD_RECEIPTS_MODEL); Type typeE = typeof(Apps.Models.UPLOAD_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); }