public virtual Apps.Models.SCV.FILTER.FILTER_STATEMENT_MODEL GetById(string id) { Apps.Models.FILTER_STATEMENT entity = m_Rep.GetById(id); if (entity != null) { //FILTER_STATEMENT entity = m_Rep.GetById(id); Apps.Models.SCV.FILTER.FILTER_STATEMENT_MODEL model = new Apps.Models.SCV.FILTER.FILTER_STATEMENT_MODEL(); model.RECORD_TYPE = entity.RECORD_TYPE; model.FILTER_NAME = entity.FILTER_NAME; model.SEQUENCE = entity.SEQUENCE; model.FILTER_NUM = entity.FILTER_NUM; model.AND_OR = entity.AND_OR; model.ATTRIBUTE = entity.ATTRIBUTE; model.OPERAND = entity.OPERAND; model.LITERAL_VALUE = entity.LITERAL_VALUE; model.USER_STAMP = entity.USER_STAMP; model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP; model.LEFT_PAREN = entity.LEFT_PAREN; model.RIGHT_PAREN = entity.RIGHT_PAREN; model.OBJECT_ID = entity.OBJECT_ID; model.LITERAL_TYPE = entity.LITERAL_TYPE; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.FILTER.FILTER_STATEMENT_MODEL model) { Apps.Models.FILTER_STATEMENT entity = m_Rep.GetById(model.RECORD_TYPE); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.FILTER_STATEMENT(); entity.RECORD_TYPE = model.RECORD_TYPE; entity.FILTER_NAME = model.FILTER_NAME; entity.SEQUENCE = model.SEQUENCE; entity.FILTER_NUM = model.FILTER_NUM; entity.AND_OR = model.AND_OR; entity.ATTRIBUTE = model.ATTRIBUTE; entity.OPERAND = model.OPERAND; entity.LITERAL_VALUE = model.LITERAL_VALUE; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.LEFT_PAREN = model.LEFT_PAREN; entity.RIGHT_PAREN = model.RIGHT_PAREN; entity.OBJECT_ID = model.OBJECT_ID; entity.LITERAL_TYPE = model.LITERAL_TYPE; m_Rep.Create(entity); }
public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.FILTER.FILTER_STATEMENT_MODEL model, params string[] updateProperties) { Apps.Models.FILTER_STATEMENT entity = m_Rep.GetById(model.RECORD_TYPE); if (entity == null) { errors.Add(Resource.Disable); return; } if (updateProperties.Count() <= 0) { entity.RECORD_TYPE = model.RECORD_TYPE; entity.FILTER_NAME = model.FILTER_NAME; entity.SEQUENCE = model.SEQUENCE; entity.FILTER_NUM = model.FILTER_NUM; entity.AND_OR = model.AND_OR; entity.ATTRIBUTE = model.ATTRIBUTE; entity.OPERAND = model.OPERAND; entity.LITERAL_VALUE = model.LITERAL_VALUE; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.LEFT_PAREN = model.LEFT_PAREN; entity.RIGHT_PAREN = model.RIGHT_PAREN; entity.OBJECT_ID = model.OBJECT_ID; entity.LITERAL_TYPE = model.LITERAL_TYPE; } else { Type type = typeof(Apps.Models.SCV.FILTER.FILTER_STATEMENT_MODEL); Type typeE = typeof(Apps.Models.FILTER_STATEMENT); 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); }