Exemple #1
0
    public ActionResult Account() {
      if (!exLogic.User.hasAccess("ACCOUNT.VIEW")) return RedirectToAction("NoAccess", "Home");
      ViewBag.Title = "Accounts";
      String SQL = "SELECT \n" +
        "  [AccountId],\n" +
        "  [Name],\n" +
        "  [Code],\n" +
        "  [EmailId],\n" +
        "  [MobileNo],\n" +
        "  Count(*) Over() as _TotalRecords,\n" +
        "  [AccountId] as _PKey\n" +
        "FROM\n" +
        "  [MSTR_Account]";

      qView nView = new qView(SQL);
      if (exLogic.User.hasAccess("ACCOUNT.VIEW")) nView.addMenu("Detail", Url.Action("AccountDetail", new { ID = "_PKey" }));
      if (exLogic.User.hasAccess("ACCOUNT.EDIT")) nView.addMenu("Edit", Url.Action("AccountEdit", new { ID = "_PKey" }));
      if (exLogic.User.hasAccess("ACCOUNT.DELETE")) nView.addMenu("Delete", Url.Action("AccountDelete", new { ID = "_PKey" }));

      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }//Account()
        // GET: RpasUser
        public ActionResult Index()
        {
            string SQL = "SELECT MSTR_User.UserName,\n" +
                         "MSTR_User.FirstName + ' ' + MSTR_User.LastName as Name,\n" +
                         "MSTR_Profile.ProfileName as Profile,\n" +
                         "MSTR_Account.Name as Account,\n" +
                         "MSTR_User.MobileNo as Mobile,\n" +
                         "MSTR_User.EmailId,\n" +
                         "Count(*) Over() as _TotalRecords,\n" +
                         "UserId as _PKey\n" +
                         "FROM \n" +
                         "MSTR_User INNER JOIN MSTR_Account \n" +
                         "ON MSTR_User.AccountId = MSTR_Account.AccountId INNER JOIN MSTR_Profile \n" +
                         "ON MSTR_User.UserProfileId = MSTR_Profile.ProfileId \n" +
                         "where MSTR_User.AccountId = " + 23;
            qView nView = new qView(SQL);

            nView.addMenu("Edit", Url.Action("Edit", "RpasUser", new { ID = "_PKey" }));
            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
             //return View(db.MSTR_User.ToList());
        }
Exemple #3
0
    // GET: Product


    public ActionResult Index() {

      ViewBag.Title = "Product Listing";

      String SQL = "SELECT \n" +
        "  ProductId, \n" +
        "  LEFT(RFID,5) as RFID,\n" +
        "  DecimalCode,\n" +
        "  BinaryCode,\n" +
        "  IsAssigned,\n" +
        "  IsActive,\n" +
        "  RecordType,\n" +
        "  Product_Name,\n" +
        "  SerialNo,\n" +
        "  AccountId,\n" +
        "  Count(*) Over() as _TotalRecords\n" +
        "FROM\n" +
        "  MSTR_Product";
      qView nView = new qView(SQL);
      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)


    }//ActionResult Index()
    public ActionResult RawData(String ID = "") {
      if (!exLogic.User.hasAccess("PAYLOAD.RAW")) return RedirectToAction("NoAccess", "Home");
      ViewBag.Title = "Payload RAW Data";
      String SQL = @"SELECT  
          PayLoadDataID as ID,
          FlightUniqueID as UID,
          RFID,
          RSSI,
          ReadTime,
          ReadCount,
          ProcessingModel as PModel,
          CreatedTime,
            Count(*) Over() as _TotalRecords,
            PayLoadDataID as _PKey
      FROM 
        [PayLoadData]";
      if (!String.IsNullOrEmpty(ID)) SQL = SQL + "\n" +
      " WHERE FlightUniqueID='" + ID + "'";

      qView nView = new qView(SQL);
      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)

    }
    public ActionResult OutDoor() {
      if (!exLogic.User.hasAccess("OUTDOOR.VIEW")) return RedirectToAction("NoAccess", "Home");
      ViewBag.Title = "Out Door Flights";
      String SQL =
      @"SELECT
        PayLoadFlightID, 
        FlightUniqueID,
        PayLoadYard.YardName,
        [RFIDCount],
        [CreatedTime],
        Count(*) Over() as _TotalRecords,
        FlightUniqueID as _PKey
      FROM
        PayLoadFlight
      LEFT JOIN PayLoadYard ON
        PayLoadYard.YardID = PayLoadFlight.YardID 
     WHERE
        PayLoadFlight.Processingmodel=0";

      qView nView = new qView(SQL);
      nView.addMenu("PayLoad Data", Url.Action("PayLoad", "Map", new { ID = "_PKey" }));

      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)

    }
Exemple #6
0
        public ActionResult ChartDetails()
        {
            String SQL = @"select t.DroneId,
                           v.DroneName,
                            max(T.TotalFlightTime) as TotalFlightTime,
                           CASE WHEN  max(T.TotalFlightTime) - min(k.FlightTime)IS NULL or 
                            max(T.TotalFlightTime) - min(k.FlightTime) = 0 
                            THEN max(T.TotalFlightTime) ELSE max(T.TotalFlightTime) - min(k.FlightTime) END as CurrentFlightTime,
                            Count(*) Over() as _TotalRecords,
                            t.DroneId as _PKey
                            from MSTR_Drone v
                            join FlightMapData t on v.DroneId = t.DroneId 
                            left join(select u.DroneId, min(u.ReadTime) as ReadTime,
                            max(u.TotalFlightTime) as FlightTime
                            from FlightMapData u
                            Select * from 
                            convert(nvarchar(30), u.ReadTime, 120)
                            BETWEEN DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0) 
                            AND  GETDATE()
                            group by  u.DroneId )k on t.DroneId = k.DroneId
                            group by t.DroneId,v.DroneName";

            qView nView = new qView(SQL);

            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text /javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }
        }
    public ActionResult InDoorFlightDetails([Bind(Prefix = "ID")] String FlightUniqueID) {
      if (!exLogic.User.hasAccess("INDOOR.VIEW")) return RedirectToAction("NoAccess", "Home");
      // if (!exLogic.User.hasAccess("PAYLOAD.VIEW")) return RedirectToAction("NoAccess", "Home");
      ViewBag.Title = "In Door Flight Details";

      String SQL = @"SELECT
              PayLoadFlight.FlightUniqueID, 
              PayLoadMapData.RFID ,            
              [RFIDCount],
              PayLoadFlight.CreatedTime,              
              PayLoadFlight.ShelfID,
               Count(*) Over() as _TotalRecords,
              PayLoadFlight.FlightUniqueID as _PKey
      FROM
              PayLoadFlight

      LEFT JOIN PayLoadMapData ON
              PayLoadMapData.FlightUniqueID=payloadflight.FlightUniqueID
     WHERE
              PayLoadFlight.Processingmodel= 1
     AND PayLoadFlight.FlightUniqueID= " + FlightUniqueID +
     " AND PayLoadMapData.IsValid= 0";
      qView nView = new qView(SQL);


      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)

    }
    public ActionResult Detail([Bind(Prefix = "ID")] String FlightUniqueID) {
      var Parts = FlightUniqueID.Split(',');
      ViewBag.Title = "UAS Listing";

      String SQL = @"SELECT 
        [RSSI],
        [ReadTime],
        [ReadCount],
        [Latitude],
        [Longitude],
        [RowNumber],
        [ColumnNumber],
        [CellID],        
        [IsProcessed],
        Count(*) Over() as _TotalRecords
      FROM 
        [PayLoadData]
      WHERE
         [RFID] ='" + Parts[0] + @"' AND
          [FlightUniqueID]  ='" + Parts[1] + @"'";

      qView nView = new qView(SQL);
      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }
    public ActionResult BlackBoxList() {

      //      if (!exLogic.User.hasAccess("BLACKBOX.VIEW")) return RedirectToAction("NoAccess", "Home");
      ViewBag.Title = "Blackbox";

      string SQL = @"SELECT  m.[BlackBoxID] as _PKey
                            ,m.[LastRentalId]
                          ,m.[BlackBoxSerial]
                          ,m.[BlackBoxName]
                          ,m.[CurrentStatus]
                          ,isnull(u.Firstname,'') +' '+ isnull(u.lastname,'') as Pilot,
                           MSTR_Account.name as Organization
                          ,d.DroneName,m.currentDroneID as [Stream Key]
                            , Count(*) Over() as _TotalRecords
                      FROM  MSTR_BlackBox m left join mstr_user u
                      on m.currentUserID = u.userid
                      left join mstr_drone d
                      on d.droneid = m.currentDroneID
                     left join MSTR_Account on u.Accountid=MSTR_Account.AccountID  
                     where m.[IsActive] = 1 ";
      qView nView = new qView(SQL);
      nView.addMenu("Detail", Url.Action("BlackBoxDetails", new { ID = "_PKey" }));
      nView.addMenu("Edit", Url.Action("Edit", new { ID = "_PKey" }));
      nView.addMenu("Receive", Url.Action("ReceiveBlackBox", new { ID = "LastRentalId" }));

      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }//PartsBlackBoxlist
Exemple #10
0
    public String ByDrone([Bind(Prefix = "ID")] int DroneID = 0) {
      if (!exLogic.User.hasAccess("FLIGHT"))
        return "Access Denied";
      String SQL =
      "SELECT TOP 5" +
      "   MSTR_Drone.DroneName as RPAS,\n" +
      "   tblPilot.FirstName as PilotName,\n" +
      "   tblGSC.FirstName as GSCName,\n" +
      //"   tblCreated.FirstName as CreatedBy,\n" +
      "   FlightDate as 'FlightDate(UTC)'\n" +
      "FROM\n" +
      "  DroneFlight\n" +
      "LEFT JOIN MSTR_Drone ON\n" +
      "  MSTR_Drone.DroneId = DroneFlight.DroneID\n" +
      "LEFT JOIN MSTR_User as tblPilot ON\n" +
      "  tblPilot.UserID = DroneFlight.PilotID\n" +
      "LEFT JOIN MSTR_User as tblGSC ON\n" +
      "  tblGSC.UserID = DroneFlight.GSCID\n" +
      "LEFT JOIN MSTR_User as tblCreated ON\n" +
      "  tblCreated.UserID = DroneFlight.CreatedBy\n" +
      "WHERE\n" +
      "  DroneFlight.DroneID=" + DroneID + "\n" +
      "ORDER BY" +
      "  DroneFlight.ID DESC";

      qView nView = new qView(SQL, false);
      if (nView.HasRows) {
        return
          "<h2>Recent Flights</h2>\n" +
          nView.getDataTable(true, false);
      }

      return "";

    }
Exemple #11
0
    public ActionResult CMS() {
      if(!exLogic.User.hasAccess("CMS.VIEW"))
        return RedirectToAction("NoAccess", "Home");
      ViewBag.Title = "Content Management";
      String SQL = @"SELECT 
          [CmsID],
          [CmsRefName] as URL,
          (CASE WHEN [IsShowInMenu] = 1 THEN 'Yes' ELSE 'No' END) as InMenu ,
          [PageTitle],
          [MenuTitle],
          [ContentManagement].[CreatedOn],
          [FirstName] + ' ' + [LastName] as CreatedBy,
          Count(*) Over() as _TotalRecords,
          [CmsID] as _PKey
        FROM
          [ContentManagement]
        LEFT JOIN MSTR_User ON
          MSTR_User.UserID = ContentManagement.CreatedBy  ";

      qView nView = new qView(SQL);
      if(exLogic.User.hasAccess("CMS.VIEW"))
        nView.addMenu("View Result", Url.Action("demo", "home", new { id = "URL" }));
      if(exLogic.User.hasAccess("CMS.EDIT"))
        nView.addMenu("Edit", Url.Action("CmsEdit", new { ID = "_PKey" }));
      if(exLogic.User.hasAccess("CMS.DELETE"))
        nView.addMenu("Delete", Url.Action("CmsDelete", new { ID = "_PKey" }));

      if(Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }//Account()
        public ActionResult Index()
        {
            if (!exLogic.User.hasAccess("SERVICE.VIEW"))
            {
                return(RedirectToAction("NoAccess", "Home"));
            }
            ViewBag.Title = "Drone Service Listing";

            String SQL = "select\n" +
                         "  a.ServiceId As ServiceId,\n" +
                         "  b.DroneName as RPAS,\n" +
                         "  c.Name as ServiceType,\n" +
                         "  a.DateOfService as DateOfService,\n" +
                         "  a.FlightHour,\n" +
                         "  a.Description,Count(*) Over() as _TotalRecords,\n" +
                         "  a.ServiceId as _PKey\n" +
                         "from\n" +
                         "  MSTR_DroneService a\n" +
                         "Inner join  MSTR_Drone b on\n" +
                         "   a.DroneId = b.DroneId";

            if (!exLogic.User.hasAccess("DRONE.VIEWALL"))
            {
                SQL += " AND\n" +
                       "  b.AccountID=" + Util.getAccountID();
            }
            SQL += "\n" +
                   "Inner join LUP_Drone c on\n" +
                   "  a.TypeOfServiceId = c.TypeId AND\n" +
                   "  c.Type = 'ServiceType'\n" +
                   "WHERE\n" +
                   "  b.DroneId IS NOT NULL AND\n" +
                   "  c.TypeId IS NOT NULL";

            qView nView = new qView(SQL);

            if (exLogic.User.hasAccess("SERVICE.VIEW"))
            {
                nView.addMenu("Detail", Url.Action("Details", new { ID = "_PKey" }));
            }
            if (exLogic.User.hasAccess("SERVICE.EDIT"))
            {
                nView.addMenu("Edit", Url.Action("Edit", new { ID = "_PKey" }));
            }
            if (exLogic.User.hasAccess("SERVICE.DELETE"))
            {
                nView.addMenu("Delete", Url.Action("Delete", new { ID = "_PKey" }));
            }
            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
        }
Exemple #13
0
 public ActionResult PortalAlert() {
   String SQL = "SELECT [AlertID] ,[FlightID] ,[FlightReadTime],[Latitude],[Longitude],[Altitude],[FlightDataID],[AlertMessage],[CreatedOn],Count(*) Over() as _TotalRecords,FlightID as _PKey FROM[ExponentPortal].[dbo].[PortalAlert]";
   qView nView = new qView(SQL);
   nView.addMenu("Report", Url.Action("Index", "Drone", new { ID = "_PKey" }));
   if (Request.IsAjaxRequest()) {
     Response.ContentType = "text/javascript";
     return PartialView("qViewData", nView);
   } else {
     return View(nView);
   }//if(IsAjaxRequest)
 }
Exemple #14
0
        public string PilotLogDetails([Bind(Prefix = "ID")] int PilotID)
        {
            if (!exLogic.User.hasAccess("PILOTLOG.VIEWDETAIL"))
            {
                return("Access Denied");
            }
            string SQL =
                @"SELECT REPLACE(CONVERT(NVARCHAR, a.DATE, 106), ' ', '-') AS DATE,
       b.DroneName AS RPAS,
       a.FlightID,
       a.FixedWing,
       a.MultiDashRotor,
       a.SimulatedInstrument AS Simulator,
       a.AsflightInstructor,
       a.DualRecieved as DualReceived,
       a.FloatingCommand AS PilotInCommand,
       a.Id AS _PKey
      FROM MSTR_Pilot_Log a
      LEFT JOIN mstr_drone b
       ON a.DroneId = b.DroneId
      WHERE a.PilotId = " + +PilotID;

            string TotalSQL = @"SELECT 
        'Total' AS DATE,
        '' AS UASName,
        '' AS FlightID,
        sum(FixedWing) AS FixedWing,
        sum(MultiDashRotor) AS MultiDashRotor,
        sum(SimulatedInstrument) AS Simulator,
        sum(AsflightInstructor) AS AsflightInstructor,
        sum(DualRecieved) AS DualRecieved,
        sum(FloatingCommand) AS PilotInCommandm
      FROM [MSTR_Pilot_Log]
      WHERE PilotId = " + PilotID;

            qView nView = new qView(SQL);

            nView.TotalSQL   = TotalSQL;
            nView.ClassName += " dataTable";
            if (nView.HasRows)
            {
                nView.isFilterByTop = false;
                return
                    ("<h2>Pilot Log Details</h2>\n" +
                     nView.getDataTable(
                         isIncludeData: true,
                         isIncludeFooter: false,
                         qDataTableID: "PilotLogDetails"
                         ));
            }
            return("");
        }
Exemple #15
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)
 }
Exemple #16
0
        public ActionResult PayLoad([Bind(Prefix = "ID")] String FlightUniqueID = "")
        {
            if (!exLogic.User.hasAccess("PAYLOAD.MAP"))
            {
                return(RedirectToAction("NoAccess", "Home"));
            }
            int ProcessingModel = Util.getDBInt("Select ISNULL(ProcessingModel,1) From PayLoadFlight where FlightUniqueID='" + FlightUniqueID + "'");

            if (ProcessingModel == 1)
            {
                return(RedirectToAction("PayLoadIndoor", new { ID = FlightUniqueID }));
            }
            ViewBag.Title = "Payload Data";

            String SQL =
                "SELECT \n" +
                "  [RFID], \n" +
                "  [RSSI], \n" +
                "  [ReadTime], \n" +
                "  [ReadCount], \n" +
                "  CASE WHEN [GridLat] = 0 THEN [Latitude] ELSE [GridLat] END  as [Latitude], \n" +
                "  CASE WHEN [GridLng] = 0 THEN [Longitude] ELSE [GridLng] END  as [Longitude],\n" +
                "  [RowNumber] as [Row], \n" +
                "  [ColumnNumber]  as [Col],\n" +
                "  Count(*) Over() as _TotalRecords,\n" +
                "  Concat([RFID],',',FlightUniqueID) as _PKey\n" +
                "FROM \n" +
                "  [PayLoadMapData] \n" +
                "WHERE\n" +
                "  FlightUniqueID='" + FlightUniqueID + "'";

            qView nView = new qView(SQL);

            nView.addMenu("Detail", Url.Action("Detail", "Payload", new { ID = "_Pkey" }));
            ViewBag.FlightUniqueID = FlightUniqueID;

            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                //get yard information for FlightUniqueID
                GeoGrid theYard = new GeoGrid(FlightUniqueID);
                ViewBag.Yard = theYard.getYard();

                return(View(nView));
            }//if(IsAjaxRequest)
        }
Exemple #17
0
        public ActionResult FlightDataView([Bind(Prefix = "ID")] String FlightID = "")
        {
            if (!exLogic.User.hasAccess("FLIGHT.MAP"))
            {
                return(RedirectToAction("NoAccess", "Home"));
            }
            ViewBag.FlightID = FlightID;
            int FID = Util.toInt(FlightID);

            if (FID < 1)
            {
                return(RedirectToAction("Error"));
            }
            ViewBag.Title = "Flight Data";
            //            ViewBag.DroneID = DroneID;

            String SQL =
                "SELECT \n" +
                "  FlightMapDataID,\n" +
                "  ReadTime,\n" +
                "  Latitude,\n" +
                "  Longitude,\n" +
                "  Altitude,\n" +
                "  Speed,\n" +
                "  FixQuality,\n" +
                "  Satellites,\n" +
                "  Pitch,\n" +
                "  Roll,\n" +
                "  Heading,\n" +
                "  TotalFlightTime,\n" +
                "  Count(*) OVER() as _TotalRecords\n" +
                "FROM\n" +
                "  FlightMapData\n" +
                "WHERE\n" +
                "  FlightID=" + FID;

            qView nView = new qView(SQL);

            nView.IsFormatDate = false;
            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
        }
Exemple #18
0
        // GET: List/Details/5
        public ActionResult Details(string TypeName)
        {
            String SQL   = "select name, Count(*) Over() as _TotalRecords,TypeId as _PKey from LUP_Drone where type='" + TypeName + "'";
            qView  nView = new qView(SQL);

            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
        }
Exemple #19
0
        // GET: Pilot
        public ActionResult Index()
        {
            if (!exLogic.User.hasAccess("PILOTS.VIEW"))
            {
                return(RedirectToAction("NoAccess", "Home"));
            }
            ViewBag.Title = "All Pilot";
            string SQL =
                @"select
          MSTR_User.FirstName + ' ' + MSTR_User.LastName as FullName,
          MSTR_User.MobileNo,
          MSTR_User.EmailId,
          MSTR_User.RPASPermitNo as PermitNumber,
          MSTR_User.DOI_RPASPermit as IssueDate,
          MSTR_User.DOE_RPASPermit as ExpiryDate,
          Count(*) Over() as _TotalRecords,
          MSTR_User.UserID as _PKey
        FROM
          MSTR_User
        Where IsPilot=1";

            if (!exLogic.User.hasAccess("DRONE.VIEWALL"))
            {
                SQL += "\n  and MSTR_User.AccountID=" + Util.getAccountID();
            }

            qView nView = new qView(SQL);

            if (exLogic.User.hasAccess("PILOTS.VIEW"))
            {
                nView.addMenu("Detail", Url.Action("PilotDetail", new { ID = "_PKey" }));
            }
            if (exLogic.User.hasAccess("PILOTS.EDIT"))
            {
                nView.addMenu("Edit", Url.Action("Edit", new { ID = "_PKey" }));
            }
            // if (exLogic.User.hasAccess("PILOTS.DELETE")) nView.addMenu("Delete", Url.Action("Delete", new { ID = "_PKey" }));
            //if (exLogic.User.hasAccess("PILOTLOG.VIEW")) nView.addMenu("Add Pilot Log", Url.Action("Create", "PilotLog", new { ID = "_PKey" }));
            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
        }
    }//Index()


    public ActionResult Live() {
      if (!exLogic.User.hasAccess("BLACKBOX.LIVE"))
        return RedirectToAction("NoAccess", "Home");

      ViewBag.Title = "FDR Live Data";
      string SQL =
        "SELECT  \n" +
        "  [DroneDataId] as UASDataId ," +
        "  MSTR_Drone.DroneName as UAS,\n" +
        "  [ReadTime] as [Date],\n" +
        "  [DroneData].[Latitude] ,\n" +
        "  [DroneData].[Longitude],\n" +
        "  [Altitude] as [Altitude],\n" +
        "  [Speed] as [Speed],\n" +
        "  [FixQuality],\n" +
        "  [Satellites],\n" +
        "  [Pitch],[Roll],[Heading],[TotalFlightTime],\n" +
        "  [BBFlightID],\n" +
        "  Count(*) Over() as _TotalRecords,[DroneDataId] as _PKey\n" +
        "FROM\n" +
        "  [DroneData]\n" +
        "LEFT JOIN MSTR_Drone ON\n" +
        "  MSTR_Drone.DroneID = [DroneData].DroneID";
      /*
              "  CASE isnumeric(TotalFlightTime)\n" +
              "    WHEN 1 THEN cast(round(CONVERT(numeric(12, 3), TotalFlightTime) / 60.0, 2) as numeric(36, 2))\n" +
              "    ELSE 0.00\n" +
              "  END as TotalFlightTime, \n " +
      */
      if (!exLogic.User.hasAccess("DRONE.VIEWALL")) {
        SQL += " AND\n" +
          "  MSTR_Drone.AccountID=" + Util.getAccountID() + "\n" +
          "WHERE\n" +
          "  MSTR_Drone.AccountID=" + Util.getAccountID();
      }
      //   SQL+= " Order By UasDataid";


      qView nView = new qView(SQL);
      //if (!exLogic.User.hasAccess("BLACKBOX.LIVE")) nView.addMenu("Detail", Url.Action("Detail", new { ID = "_Pkey" }));

      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }//Index()
Exemple #21
0
        public ActionResult WaterSampling()
        {
            String SQL   = "SELECT  DroneDocuments.[DroneID] as UASID,DroneDocuments.[DocumentType] as Type,DroneDocuments.[UploadedDate], MSTR_Drone.DRONENAME as UAS,DroneDocuments.[DocumentTitle]as Title ,  Count(*) Over() as _TotalRecords,DroneDocuments.[DroneID] as _PKey FROM[DroneDocuments]  Left join MSTR_Drone on  DroneDocuments.DroneID = MSTR_Drone.DroneID where DocumentType='Water Sampling'  ";
            qView  nView = new qView(SQL);

            nView.addMenu("Report", Url.Action("Index", "Drone", new { ID = "_PKey" }));
            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
        }
Exemple #22
0
        // GET: Gps
        public ActionResult Index()
        {
            ViewBag.Title = "Drone Service Listing";

            String SQL = @"SELECT
       [DroneId]
      ,[DroneRFID]
      ,[Latitude]
      ,[Longitude]
      ,[ProductRFID]
      ,[ProductQrCode]
      ,[ProductRSSI]
      ,[ReadTime]
      ,[CreatedTime]
      ,[RecordType]
      ,[IsActive]
      ,[ProductId]
      ,[Altitude]
      ,[Speed]
      ,[FixQuality]
      ,[Satellites]
      ,[Pitch]
      ,[Roll]
      ,[Heading]
      ,[TotalFlightTime]
      ,[BBFlightID]
      ,[IsProcessed]      
      ,[CreatedDate]
      ,[Voltage],
       Count(*) Over() as _TotalRecords,
       [DroneGPSLogId] as _PKey
       FROM[DroneGPSLog]";



            qView nView = new qView(SQL);

            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
        }
    //by BT
    public ActionResult TransactionDet([Bind(Prefix = "ID")] int BlackBoxID) {
      //string SQL = @"SELECT MSTR_BlackBox.BlackBoxName,
      //                     BlackBoxTransaction.BBStatus as Status,
      //                     BlackBoxTransaction.CollectionMode as 'TransactionMode',
      //                     BlackBoxTransaction.BankName as 'BankName',
      //                     BlackBoxTransaction.Amount, 
      //                     BlackBoxTransaction.ChequeNumber as 'ChequeNumber',
      //                     BlackBoxTransaction.DateOfCheque as 'ChequeDate', 
      //                     BlackBoxTransaction.NameOnCard as 'NameOnCard',
      //                     BlackBoxTransaction.CreatedDate as 'CreatedDate',
      //                     MSTR_Drone.DroneName as 'DroneName',
      //                     BlackBoxTransaction.Note,
      //                     Count(*) Over() as _TotalRecords,
      //                     BlackBoxTransaction.ID as _PKey                           
      //                     FROM
      //                     BlackBoxTransaction LEFT OUTER JOIN
      //                     MSTR_BlackBox ON BlackBoxTransaction.BlackBoxID = MSTR_BlackBox.BlackBoxID LEFT OUTER JOIN
      //                     MSTR_Drone ON BlackBoxTransaction.DroneID = MSTR_Drone.DroneId 
      //                     WHERE(BlackBoxTransaction.BlackBoxID = " + BlackBoxID + ")";



      string SQL = @"SELECT BlackBoxTransaction.ID as TransID,MSTR_BlackBox.BlackBoxName,
                                 BlackBoxTransaction.BBStatus as Status,                               
                                 BlackBoxTransaction.Amount,                              
                                 MSTR_Drone.DroneName as 'DroneName',
                                 BlackBoxTransaction.Note,
                                 RentStartDate,
                                 Count(*) Over() as _TotalRecords,
                                 BlackBoxTransaction.ID as _PKey                           
                                 FROM
                                 BlackBoxTransaction LEFT OUTER JOIN
                                 MSTR_BlackBox ON BlackBoxTransaction.BlackBoxID = MSTR_BlackBox.BlackBoxID LEFT OUTER JOIN
                                 MSTR_Drone ON BlackBoxTransaction.DroneID = MSTR_Drone.DroneId 
                                 WHERE(BlackBoxTransaction.BlackBoxID = " + BlackBoxID + ")";


      qView nView = new qView(SQL);

      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text /javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }
    // GET: BlackBox

    public ActionResult Index() {
      if (!exLogic.User.hasAccess("BLACKBOX.VIEW"))
        return RedirectToAction("NoAccess", "Home");

      ViewBag.Title = "FDR Data";

      String SQL = "SELECT \n" +
        "  MSTR_Drone.DroneName as UAS,\n" +
        "  BBFlightID as FdrFlightId,\n" +
        "  Min([BlackBoxData].ReadTime) as StartTime,\n" +
        "  Max([BlackBoxData].ReadTime) as EndTime,\n" +
        "  Max(Speed) as MaxSpeed,\n" +
        "  CASE isnumeric(Max(TotalFlightTime))\n" +
        "    WHEN 1 THEN cast(round(CONVERT(numeric(12, 3), Max(TotalFlightTime)) / 60.0, 2) as numeric(36, 2))\n" +
        "    ELSE 0.00\n" +
        "  END as TotalFlightTime, \n " +
        "  Max(Altitude) as MaxAltitude,\n" +
        "  Count(*) Over() as _TotalRecords,\n" +
        "  Cast([BlackBoxData].DroneId as varchar) + ',' + Cast(BBFlightID as varchar) as _Pkey\n" +
        "FROM\n" +
        "  [BlackBoxData]\n" +
        "LEFT JOIN MSTR_Drone ON\n" +
        "  MSTR_Drone.DroneId = [BlackBoxData].DroneId\n" +
        "WHERE\n" +
        "  Speed > 0.00";
      if (!exLogic.User.hasAccess("DRONE.VIEWALL")) {
        SQL += " AND\n" +
          "  MSTR_Drone.AccountID=" + Util.getAccountID();
      }
      SQL = SQL + "\n" +
        "GROUP BY\n" +
        "  [BlackBoxData].DroneId,\n" +
        "  MSTR_Drone.DroneName,\n" +
        "  BBFlightID\n";

      qView nView = new qView(SQL);
      nView.addMenu("Detail", Url.Action("Detail", new { ID = "_Pkey" }));

      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }//Index()
    }//Index()

    public ActionResult Detail([Bind(Prefix = "ID")] String DroneID_BBFlightID = "") {
      if (!exLogic.User.hasAccess("BLACKBOX.VIEW"))
        return RedirectToAction("NoAccess", "Home");
      String[] SplitData = DroneID_BBFlightID.Split(',');
      if (SplitData.Length != 2)
        return RedirectToAction("Error");
      int DroneID = Util.toInt(SplitData[0]);
      int BBFlightID = Util.toInt(SplitData[1]);
      if (DroneID < 1 || BBFlightID < 1)
        return RedirectToAction("Error");
      ViewBag.Title = "FDR  Data";
      ViewBag.DroneID = DroneID;

      String SQL =
       "SELECT \n" +
       "  RecordNumber,\n" +
       "  ReadTime,\n" +
       "  Latitude,\n" +
       "  Longitude,\n" +
       "  Altitude,\n" +
       "  Speed,\n" +
       "  FixQuality,\n" +
       "  Satellites,\n" +
       "  Pitch,\n" +
       "  Roll,\n" +
       "  Heading,\n" +
       "  TotalFlightTime,\n" +
       "  Count(*) OVER() as _TotalRecords\n" +
       "FROM\n" +
       "  BlackBoxData\n" +
       "WHERE\n" +
       "  DroneID=" + DroneID + " AND\n" +
       "  BBFlightID=" + BBFlightID;

      qView nView = new qView(SQL);

      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }
    // GET: PayLoad


    public ActionResult Index() {
      if (!exLogic.User.hasAccess("PAYLOAD.VIEW")) return RedirectToAction("NoAccess", "Home");
      ViewBag.Title = "PayLoad Flights";
      String SQL =
      @"SELECT
        PayLoadFlightID as ID, 
        FlightID,
        PayLoadYard.YardName,
        (CASE Processingmodel WHEN 1 Then 'Indoor' ELSE 'Outdoor' END) as Processingmodel,
        [RFIDCount],
        [CreatedTime],
        Count(*) Over() as _TotalRecords,
        FlightUniqueID as _PKey
      FROM
        PayLoadFlight
      LEFT JOIN PayLoadYard ON
        PayLoadYard.YardID = PayLoadFlight.YardID
      LEFT JOIN [MSTR_Drone] ON
        [MSTR_Drone].DroneId = PayLoadFlight.PayLoadDroneID
      ";

            if (!exLogic.User.hasAccess("DRONE.VIEWALL"))
            {

                    SQL +=
                      "WHERE\n" +
                      "  [MSTR_Drone].AccountID=" + Util.getAccountID();
            }

      qView nView = new qView(SQL);
      nView.addMenu("PayLoad Data", Url.Action("PayLoad", "Map", new { ID = "_PKey" }));
      if (exLogic.User.hasAccess("PAYLOAD.RAW"))
        nView.addMenu("Raw Data", Url.Action("RawData", "Payload", new { ID = "_Pkey" }));

      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)
    }//ActionResult Index()
Exemple #27
0
        public ActionResult TrafficMonitoring()
        {
            ViewBag.Title = "Trafic Monitoring";
            //  if (!exLogic.User.hasAccess("TRAFFIC.LIVE")) return RedirectToAction("NoAccess", "Home");

            string SQL   = $@"Select [MonitorID]  [Monitor_ID]
                          ,[CreatedDate],
                            [DD]
                          ,[DR]
                          ,[DU]
                          ,[DL]
                          ,[RD]
                          ,[RR]
                          ,[RU]
                          ,[RL]
                          ,[UD]
                          ,[UR]
                          ,[UU]
                          ,[UL]
                          ,[LD]
                          ,[LR]
                          ,[LU]
                          ,[LL],FlightID,
                            Count(*) Over() as _TotalRecords,
                           [MonitorID] as _PKey
                      FROM [MSTR_TrafficMonitor]";
            qView  nView = new qView(SQL);

            nView.addMenu("View", Url.Action("dmat", new { FlightID = "FlightID" }));
            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
        }
Exemple #28
0
        public ActionResult PartsList()
        {
            if (!exLogic.User.hasAccess("PARTS.VIEW"))
            {
                return(RedirectToAction("NoAccess", "Home"));
            }
            ViewBag.Title = "UAS Parts";

            string SQL = "   select a.PartsName,\n    " +
                         "   a.Model,         \n      " +
                         "   b.name            \n     " +
                         "   as ComapnyName ,    \n    " +
                         "  Count(*) Over() as _TotalRecords,\n" +
                         "  [PartsId] as _PKey\n" +
                         "   from mstr_parts a   \n   " +
                         "   left              \n     " +
                         "   join                \n   " +
                         "   MSTR_Account b   \n      " +
                         "   on a.SupplierId = b.AccountId   \n  ";



            qView nView = new qView(SQL);

            nView.addMenu("Detail", Url.Action("Detail", new { ID = "_PKey" }));
            nView.addMenu("Edit", Url.Action("Edit", new { ID = "_PKey" }));
            nView.addMenu("Delete", Url.Action("Delete", new { ID = "_PKey" }));

            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            } //if(IsAjaxRequest)
        }     //Partslist
        // GET: DroneService/Details/5
        public ActionResult Details(int id)
        {
            int DroneId = Util.GetDroneIdFromService(id);

            if (!exLogic.User.hasAccess("SERVICE.VIEW"))
            {
                return(RedirectToAction("NoAccess", "Home"));
            }
            if (!exLogic.User.hasDrone(DroneId))
            {
                return(RedirectToAction("NoAccess", "Home"));
            }

            ViewBag.FlightID = DroneId;
            //  customer has the access only access there on drones service

            ViewBag.ServiceId = id;
            ViewBag.Title     = "View Checklist";
            ViewBag.Title     = "UAS Service Details";

            string SQL = "select b.PartsName,a.ServicePartsType as Info,b.Model as ModelType,a.QtyCount as Qty, Count(*) Over() as _TotalRecords from M2M_DroneServiceParts" +
                         " a left join MSTR_Parts b on a.PartsId=b.PartsId where a.ServiceId=" + id +
                         " group by a.ServicePartsType,b.PartsName,b.Model,a.QtyCount";


            qView nView = new qView(SQL);

            if (Request.IsAjaxRequest())
            {
                Response.ContentType = "text/javascript";
                return(PartialView("qViewData", nView));
            }
            else
            {
                return(View(nView));
            }//if(IsAjaxRequest)
        }
Exemple #30
0
    public ActionResult Detail(int ID = 0) {
      if (!exLogic.User.hasAccess("FLIGHT.VIEW"))
        return RedirectToAction("NoAccess", "Home");
      if (!exLogic.User.hasDrone(Util.GetDroneIdFromFlight(ID)))
        return RedirectToAction("NoAccess", "Home");
      ViewBag.Title = "RPAS Flight Details";
      ViewBag.FlightID = ID;

      String SQL =
      "SELECT \n" +
      "  [DroneCheckList].[ID],\n" +
      "  MSTR_DroneCheckList.CheckListTitle,\n" +
      "  MSTR_DroneCheckList.CheckListSubTitle,\n" +
      "  MSTR_User.FirstName as CreatedBy,\n" +
      "  [DroneCheckList].[CreatedOn],\n" +
      "  Count(*) Over() as _TotalRecords, \n" +
      "  [DroneCheckList].[ID] as _PKey\n" +
      "FROM\n" +
      "[DroneCheckList]\n" +
      "LEFT JOIN MSTR_DroneCheckList ON\n" +
      "MSTR_DroneCheckList.ID = [DroneCheckList].DroneCheckListID\n" +
      "LEFT JOIN MSTR_User ON\n" +
      "  MSTR_User.UserID = [DroneCheckList].CreatedBy\n" +
      "WHERE\n" +
      "  [DroneCheckList].[FlightID] = " + ID.ToString();

      qView nView = new qView(SQL);
      nView.addMenu("View", Url.Action("View", "DroneCheckList", new { ID = "_PKey" }));
      if (Request.IsAjaxRequest()) {
        Response.ContentType = "text/javascript";
        return PartialView("qViewData", nView);
      } else {
        return View(nView);
      }//if(IsAjaxRequest)

    }//Detail()