public ActionResult SaveReport(DefineReport report, ReportConfig rc) { int lastId = 0; if (report.PlantId == 0) { report.UserId = (UserUtil.getCurUser()).id;//如果是所有电站就取当前用户ID } lastId = reportService.AddRunReport(report); rc.reportId = lastId; if (string.IsNullOrEmpty(rc.email) == false) rc.email = rc.email.Replace(";", ","); reportConfigService.SendEventReport(rc); if (report.PlantId == 0) { return Redirect("/user/AllPlantsReport"); } else { return RedirectToAction("PlantReport", "plant", new { @id = report.PlantId }); } }
public ActionResult UpdateReport(DefineReport report, ReportConfig rc) { if (report.PlantId == 0) { report.UserId = (UserUtil.getCurUser()).id; } rc.reportId = report.Id; if (string.IsNullOrEmpty(rc.email) == false) rc.email = rc.email.Replace(";", ","); reportConfigService.UpdateReportConfig(rc); reportService.EditReportById(report); if (report.PlantId == 0) { return Redirect("/user/AllPlantsReport"); } else { return RedirectToAction("PlantReport", "plant", new { @id = report.PlantId }); } }
public void UPdateReportLastSendTime(ReportConfig config) { _reportConfigDao.UPdateReportLastSendTime(config); }
public ActionResult SaveEventReport(ReportConfig config, int idstr) { config.id = idstr; config.sendMode = Session[ComConst.User].ToString();//这里保存用户ID if (string.IsNullOrEmpty(config.email) == false) config.email = config.email.Replace(";", ","); reportConfigService.UpdateEventReport(config); TempData["eventreport"] = "0"; ViewData["id"] = config.plantId; return RedirectToAction("PlantReport", "plant", new { @id = config.plantId }); }
public void UpdateEventReport(ReportConfig config) { _reportConfigDao.UpdateEventReport(config); }
public void UpdateReportConfig(ReportConfig config) { _reportConfigDao.UPdateReportConfig(config); }
public void SendEventReport(ReportConfig config) { _reportConfigDao.SendEventReport(config); }
private Hashtable construtPlantReportObj(int plantid, int type, string dataitem) { Hashtable table = new Hashtable(); string plantName = PlantService.GetInstance().GetPlantInfoById(plantid).name+" "; DefineReport report1 = new DefineReport() { ReportType = type, ReportName =plantName+"-"+DataReportType.getNameByCode(type), SaveTime = DateTime.Now, dataitem = dataitem, PlantId = plantid }; ReportConfig config1 = new ReportConfig() { sendFormat = "html", email = "", sendMode = "2", reportId = 0, plantId = plantid }; table.Add(0, report1); table.Add(1, config1); return table; }
private Hashtable construtAllPlantsReportObj(int userid, int type, string dataitem) { Hashtable table = new Hashtable(); DefineReport report1 = new DefineReport() { ReportType = type, ReportName = "All plants-" + DataReportType.getNameByCode(type), SaveTime = DateTime.Now, dataitem = dataitem, UserId = userid }; ReportConfig config1 = new ReportConfig() { tinterval = "4", sendFormat = "html", sendMode = "2", email = "", reportId = 0, plantId = 0 }; table.Add(0,report1); table.Add(1,config1); return table; }
/// <summary> /// 更新事件报告最后一次发送时间 /// </summary> /// <param name="config"></param> private void UPdateReportLastSendTime(ReportConfig config) { ReportConfigService.GetInstance().UPdateReportLastSendTime(config); }
private void UpdataLastModified(ReportConfig config) { ReportConfigService.GetInstance().UpdateReportConfig(config); }