Exemplo n.º 1
0
    public bool isLive(int FlightID) {
      if (_DroneID == 0) _DroneID = getDroneIDForFlight(FlightID);

      String SQL = "SELECT IsLiveVideo FROM MSTR_Drone WHERE DroneID=" + _DroneID;
      int IsLiveVideo = Util.getDBInt(SQL);
      if (IsLiveVideo == 1) {
        int LastFlightID = getLastFlightID(_DroneID);
        if (LastFlightID == FlightID) return true;
      }
      return false;
    }
Exemplo n.º 2
0
    public static bool hasDrone(int DroneID) {
      if (exLogic.User.hasAccess("DRONE.MANAGE")) return true;

      String SQL = "SELECT Count(*) FROM\n" +
        "MSTR_Drone\n" +
        "WHERE\n" +
        "  DroneID=" + DroneID + " AND\n" +
        "  AccountID=" + Util.getAccountID();
      int Count = Util.getDBInt(SQL);
      if (Count > 0) return true;
      return false;

    }
Exemplo n.º 3
0
    public bool isLiveFlight(int FlightID) {
      //return true;

      if (_DroneID == 0) _DroneID = getDroneIDForFlight(FlightID);
      String SQL = @"select 
        Count(*) 
      FROM 
        [MSTR_Drone]
      WHERE
        DroneID = " + _DroneID + @" and
        LastFlightID=" + FlightID + @" AND
        FlightTime > DATEADD(MINUTE, -1, GETDATE())";
      int LiveCount = Util.getDBInt(SQL);
      return (LiveCount > 0);
  }
Exemplo n.º 4
0
        public static bool hasAccessUser(String PermissionID,int UserID)
        {
            HttpSessionState Session = HttpContext.Current.Session;
            
            String SQL =
            "select\n" +
            "  Count(MSTR_Menu.MenuID) as PermissionCount\n" +
            "FROM\n" +
            "  MSTR_User,\n" +
            "  MSTR_Profile,\n" +
            "  M2M_ProfileMenu,\n" +
            "  MSTR_Menu\n" +
            "WHERE\n" +
            "  MSTR_User.UserID = " + UserID + " AND\n" +
            "  MSTR_User.UserProfileId = MSTR_Profile.ProfileId AND\n" +
            "  M2M_ProfileMenu.ProfileID = MSTR_Profile.ProfileId AND\n" +
            "  MSTR_Menu.MenuId = M2M_ProfileMenu.MenuID AND\n" +
            "  MSTR_Menu.PermissionId = '" + PermissionID + "'";
            int PermissionCount = Util.getDBInt(SQL);

            return (PermissionCount > 0);
        }
Exemplo n.º 5
0
    }//getBulkInsertRow()

    private int getDroneID(ExponentPortalEntities ctx, String Line) {
      String SQL;
      int DroneSerial = 0;

      // Parse the line to get ID
      String[] Data = Line.Split(',');
      Int32.TryParse(Data[1], out DroneSerial);

      //Step 1: Find the drone serial from Blackbox data
      /*
      SQL = "SELECT TOP 1 Drone_Serial FROM #BlackBoxData";
      int DroneSerial = Util.getDBInt(SQL, ctx);
      if(DroneSerial == 0) throw new Exception("Can not find the Drone ID to parse data");
      */

      //Step 2: get the drone ID using the serial number
      SQL = "SELECT TOP 1 DroneID From MSTR_Drone WHERE DroneSerialNo=" + DroneSerial;
      int DroneID = Util.getDBInt(SQL, ctx);
      if (DroneID == 0) throw new Exception("Can not find drone id for the serial number " + DroneSerial);

      return DroneID;
    } //getDroneID(()
Exemplo n.º 6
0
 public int getDroneIDForFlight(int FlightID) {
   String SQL = "Select DroneID From DroneFlight WHERE ID=" + FlightID;
   return Util.getDBInt(SQL);
 }
Exemplo n.º 7
0
 public int getPayloadCount(int FlightID = 0) {
   FlightID = 310;
   String SQL = "SELECT Count(*) FROM PayLoadFlight where flightid=" + FlightID;
   return Util.getDBInt(SQL);
 }
Exemplo n.º 8
0
 public int getGeoTagCount(int FlightID) {
   String SQL = "select Count(*) from DroneDocuments where flightid=" + FlightID + " and DocumentType = 'Geo Tag'";
   return Util.getDBInt(SQL);
 }
Exemplo n.º 9
0
 public int getPlayListCount(int FlightID) {
   String SQL = "select Count(*) from DroneFlightVideo WHERE FlightID=" + FlightID;
   return Util.getDBInt(SQL);
 }
Exemplo n.º 10
0
 public int getLastFlightID(int DroneID) {
   String SQL = "SELECT Max(ID) FROM DroneFlight WHERE DroneID=" + DroneID;
   return Util.getDBInt(SQL);
 }
Exemplo n.º 11
0
    } //getDroneID(()

    private int getFlightID(ExponentPortalEntities ctx, int DroneID, int BBFlightID) {
      String SQL = "SELECT ID FROM DroneFlight WHERE DroneID=" + DroneID + " AND BBFlightID=" + BBFlightID;
      return Util.getDBInt(SQL, ctx);
    }
Exemplo n.º 12
0
 private int getYardID(String FlightUniqueID) {
   String SQL = @"SELECT YardID From PayLoadFlight WHERE FlightUniqueID='" + FlightUniqueID + "'";
   return Util.getDBInt(SQL);
 }