public virtual Apps.Models.SCV.END.END_POINT_MODEL GetById(string id) { Apps.Models.END_POINT entity = m_Rep.GetById(id); if (entity != null) { //END_POINT entity = m_Rep.GetById(id); Apps.Models.SCV.END.END_POINT_MODEL model = new Apps.Models.SCV.END.END_POINT_MODEL(); model.END_POINT_ID = entity.END_POINT_ID; model.DESCRIPTION = entity.DESCRIPTION; model.TYPE = entity.TYPE; model.PATH = entity.PATH; model.ASSEMBLY_NAME = entity.ASSEMBLY_NAME; model.NAMESPACE = entity.NAMESPACE; model.CLASS = entity.CLASS; model.CONFIG_FILE = entity.CONFIG_FILE; 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.DATE_TIME_STAMP = entity.DATE_TIME_STAMP; model.PROCESS_STAMP = entity.PROCESS_STAMP; model.ACTIVE = entity.ACTIVE; model.USER_STAMP = entity.USER_STAMP; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.END.END_POINT_MODEL model) { Apps.Models.END_POINT entity = m_Rep.GetById(model.END_POINT_ID); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.END_POINT(); entity.END_POINT_ID = model.END_POINT_ID; entity.DESCRIPTION = model.DESCRIPTION; entity.TYPE = model.TYPE; entity.PATH = model.PATH; entity.ASSEMBLY_NAME = model.ASSEMBLY_NAME; entity.NAMESPACE = model.NAMESPACE; entity.CLASS = model.CLASS; entity.CONFIG_FILE = model.CONFIG_FILE; 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.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.PROCESS_STAMP = model.PROCESS_STAMP; entity.ACTIVE = model.ACTIVE; entity.USER_STAMP = model.USER_STAMP; m_Rep.Create(entity); }
public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.END.END_POINT_MODEL model, params string[] updateProperties) { Apps.Models.END_POINT entity = m_Rep.GetById(model.END_POINT_ID); if (entity == null) { errors.Add(Resource.Disable); return; } if (updateProperties.Count() <= 0) { entity.END_POINT_ID = model.END_POINT_ID; entity.DESCRIPTION = model.DESCRIPTION; entity.TYPE = model.TYPE; entity.PATH = model.PATH; entity.ASSEMBLY_NAME = model.ASSEMBLY_NAME; entity.NAMESPACE = model.NAMESPACE; entity.CLASS = model.CLASS; entity.CONFIG_FILE = model.CONFIG_FILE; 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.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.PROCESS_STAMP = model.PROCESS_STAMP; entity.ACTIVE = model.ACTIVE; entity.USER_STAMP = model.USER_STAMP; } else { Type type = typeof(Apps.Models.SCV.END.END_POINT_MODEL); Type typeE = typeof(Apps.Models.END_POINT); 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); }