Пример #1
0
    public List<AlertReportData> getAlertReportData(FlightReportFilter Filter = null) {
      var Request = HttpContext.Current.Request;
      var thisReport = new exLogic.Report();
      var Records = new List<AlertReportData>();

      if (Filter == null) Filter = new FlightReportFilter();
      var SQL = thisReport.getAlertSQL(Filter);
      SQL = SQL + "\nORDER BY PortalAlert.CreatedOn DESC";
      using (var db = new ExponentPortalEntities()) {
        using (var cmd = db.Database.Connection.CreateCommand()) {
          db.Database.Connection.Open();
          cmd.CommandText = SQL;
          using (var reader = cmd.ExecuteReader()) {
            while (reader.Read()) {
              var TheRow = new AlertReportData {
                 AlertID = reader.GetInt32(reader.GetOrdinal("AlertID")),
                 FlightID = reader.GetInt32(reader.GetOrdinal("FlightID")),
                 CreatedOn = reader.GetDateTime(reader.GetOrdinal("CreatedOn")),
                 DroneName = reader["RPAS"].ToString(),
                 Pilot = reader["Pilot"].ToString(),
                 SMS = reader["SMS"].ToString(),
                 AlertCategory = reader["AlertCategory"].ToString(),
                 AlertType = reader["AlertType"].ToString(),
                 Latitude = reader.GetDecimal(reader.GetOrdinal("Latitude")),
                Longitude = reader.GetDecimal(reader.GetOrdinal("Longitude")),
                Altitude = reader.GetInt32(reader.GetOrdinal("Altitude"))
              };
              Records.Add(TheRow);
            }//while
          }//using reader
        }
      }//using (var db = new ExponentPortalEntities())

      return Records;
    }
Пример #2
0
 public ActionResult Alert(FlightReportFilter ReportFilter) {
   //if(!exLogic.User.hasAccess("REPORT.ALERT"))
   //  return RedirectToAction("NoAccess", "Home");
   var theReport = new exLogic.Report();
   qView nView = new qView(theReport.getAlertSQL(ReportFilter));
   if (Request.IsAjaxRequest()) {
     Response.ContentType = "text/javascript";
     return PartialView("qViewData", nView);
   } else {
     ViewBag.ReportFilter = ReportFilter;
     return View(nView);
   }//if(IsAjaxRequest)
 }
Пример #3
0
    public ActionResult AlertPDF(FlightReportFilter ReportFilter) {
      var myReport = new ReportData();
      LocalReport localReport = new LocalReport();

      ReportParameter[] TheParams = {
        new ReportParameter("ReportFilterInfo", ReportFilter.getReadableFilter(), false)
      };
      localReport.ReportPath = Server.MapPath("~/ReportsManager/AlertReport.rdlc");
      ReportDataSource reportDataSource = new ReportDataSource("AlertReportDataSet", myReport.getAlertReportData(ReportFilter));
      //localReport.SetParameters(TheParams);
      localReport.DataSources.Add(reportDataSource);

      string reportType = "PDF";
      string mimeType;
      string encoding;
      string fileNameExtension;

      //The DeviceInfo settings should be changed based on the reportType
      //http://msdn2.microsoft.com/en-us/library/ms155397.aspx
      string deviceInfo =
      "<DeviceInfo>" +
      "  <OutputFormat>PDF</OutputFormat>" +
      "  <PageWidth>11.69in</PageWidth>" +
      "  <PageHeight>8.27in</PageHeight>" +
      "  <MarginTop>0.5in</MarginTop>" +
      "  <MarginLeft>0.5in</MarginLeft>" +
      "  <MarginRight>0.5in</MarginRight>" +
      "  <MarginBottom>0.5in</MarginBottom>" +
      "</DeviceInfo>";

      Warning[] warnings;
      string[] streams;
      byte[] renderedBytes;

      //Render the report
      renderedBytes = localReport.Render(
          reportType,
          deviceInfo,
          out mimeType,
          out encoding,
          out fileNameExtension,
          out streams,
          out warnings);
      Response.AddHeader("content-disposition", "attachment; filename=AlertReport." + fileNameExtension);
      return File(renderedBytes, mimeType);
    }
Пример #4
0
        private void popupWindowShowAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            PopupWindowShowAction action      = (PopupWindowShowAction)sender;
            IObjectSpace          objectSpace = action.Application.CreateObjectSpace(typeof(FlightReportFilter));
            string detailViewId = action.Application.FindDetailViewId(typeof(FlightReportFilter));

            FlightReportFilter flightReportFilter = objectSpace.FindObject <FlightReportFilter>(null);

            if (flightReportFilter == null)
            {
                //flightReportFilter = new FlightReportFilter();
                flightReportFilter = objectSpace.CreateObject <FlightReportFilter>();
            }

            //if (flightReportFilter == null)
            //{
            //    flightReportFilter = objectSpace.CreateObject<FlightReportFilter>();
            //    //message.Text = ActionsDemoStrings.LogTraceHeader + e.Action.Caption + ActionsDemoStrings.LogTraceTail;
            //}
            e.View = action.Application.CreateDetailView(objectSpace, flightReportFilter);
        }
Пример #5
0
        protected override object CreateControlsCore()
        {
            var grid        = base.CreateControlsCore();
            var objectSapce = ObjectSpace.CreateNestedObjectSpace();

            flightReportFilter = objectSapce.CreateObject <FlightReportFilter>();
            //flightReportFilter = new FlightReportFilter();

            string detailViewId = Application.FindDetailViewId(typeof(FlightReportFilter));
            var    view         = Application.CreateDetailView(objectSapce, flightReportFilter, false);

            view.ViewEditMode = ViewEditMode.Edit;
            view.CreateControls();

            //var editor = new DevExpress.ExpressApp.Web.Editors.WebLookupEditorHelper(Application, objectSapce, XafTypesInfo.CastTypeToTypeInfo(typeof(AircraftRegister)),null);
            //  var editor = new ASPxLookupPropertyEditor(typeof(Aircraft), null);
            //  editor.CreateControl();

            var table             = RenderHelper.CreateTable();
            var mainViewRow       = new TableRow();
            var filterViewRow     = new TableRow();
            var mainViewTableCell = new TableCell();
            var filterTableCell   = new TableCell();

            mainViewTableCell.Controls.Add((System.Web.UI.Control)grid);
            filterTableCell.Controls.Add((System.Web.UI.Control)view.Control);
            //filterTableCell.Controls.Add((System.Web.UI.Control)editor.Control);

            mainViewRow.Cells.Add(filterTableCell);
            filterViewRow.Cells.Add(mainViewTableCell);


            table.Rows.Add(mainViewRow);
            table.Rows.Add(filterViewRow);

            table.Style.Add("width", "auto");
            table.Style.Add("border-spacing", "1px");

            return(table);
        }
Пример #6
0
    public List<FlightReportData>getFlightReportData(FlightReportFilter Filter = null) {
      var Request = HttpContext.Current.Request;
      var thisReport = new exLogic.Report();
      var Records = new List<FlightReportData>();

      if (Filter == null) Filter = new FlightReportFilter();
      var SQL = thisReport.getFlightReportSQL(Filter, true) ;
      SQL = SQL + "\nORDER BY DroneFlight.ID DESC";
      using (var db = new ExponentPortalEntities()) {
        using (var cmd = db.Database.Connection.CreateCommand()) {
          db.Database.Connection.Open();
          cmd.CommandText = SQL;
          using (var reader = cmd.ExecuteReader()) {
            while (reader.Read()) {
              var TheRow = new FlightReportData {
                ID = Util.toInt(reader["Ref"]),
                FlightDate = reader.GetDateTime(reader.GetOrdinal("FlightDate")),
                FlightTime = reader["FlightTime"].ToString(),
                Pilot = reader["Pilot"].ToString(),
                UAS = reader["UAS"].ToString(),
                BoundaryAlerts = reader["BoundaryAlerts"].ToString(),
                HeightAlerts = reader["AltitudeAlerts"].ToString(),
                ProximityAlerts = reader["ProximityAlerts"].ToString(),
                MaxAltitude = reader["MaxAltitude"].ToString(),
                Height = Util.toInt(reader["Height"]),
                HeightCritical = Util.toInt(reader["HeightCritical"]),
                Boundary = Util.toInt(reader["Boundary"]),
                BoundaryCritical = Util.toInt(reader["BoundaryCritical"]),
                Proximity = Util.toInt(reader["Proximity"]),
                ProximityCritical = Util.toInt(reader["ProximityCritical"])
              };
              Records.Add(TheRow);
            }//while
          }//using reader
        }
      }//using (var db = new ExponentPortalEntities())

      return Records;
    }//getFlightReportData
Пример #7
0
    /// <summary>
    /// 
    /// </summary>
    /// <param name="ReportFilter"></param>
    /// <returns></returns>
    public ActionResult GeoTag(FlightReportFilter ReportFilter) {
      if (!exLogic.User.hasAccess("REPORT.FLIGHTS"))
        return RedirectToAction("NoAccess", "Home");
      ViewBag.ReportFilter = ReportFilter;
      int DroneID = ReportFilter.UAS;
      int IsCompany = 0;
      DateTime FromDate = DateTime.Parse(ReportFilter.From);
      DateTime ToDate = DateTime.Parse(ReportFilter.To);

      ToDate = ToDate.AddHours(24);

      List<DroneDocument> Docs = new List<DroneDocument>();
      IList<GeoTagReport> DocsGeo = new List<GeoTagReport>();
      ExponentPortalEntities Db = new ExponentPortalEntities();

      if (!exLogic.User.hasAccess("DRONE.VIEWALL")) {
        IsCompany = 1;

      } else {
        IsCompany = 0;
      }
      DocsGeo = Util.getAllGeoTag(FromDate, ToDate, IsCompany, DroneID);
      return View(DocsGeo);
    }
Пример #8
0
 //adding this for auto complete drone name
 public ActionResult DroneFilter(FlightReportFilter ReportFilter) {
   return View(ReportFilter);
 }