public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.AR.AR_TASK_HEADER_MODEL model, params string[] updateProperties) { Apps.Models.AR_TASK_HEADER entity = m_Rep.GetById(model.INTERNAL_TASK_NUM); if (entity == null) { errors.Add(Resource.Disable); return; } if (updateProperties.Count() <= 0) { entity.INTERNAL_TASK_NUM = model.INTERNAL_TASK_NUM; entity.WAREHOUSE = model.WAREHOUSE; entity.COMPANY = model.COMPANY; entity.TASK_ID = model.TASK_ID; entity.TASK_TYPE = model.TASK_TYPE; entity.INTERNAL_TASK_TYPE = model.INTERNAL_TASK_TYPE; entity.REFERENCE_NUM = model.REFERENCE_NUM; entity.REFERENCE_ID = model.REFERENCE_ID; entity.REFERENCE_NUM_TYPE = model.REFERENCE_NUM_TYPE; entity.ASSIGNED_USER = model.ASSIGNED_USER; entity.CONFIRM_USER = model.CONFIRM_USER; entity.CONDITION = model.CONDITION; entity.HOLD_CODE = model.HOLD_CODE; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.INTERNAL_WAVE_NUM = model.INTERNAL_WAVE_NUM; entity.PICKING_CART_ID = model.PICKING_CART_ID; entity.TRANS_CONT_ID = model.TRANS_CONT_ID; 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.AGING_DATE_TIME = model.AGING_DATE_TIME; entity.START_DATE_TIME = model.START_DATE_TIME; entity.END_DATE_TIME = model.END_DATE_TIME; entity.LOCKED = model.LOCKED; } else { Type type = typeof(Apps.Models.SCV.AR.AR_TASK_HEADER_MODEL); Type typeE = typeof(Apps.Models.AR_TASK_HEADER); 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.AR.AR_TASK_HEADER_MODEL GetById(string id) { Apps.Models.AR_TASK_HEADER entity = m_Rep.GetById(id); if (entity != null) { //AR_TASK_HEADER entity = m_Rep.GetById(id); Apps.Models.SCV.AR.AR_TASK_HEADER_MODEL model = new Apps.Models.SCV.AR.AR_TASK_HEADER_MODEL(); model.INTERNAL_TASK_NUM = entity.INTERNAL_TASK_NUM; model.WAREHOUSE = entity.WAREHOUSE; model.COMPANY = entity.COMPANY; model.TASK_ID = entity.TASK_ID; model.TASK_TYPE = entity.TASK_TYPE; model.INTERNAL_TASK_TYPE = entity.INTERNAL_TASK_TYPE; model.REFERENCE_NUM = entity.REFERENCE_NUM; model.REFERENCE_ID = entity.REFERENCE_ID; model.REFERENCE_NUM_TYPE = entity.REFERENCE_NUM_TYPE; model.ASSIGNED_USER = entity.ASSIGNED_USER; model.CONFIRM_USER = entity.CONFIRM_USER; model.CONDITION = entity.CONDITION; model.HOLD_CODE = entity.HOLD_CODE; model.USER_STAMP = entity.USER_STAMP; model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP; model.INTERNAL_WAVE_NUM = entity.INTERNAL_WAVE_NUM; model.PICKING_CART_ID = entity.PICKING_CART_ID; model.TRANS_CONT_ID = entity.TRANS_CONT_ID; 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.AGING_DATE_TIME = entity.AGING_DATE_TIME; model.START_DATE_TIME = entity.START_DATE_TIME; model.END_DATE_TIME = entity.END_DATE_TIME; model.LOCKED = entity.LOCKED; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.AR.AR_TASK_HEADER_MODEL model) { Apps.Models.AR_TASK_HEADER entity = m_Rep.GetById(model.INTERNAL_TASK_NUM); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.AR_TASK_HEADER(); entity.INTERNAL_TASK_NUM = model.INTERNAL_TASK_NUM; entity.WAREHOUSE = model.WAREHOUSE; entity.COMPANY = model.COMPANY; entity.TASK_ID = model.TASK_ID; entity.TASK_TYPE = model.TASK_TYPE; entity.INTERNAL_TASK_TYPE = model.INTERNAL_TASK_TYPE; entity.REFERENCE_NUM = model.REFERENCE_NUM; entity.REFERENCE_ID = model.REFERENCE_ID; entity.REFERENCE_NUM_TYPE = model.REFERENCE_NUM_TYPE; entity.ASSIGNED_USER = model.ASSIGNED_USER; entity.CONFIRM_USER = model.CONFIRM_USER; entity.CONDITION = model.CONDITION; entity.HOLD_CODE = model.HOLD_CODE; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.INTERNAL_WAVE_NUM = model.INTERNAL_WAVE_NUM; entity.PICKING_CART_ID = model.PICKING_CART_ID; entity.TRANS_CONT_ID = model.TRANS_CONT_ID; 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.AGING_DATE_TIME = model.AGING_DATE_TIME; entity.START_DATE_TIME = model.START_DATE_TIME; entity.END_DATE_TIME = model.END_DATE_TIME; entity.LOCKED = model.LOCKED; m_Rep.Create(entity); }