public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.REPORT.REPORT_CONNECTION_MODEL model, params string[] updateProperties) { Apps.Models.REPORT_CONNECTION 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.DOCUMENT_TYPE = model.DOCUMENT_TYPE; entity.DOCUMENT_ID = model.DOCUMENT_ID; entity.TABLE_NAME = model.TABLE_NAME; entity.STORED_PROCEDURE = model.STORED_PROCEDURE; entity.SUBREPORT_NAME = model.SUBREPORT_NAME; entity.RETRIEVING_CLASS = model.RETRIEVING_CLASS; } else { Type type = typeof(Apps.Models.SCV.REPORT.REPORT_CONNECTION_MODEL); Type typeE = typeof(Apps.Models.REPORT_CONNECTION); 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 void Create(ref ValidationErrors errors, Apps.Models.SCV.REPORT.REPORT_CONNECTION_MODEL model) { Apps.Models.REPORT_CONNECTION entity = m_Rep.GetById(model.INTERNAL_NUM); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.REPORT_CONNECTION(); entity.INTERNAL_NUM = model.INTERNAL_NUM; entity.DOCUMENT_TYPE = model.DOCUMENT_TYPE; entity.DOCUMENT_ID = model.DOCUMENT_ID; entity.TABLE_NAME = model.TABLE_NAME; entity.STORED_PROCEDURE = model.STORED_PROCEDURE; entity.SUBREPORT_NAME = model.SUBREPORT_NAME; entity.RETRIEVING_CLASS = model.RETRIEVING_CLASS; m_Rep.Create(entity); }
public virtual Apps.Models.SCV.REPORT.REPORT_CONNECTION_MODEL GetById(string id) { Apps.Models.REPORT_CONNECTION entity = m_Rep.GetById(id); if (entity != null) { //REPORT_CONNECTION entity = m_Rep.GetById(id); Apps.Models.SCV.REPORT.REPORT_CONNECTION_MODEL model = new Apps.Models.SCV.REPORT.REPORT_CONNECTION_MODEL(); model.INTERNAL_NUM = entity.INTERNAL_NUM; model.DOCUMENT_TYPE = entity.DOCUMENT_TYPE; model.DOCUMENT_ID = entity.DOCUMENT_ID; model.TABLE_NAME = entity.TABLE_NAME; model.STORED_PROCEDURE = entity.STORED_PROCEDURE; model.SUBREPORT_NAME = entity.SUBREPORT_NAME; model.RETRIEVING_CLASS = entity.RETRIEVING_CLASS; return(model); } else { return(null); } }