Ejemplo n.º 1
0
        }//

        public String DroneServiceDetail(int ID = 0)
        {
            string UASFormat;
            int    DroneId;

            if (!exLogic.User.hasAccess("SERVICE.VIEW"))
            {
                return("Access Denied");
            }
            string SQL = "select a.ServiceId as ServiceId ,a.DateOfService as " +
                         "ServiceDate,b.DroneId as UASId,b.DroneName as RPAS,c.UserName as  " +
                         " ServicedBy, Count(*) Over() as _TotalRecords from MSTR_DroneService" +
                         " a left join MSTR_Drone b on a.DroneId=b.DroneId  " +
                         " left join MSTR_User c on a.CreatedBy=c.UserId where a.ServiceId=" + ID;
            qDetailView theView = new qDetailView(SQL);

            theView.Columns = 3;

            //this part for adding link to requred fields in the details
            string sqldroneid = "select b.DroneId as UASId,a.ServiceId as ServiceId from MSTR_DroneService a left join MSTR_Drone b on a.DroneId = b.DroneId where a.ServiceId =" + ID;

            DroneId = Convert.ToInt32(Util.getDBInt(sqldroneid));
            string sqldronename = "select DroneName from MSTR_Drone where droneid=" + DroneId;
            string rpasname     = Util.getDBVal(sqldronename);

            UASFormat = "<a href='/Drone/Detail/" + DroneId + "'>" + rpasname + "</a>"; //url
            theView.FormatCols.Add("RPAS", UASFormat);                                  //Adding the Column required for formatting

            return(theView.getTable());
        }
Ejemplo n.º 2
0
        }//AccountDe

        // GET: Parts/Details/5
        public String PartsDetails(int id)
        {
            if (!exLogic.User.hasAccess("PARTS.VIEW"))
            {
                return(Util.jsonStat("ERROR", "Access Denied"));
            }
            string SQL = "   select a.PartsName,\n    " +
                         "   a.Model,         \n      " +
                         "   a.description,      \n     " +
                         "   b.name            \n     " +

                         "   as ComapnyName     \n    " +
                         "   from mstr_parts a   \n   " +
                         "   left              \n     " +
                         "   join                \n   " +
                         "   MSTR_Account b   \n      " +
                         "   on a.SupplierId = b.AccountId   \n  " +
                         "   where  a.PartsId=" + id;

            qDetailView nView = new qDetailView(SQL);

            ViewBag.Message = nView.getTable();

            return(nView.getTable());
        }
Ejemplo n.º 3
0
    public String AccountDetailView([Bind(Prefix = "ID")] int AccountID = 0) {
      if (!exLogic.User.hasAccess("ACCOUNT.VIEW")) return "Access Denied";
     

       String SQL = @"SELECT
       [Name]
      ,[EmailId] AS [Email ID]
      ,[MobileNo] as [Mobile No.]
      ,[OfficeNo] as [Office No.]    
      ,[ContactName] as [Contact Person]     
        FROM [MSTR_Account] WHERE AccountID=" + AccountID; ;

        qDetailView nView = new qDetailView(SQL);
      return nView.getTable();
    }
Ejemplo n.º 4
0
        public ActionResult PilotDetailView([Bind(Prefix = "ID")] int UserID = 0)
        {
            string SQL = "SELECT a.[UserName]\n" +
                         " ,a.[FirstName] \n " +
                         ",a.[MiddleName]\n " +
                         ",a.[LastName]\n  " +
                         //",a.[Remarks]\n   " +
                         ",a.[MobileNo]\n  " +
                         ",a.[OfficeNo]\n  " +
                         ",a.[HomeNo]\n" +
                         " ,a.[EmailId]\n  as [Email ID] " +
                         ",b.[PassportNo]" +
                         " ,CONVERT(NVARCHAR, b.[DateOfExpiry], 106) AS DateOfExpiry\n   " +
                         ",b.[Department]\n  " +
                         " ,b.[EmiratesId]  as [Emirates ID]\n   " +
                         ",b.[Title] as JobTitle\n   " +
                         ",a.[RPASPermitNo] as [RPAS Permit No.]\n  " +
                         ",a.[PermitCategory] as [Permit Category]\n  " +
                         ",c.[Name] as Organization\n   " +
                         //",d.[ProfileName]\n   " +
                         " FROM[MSTR_User] a\n   " +
                         " left join mstr_user_pilot b\n  " +
                         "on a.UserId=b.UserId\n   " +
                         "left join MSTR_Account c\n  " +
                         "on a.AccountId=c.AccountId\n  " +
                         "left join MSTR_Profile d " +
                         "on a.UserProfileId=d.ProfileId" +
                         " where a.userid=" + UserID;

            if (exLogic.User.hasAccess("PILOT"))
            {
                //nothing
            }
            else if (!exLogic.User.hasAccess("DRONE.VIEWALL"))
            {
                SQL +=
                    " AND\n" +
                    "  a.AccountID=" + Util.getAccountID();
            }

            qDetailView nView = new qDetailView(SQL);

            ViewBag.Message      = nView.getTable();
            ViewBag.ProfileImage = Util.getProfileImage(UserID);
            return(View());
        }
Ejemplo n.º 5
0
    // GET: BlackBox/Details/5
    public String BBDetails(int id) {
      // if (!exLogic.User.hasAccess("BLACKBOX.VIEW")) return Util.jsonStat("ERROR", "Access Denied");
      string SQL = @"SELECT  [BlackBoxID] as _PKey
                          ,[BlackBoxSerial]
                          ,[BlackBoxName]
                          ,[IsActive]
                          ,[CreatedOn]
                          ,[CreatedBy]
                          ,[CurrentStatus]
                          ,[CurrentUserID]
                          ,[LastUpdateDate]
                          ,[CurrentDroneID]
                          , Count(*) Over() as _TotalRecords ";
      //if (exLogic.User.hasAccess("BLACKBOX.AES"))
      //      SQL = SQL + ",[EncryptionKey]";
      SQL = SQL + @"
                            FROM  MSTR_BlackBox
                           where BlackBoxID = " + id;

      qDetailView nView = new qDetailView(SQL);
      ViewBag.Message = nView.getTable();
      ViewBag.Title = "Black Box Details";
      return nView.getTable();
    }
Ejemplo n.º 6
0
        public String DroneDetail(int ID = 0)
        {
            if (!exLogic.User.hasAccess("SERVICE.VIEW"))
            {
                return("Access Denied");
            }

            String SQL =
                "SELECT \n" +
                "  D.[DroneId] , \n" +
                "  D.[DroneName], \n" +
                "  D.[DroneIdHexa] as DroneHex, \n" +
                "  D.[CommissionDate] , \n" +
                "  D.[DroneSerialNo],  \n" +
                "  O.Name as OwnerName,  \n" +
                "  M.Name as ManufactureName,  \n" +
                "  U.Name as UAVType,  \n" +
                "  Count(*) Over() as _TotalRecords, \n" +
                "  D.[DroneId] as _PKey \n" +
                "FROM \n" +
                "  [ExponentPortal].[dbo].[MSTR_Drone] D \n" +
                "inner join[ExponentPortal].[dbo].LUP_Drone  O on\n" +
                "  OwnerID = O.TypeID and O.Type = 'Owner' " +
                "inner join[ExponentPortal].[dbo].LUP_Drone M on\n" +
                "  ManufactureID = M.TypeID and M.Type='Manufacturer' " +
                "inner join [ExponentPortal].[dbo].LUP_Drone U on\n" +
                "  UAVTypeID = U.TypeID and U.Type= 'UAV Type' \n" +
                "WHERE\n" +
                "  D.DroneId =" + ID.ToString();

            qDetailView theView = new qDetailView(SQL);

            theView.Columns = 3;

            return(theView.getTable());
        }//DroneFlightDeta
Ejemplo n.º 7
0
    }//Detail()

    public String DroneFlightDetail(int ID = 0) {
      String CheckListMessage = "";
      if (!exLogic.User.hasAccess("FLIGHT.VIEW"))
        return "Access Denied";
      int DroneId, UserId;

      string UASFormat, PilotFormat;
      String UploadedDocs = "";

      String SQL =
      "SELECT\n" +
      "   DroneFlight.ID RPASFlightId,\n" +
      "   MSTR_Drone.DroneName as RPAS,\n" +
      "   tblPilot.FirstName + ' ' + tblPilot.LastName  as PilotName,\n" +
      "   tblGSC.FirstName + ' ' + tblGSC.LastName as [GroundStation],\n" +
      "   tblPilot.FirstName + ' ' + tblPilot.LastName as CreatedBy,\n" +
      "   FORMAT(FlightDate, 'dd-MMM-yyyy HH:mm:ss', 'en-US' ) 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.ID =" + ID.ToString();

      qDetailView theView = new qDetailView(SQL);
      theView.Columns = 3;
      //this part for adding link to requred fields in the details
      DroneId = Util.GetDroneIdFromFlight(ID);
      UserId = Util.GetPilotIdFromFlight(ID);

      UASFormat = "<a href='/Drone/Detail/" + DroneId + "'>" + Util.GetUASFromFlight(ID) + "</a>";//url
      PilotFormat = "<a href='/Pilot/PilotDetail/" + UserId + "'>" + Util.GetPilotFromFlight(ID) + "</a>";//url
      theView.FormatCols.Add("RPAS", UASFormat); //Adding the Column required for formatting  
      theView.FormatCols.Add("PilotName", PilotFormat); // //Adding the Column required for formatting  
      /*
      SQL = @"
      SELECT 
        Count([DroneCheckList].[ID]) as FlightCheckList
      FROM 
        [DroneCheckList]
      LEFT JOIN [MSTR_DroneCheckList] ON
        [MSTR_DroneCheckList].ID = [DroneCheckListID]
      WHERE
        [MSTR_DroneCheckList].[CheckListTitle]='Pre-Flight Checklist' AND
        [DroneCheckList].[FlightID]=" + ID;
      int CheckListCount = Util.getDBInt(SQL);
      if (CheckListCount >= 3) {
        CheckListMessage = "<div class=\"authorise\"><span class=\"icon\">&#xf214;</span>" +
        "You have successfully completed all the checklist</div>";
      } else if (CheckListCount >= 1) {
        CheckListMessage = "<div class=\"warning\"><span class=\"icon\">&#xf071;</span>" +
        "Please complete all the checklist for the flight.</div>";
      } else {
        CheckListMessage = "<div class=\"invalid\"><span class=\"icon\">&#xf071;</span>" +
        "You need to complete all checklist before the flight</div>";
      }

      //Check the documents for Regulator is uploaded
      SQL = "SELECT\n" +
      "  Count(*)\n" +
      "FROM\n" +
      "  [DroneDocuments]\n" +
      "WHERE\n" +
      "  FlightID = " + ID.ToString() + " and\n" +
      "  DocumentType = 'Regulator Approval'\n";
      int TheCount = Util.getDBInt(SQL);
      if (TheCount < 1) {
        UploadedDocs = "<div class=\"warning\"><span class=\"icon\">&#xf071;</span>" +
        "Please upload your Regulatory Authorisation document before the flight</div>";
      } else {
        UploadedDocs = "<div class=\"authorise\"><span class=\"icon\">&#xf214;</span>" +
        "Your Regulatory Authorization: " + getUploadedDocs(ID) +
        "</div>";
      }
      */
      return UploadedDocs + CheckListMessage + theView.getTable();



    }//DroneFlightDetail ()