Beispiel #1
0
        public void OnGet()
        {
            TrinitasDataAccess.Database database = new TrinitasDataAccess.Database(
                @"Data Source=planner.aspitweb.dk;Initial Catalog=trinitashunde;user id = aspitlab; password = aspitlab; Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");

            // Gets all Locations
            getLocations(database);

            // Gets all LocationTypes
            getLocationTypes(database);

            // Gets all PinTypes
            getPinTypes(database);
        }
Beispiel #2
0
        } // End getLocations(Database)

        public IActionResult OnPost()
        {
            TrinitasDataAccess.Database DB = new TrinitasDataAccess.Database("Data Source = planner.aspitweb.dk; Initial Catalog = trinitashunde;user id = aspitlab; password = aspitlab; Connect Timeout = 30; Encrypt = False; TrustServerCertificate = False; ApplicationIntent = ReadWrite; MultiSubnetFailover = False");
            var    txtName     = Request.Form["Name"];
            double txtGPSLat   = double.Parse(Request.Form["GPSLat"], CultureInfo.InvariantCulture);
            double txtGPSLon   = double.Parse(Request.Form["GPSLon"], CultureInfo.InvariantCulture);
            int    txtLocation = LocationID;
            int    txtPinType  = 2;

            DB.addLocation(txtName, txtGPSLat, txtGPSLon, txtLocation, txtPinType);

            // Redirect to Get for PRG
            return(RedirectToPage());
        }