public virtual Apps.Models.SCV.STATUS.STATUS_FLOW_HEADER_MODEL GetById(string id) { Apps.Models.STATUS_FLOW_HEADER entity = m_Rep.GetById(id); if (entity != null) { //STATUS_FLOW_HEADER entity = m_Rep.GetById(id); Apps.Models.SCV.STATUS.STATUS_FLOW_HEADER_MODEL model = new Apps.Models.SCV.STATUS.STATUS_FLOW_HEADER_MODEL(); model.INTERNAL_NUM = entity.INTERNAL_NUM; model.STATUS_FLOW = entity.STATUS_FLOW; model.STATUS_FLOW_NAME = entity.STATUS_FLOW_NAME; model.STATUS_FLOW_TYPE = entity.STATUS_FLOW_TYPE; model.ACTIVE = entity.ACTIVE; model.CREATE_USER = entity.CREATE_USER; model.CREATE_DATE_TIME = entity.CREATE_DATE_TIME; model.LAST_MODIFY_USER = entity.LAST_MODIFY_USER; model.LAST_MODIFY_DATE_TIME = entity.LAST_MODIFY_DATE_TIME; model.USER_DEF1 = entity.USER_DEF1; model.USER_DEF2 = entity.USER_DEF2; model.USER_DEF3 = entity.USER_DEF3; model.USER_DEF4 = entity.USER_DEF4; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.STATUS.STATUS_FLOW_HEADER_MODEL model) { Apps.Models.STATUS_FLOW_HEADER entity = m_Rep.GetById(model.INTERNAL_NUM); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.STATUS_FLOW_HEADER(); entity.INTERNAL_NUM = model.INTERNAL_NUM; entity.STATUS_FLOW = model.STATUS_FLOW; entity.STATUS_FLOW_NAME = model.STATUS_FLOW_NAME; entity.STATUS_FLOW_TYPE = model.STATUS_FLOW_TYPE; entity.ACTIVE = model.ACTIVE; entity.CREATE_USER = model.CREATE_USER; entity.CREATE_DATE_TIME = model.CREATE_DATE_TIME; entity.LAST_MODIFY_USER = model.LAST_MODIFY_USER; entity.LAST_MODIFY_DATE_TIME = model.LAST_MODIFY_DATE_TIME; entity.USER_DEF1 = model.USER_DEF1; entity.USER_DEF2 = model.USER_DEF2; entity.USER_DEF3 = model.USER_DEF3; entity.USER_DEF4 = model.USER_DEF4; m_Rep.Create(entity); }
public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.STATUS.STATUS_FLOW_HEADER_MODEL model, params string[] updateProperties) { Apps.Models.STATUS_FLOW_HEADER entity = m_Rep.GetById(model.INTERNAL_NUM); if (entity == null) { errors.Add(Resource.Disable); return; } if (updateProperties.Count() <= 0) { entity.INTERNAL_NUM = model.INTERNAL_NUM; entity.STATUS_FLOW = model.STATUS_FLOW; entity.STATUS_FLOW_NAME = model.STATUS_FLOW_NAME; entity.STATUS_FLOW_TYPE = model.STATUS_FLOW_TYPE; entity.ACTIVE = model.ACTIVE; entity.CREATE_USER = model.CREATE_USER; entity.CREATE_DATE_TIME = model.CREATE_DATE_TIME; entity.LAST_MODIFY_USER = model.LAST_MODIFY_USER; entity.LAST_MODIFY_DATE_TIME = model.LAST_MODIFY_DATE_TIME; entity.USER_DEF1 = model.USER_DEF1; entity.USER_DEF2 = model.USER_DEF2; entity.USER_DEF3 = model.USER_DEF3; entity.USER_DEF4 = model.USER_DEF4; } else { Type type = typeof(Apps.Models.SCV.STATUS.STATUS_FLOW_HEADER_MODEL); Type typeE = typeof(Apps.Models.STATUS_FLOW_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); }