public virtual Apps.Models.SCV.QUEUE.QUEUE_TASK_IN_CONFIRM_MODEL GetById(string id) { Apps.Models.QUEUE_TASK_IN_CONFIRM entity = m_Rep.GetById(id); if (entity != null) { //QUEUE_TASK_IN_CONFIRM entity = m_Rep.GetById(id); Apps.Models.SCV.QUEUE.QUEUE_TASK_IN_CONFIRM_MODEL model = new Apps.Models.SCV.QUEUE.QUEUE_TASK_IN_CONFIRM_MODEL(); model.INTERNAL_TASK_LINE_NUM = entity.INTERNAL_TASK_LINE_NUM; model.INTERNAL_TASK_NUM = entity.INTERNAL_TASK_NUM; model.ACTUAL_FROM_LOC = entity.ACTUAL_FROM_LOC; model.ACTUAL_FROM_LPN = entity.ACTUAL_FROM_LPN; model.CONFIRM_QTY = entity.CONFIRM_QTY; model.CONFIRM_USER = entity.CONFIRM_USER; model.QUANTITY_UM = entity.QUANTITY_UM; model.ACTUAL_TO_LOC = entity.ACTUAL_TO_LOC; model.ACTUAL_TO_LPN = entity.ACTUAL_TO_LPN; model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP; model.PROCESS_STAMP = entity.PROCESS_STAMP; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.QUEUE.QUEUE_TASK_IN_CONFIRM_MODEL model) { Apps.Models.QUEUE_TASK_IN_CONFIRM entity = m_Rep.GetById(model.INTERNAL_TASK_LINE_NUM); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.QUEUE_TASK_IN_CONFIRM(); entity.INTERNAL_TASK_LINE_NUM = model.INTERNAL_TASK_LINE_NUM; entity.INTERNAL_TASK_NUM = model.INTERNAL_TASK_NUM; entity.ACTUAL_FROM_LOC = model.ACTUAL_FROM_LOC; entity.ACTUAL_FROM_LPN = model.ACTUAL_FROM_LPN; entity.CONFIRM_QTY = model.CONFIRM_QTY; entity.CONFIRM_USER = model.CONFIRM_USER; entity.QUANTITY_UM = model.QUANTITY_UM; entity.ACTUAL_TO_LOC = model.ACTUAL_TO_LOC; entity.ACTUAL_TO_LPN = model.ACTUAL_TO_LPN; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.PROCESS_STAMP = model.PROCESS_STAMP; m_Rep.Create(entity); }
public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.QUEUE.QUEUE_TASK_IN_CONFIRM_MODEL model, params string[] updateProperties) { Apps.Models.QUEUE_TASK_IN_CONFIRM entity = m_Rep.GetById(model.INTERNAL_TASK_LINE_NUM); if (entity == null) { errors.Add(Resource.Disable); return; } if (updateProperties.Count() <= 0) { entity.INTERNAL_TASK_LINE_NUM = model.INTERNAL_TASK_LINE_NUM; entity.INTERNAL_TASK_NUM = model.INTERNAL_TASK_NUM; entity.ACTUAL_FROM_LOC = model.ACTUAL_FROM_LOC; entity.ACTUAL_FROM_LPN = model.ACTUAL_FROM_LPN; entity.CONFIRM_QTY = model.CONFIRM_QTY; entity.CONFIRM_USER = model.CONFIRM_USER; entity.QUANTITY_UM = model.QUANTITY_UM; entity.ACTUAL_TO_LOC = model.ACTUAL_TO_LOC; entity.ACTUAL_TO_LPN = model.ACTUAL_TO_LPN; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.PROCESS_STAMP = model.PROCESS_STAMP; } else { Type type = typeof(Apps.Models.SCV.QUEUE.QUEUE_TASK_IN_CONFIRM_MODEL); Type typeE = typeof(Apps.Models.QUEUE_TASK_IN_CONFIRM); 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); }