public CV_PM_ALT_BASE getAltBaseById(Guid alertID) { CV_PM_ALT_BASE entity = new CV_PM_ALT_BASE(); try { entity = cv_PM_ALT_BASEBO.GetEntity(alertID); return(entity); } catch (Exception e) { throw e; } }
public CV_PM_ALT_BASE GetEntity(string alertName) { CV_PM_ALT_BASE entity = new CV_PM_ALT_BASE(); try { entity = cv_PM_ALT_BASEBO.GetEntity(alertName); return(entity); } catch (Exception e) { throw e; } }
public IList <CV_PM_ALT_BASE> GetEntities(CV_PM_ALT_BASE entity) { long totalRecords = 0; IList <CV_PM_ALT_BASE> entities = null; try { AndFilter af = new AndFilter(); MatchingFilter mf = new MatchingFilter(); if (!string.IsNullOrEmpty(entity.Category)) { mf.AddLike("Category", entity.Category); } if (!string.IsNullOrEmpty(entity.AlertName)) { mf.AddLike("AlertName", entity.AlertName); } if (!string.IsNullOrEmpty(entity.AlertAlias)) { mf.AddLike("AlertAlias", entity.AlertAlias); } if (!string.IsNullOrEmpty(entity.AlertDesc)) { mf.AddLike("AlertDesc", entity.AlertDesc); } if (!string.IsNullOrEmpty(entity.AlertContent)) { mf.AddLike("AlertContent", entity.AlertContent); } if (entity.AlertType.HasValue && entity.AlertType != 0) { mf.AddMatching("AlertType", entity.AlertType); } if (!string.IsNullOrEmpty(entity.Format)) { mf.AddMatching("Format", entity.Format); } if (!string.IsNullOrEmpty(entity.AlertObject)) { mf.AddMatching("AlertObject", entity.AlertObject); } if (!string.IsNullOrEmpty(entity.PreProcedure)) { mf.AddMatching("PreProcedure", entity.PreProcedure); } if (!string.IsNullOrEmpty(entity.PostProcedure)) { mf.AddMatching("PostProcedure", entity.PostProcedure); } if (entity.AlertInterval.HasValue && entity.AlertInterval != 0) { mf.AddMatching("AlertInterval", entity.Category); } if (!string.IsNullOrEmpty(entity.AlertTimePoints)) { mf.AddMatching("AlertTimePoints", entity.AlertTimePoints); } //if (entity.LastAlertedTime.HasValue) //{ // mf.AddMatching("LastAlertedTime", entity.LastAlertedTime); //} if (entity.IsActive.HasValue) { mf.AddMatching("IsActive", entity.IsActive); } if (entity.RowDeleted.HasValue) { mf.AddMatching("RowDeleted", entity.RowDeleted); } if (!string.IsNullOrEmpty(entity.CreatedBy)) { mf.AddMatching("CreatedBy", entity.CreatedBy); } //if (entity.CreatedOn.HasValue) //{ // mf.AddMatching("CreatedOn", entity.CreatedOn); //} if (!string.IsNullOrEmpty(entity.ModifiedBy)) { mf.AddMatching("ModifiedBy", entity.ModifiedBy); } //if (entity.ModifiedOn.HasValue) //{ // mf.AddMatching("ModifiedOn", entity.ModifiedOn); //} af.AddFilter(mf); Sort sort = new Sort(); sort.OrderBy("AlertName", Sort.Direction.ASC); entities = _CV_PM_ALT_BASEDAO.Find(0, -1, af, sort, out totalRecords); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.BusinessLogicDefaultPolicy); } return(entities); }
public IList <CV_PM_ALT_BASE_QuaryParam> getAltBase(CV_PM_ALT_BASE pmAltBase) { IList <CV_PM_ALT_BASE_QuaryParam> listQuary = new List <CV_PM_ALT_BASE_QuaryParam>(); IList <CV_PM_ALT_BASE> list = new List <CV_PM_ALT_BASE>(); if (pmAltBase != null) { try { list = cv_PM_ALT_BASEBO.GetEntities(pmAltBase); if (list.Count > 0) { for (int i = 0; i < list.Count; i++) { CV_PM_ALT_BASE_QuaryParam Entity = new CV_PM_ALT_BASE_QuaryParam(); Entity.AlertID = list[i].AlertID; Entity.AlertName = list[i].AlertName; Entity.AlertAlias = list[i].AlertAlias; Entity.AlertDesc = list[i].AlertDesc; Entity.AlertContent = list[i].AlertContent; Entity.Category = list[i].Category; Entity.AlertType = list[i].AlertType; Entity.Format = list[i].Format; Entity.AlertObject = list[i].AlertObject; Entity.PreProcedure = list[i].PreProcedure; Entity.PostProcedure = list[i].PostProcedure; Entity.AlertInterval = list[i].AlertInterval; Entity.AlertTimePoints = list[i].AlertTimePoints; Entity.LastAlertedTime = list[i].LastAlertedTime; Entity.IsActive = list[i].IsActive; Entity.CIsActive = list[i].CIsActive; Entity.RowDeleted = list[i].RowDeleted; Entity.CreatedBy = list[i].CreatedBy; Entity.CreatedOn = list[i].CreatedOn; Entity.ModifiedBy = list[i].ModifiedBy; Entity.ModifiedOn = list[i].ModifiedOn; Entity.SqlScript = list[i].SqlScript; Entity.URL = list[i].URL; if (list[i].AlertType.ToString() == "1") { Entity.alertTypeName = "邮件"; } else if (list[i].AlertType.ToString() == "2") { Entity.alertTypeName = "微信"; } listQuary.Add(Entity); } } if (list.Count == 0) { alertEntity = null; } else { listQuary = listQuary.OrderByDescending(c => c.ModifiedOn).ToList(); } return(listQuary); } catch (Exception e) { throw e; } } else { return(null); } }
public void Update(CV_PM_ALT_BASE entity, bool updateAll, DbTransaction transaction) { throw new NotImplementedException(); }
public void Update(CV_PM_ALT_BASE entity) { throw new NotImplementedException(); }
public CV_PM_ALT_BASE Insert(CV_PM_ALT_BASE entity, DbTransaction transaction) { throw new NotImplementedException(); }
public CV_PM_ALT_BASE Insert(CV_PM_ALT_BASE entity) { throw new NotImplementedException(); }
private static CV_PM_ALT_BASE ReadEntity(IDataReader dataReader) { CV_PM_ALT_BASE CV_PM_ALT_BASEEntity = new CV_PM_ALT_BASE(); object value; value = dataReader["AlertID"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertID = (Guid?)value; } value = dataReader["AlertName"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertName = (String)value; } value = dataReader["AlertAlias"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertAlias = (String)value; } value = dataReader["SqlScript"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.SqlScript = (String)value; } value = dataReader["URL"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.URL = (String)value; } value = dataReader["AlertDesc"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertDesc = (String)value; } value = dataReader["AlertContent"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertContent = (String)value; } value = dataReader["Category"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.Category = (String)value; } value = dataReader["AlertType"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertType = (Int32?)value; } value = dataReader["Format"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.Format = (String)value; } value = dataReader["AlertObject"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertObject = (String)value; } value = dataReader["PreProcedure"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.PreProcedure = (String)value; } value = dataReader["PostProcedure"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.PostProcedure = (String)value; } value = dataReader["AlertInterval"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertInterval = (Int32?)value; } value = dataReader["AlertTimePoints"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.AlertTimePoints = (String)value; } value = dataReader["LastAlertedTime"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.LastAlertedTime = (DateTime?)value; } value = dataReader["IsActive"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.IsActive = (Boolean?)value; } value = dataReader["CIsActive"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.CIsActive = (String)value; } value = dataReader["RowDeleted"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.RowDeleted = (Boolean?)value; } value = dataReader["CreatedBy"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.CreatedBy = (String)value; } value = dataReader["CreatedOn"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.CreatedOn = (DateTime?)value; } value = dataReader["ModifiedBy"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.ModifiedBy = (String)value; } value = dataReader["ModifiedOn"]; if (value != DBNull.Value) { CV_PM_ALT_BASEEntity.ModifiedOn = (DateTime?)value; } return(CV_PM_ALT_BASEEntity); }