public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.UPLOAD.UPLOAD_SHIPMENT_HISTORY_MODEL model, params string[] updateProperties) { Apps.Models.UPLOAD_SHIPMENT_HISTORY 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.INTERNAL_SHIPMENT_NUM = model.INTERNAL_SHIPMENT_NUM; entity.SHIPMENT_ID = model.SHIPMENT_ID; entity.WAREHOUSE = model.WAREHOUSE; entity.COMPANY = model.COMPANY; entity.LEADING_STS = model.LEADING_STS; entity.TRAILING_STS = model.TRAILING_STS; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; 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.UPLOAD_FLAG = model.UPLOAD_FLAG; entity.UPLOAD_TIME = model.UPLOAD_TIME; entity.UPLOAD_STATUS = model.UPLOAD_STATUS; entity.CALL_BACK_TIME = model.CALL_BACK_TIME; } else { Type type = typeof(Apps.Models.SCV.UPLOAD.UPLOAD_SHIPMENT_HISTORY_MODEL); Type typeE = typeof(Apps.Models.UPLOAD_SHIPMENT_HISTORY); 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); }
public virtual Apps.Models.SCV.UPLOAD.UPLOAD_SHIPMENT_HISTORY_MODEL GetById(string id) { Apps.Models.UPLOAD_SHIPMENT_HISTORY entity = m_Rep.GetById(id); if (entity != null) { //UPLOAD_SHIPMENT_HISTORY entity = m_Rep.GetById(id); Apps.Models.SCV.UPLOAD.UPLOAD_SHIPMENT_HISTORY_MODEL model = new Apps.Models.SCV.UPLOAD.UPLOAD_SHIPMENT_HISTORY_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.INTERNAL_SHIPMENT_NUM = entity.INTERNAL_SHIPMENT_NUM; model.SHIPMENT_ID = entity.SHIPMENT_ID; model.WAREHOUSE = entity.WAREHOUSE; model.COMPANY = entity.COMPANY; model.LEADING_STS = entity.LEADING_STS; model.TRAILING_STS = entity.TRAILING_STS; model.USER_STAMP = entity.USER_STAMP; model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP; 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.UPLOAD_FLAG = entity.UPLOAD_FLAG; model.UPLOAD_TIME = entity.UPLOAD_TIME; model.UPLOAD_STATUS = entity.UPLOAD_STATUS; model.CALL_BACK_TIME = entity.CALL_BACK_TIME; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.UPLOAD.UPLOAD_SHIPMENT_HISTORY_MODEL model) { Apps.Models.UPLOAD_SHIPMENT_HISTORY entity = m_Rep.GetById(model.INTERFACE_RECORD_ID); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.UPLOAD_SHIPMENT_HISTORY(); 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.INTERNAL_SHIPMENT_NUM = model.INTERNAL_SHIPMENT_NUM; entity.SHIPMENT_ID = model.SHIPMENT_ID; entity.WAREHOUSE = model.WAREHOUSE; entity.COMPANY = model.COMPANY; entity.LEADING_STS = model.LEADING_STS; entity.TRAILING_STS = model.TRAILING_STS; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; 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.UPLOAD_FLAG = model.UPLOAD_FLAG; entity.UPLOAD_TIME = model.UPLOAD_TIME; entity.UPLOAD_STATUS = model.UPLOAD_STATUS; entity.CALL_BACK_TIME = model.CALL_BACK_TIME; m_Rep.Create(entity); }