Exemplo n.º 1
0
 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 });
     }
 }
Exemplo n.º 2
0
        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 });
            }
        }
Exemplo n.º 3
0
 public void UPdateReportLastSendTime(ReportConfig config)
 {
     _reportConfigDao.UPdateReportLastSendTime(config);
 }
Exemplo n.º 4
0
        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 });
        }
Exemplo n.º 5
0
 public void UpdateEventReport(ReportConfig config)
 {
     _reportConfigDao.UpdateEventReport(config);
 }
Exemplo n.º 6
0
 public void UpdateReportConfig(ReportConfig config)
 {
     _reportConfigDao.UPdateReportConfig(config);
 }
Exemplo n.º 7
0
 public void SendEventReport(ReportConfig config)
 {
     _reportConfigDao.SendEventReport(config);
 }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
        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;
        }
Exemplo n.º 10
0
 /// <summary>
 /// 更新事件报告最后一次发送时间
 /// </summary>
 /// <param name="config"></param>
 private void UPdateReportLastSendTime(ReportConfig config)
 {
     ReportConfigService.GetInstance().UPdateReportLastSendTime(config);
 }
Exemplo n.º 11
0
 private void UpdataLastModified(ReportConfig config)
 {
     ReportConfigService.GetInstance().UpdateReportConfig(config);
 }