Çanakkale Onsekiz Mart Üniversitesi Bilgisayar Mühendisliği Bölümü ileri veritabanı sistemleri dersi projesi.
Entity Framework ve Google Maps api kullanılarak geliştirilmiş en yakın ATM bul uygulaması.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style>
#map {
height: 400px;
width: 400px;
}
</style>
<title></title>
</head>
<body style="height: 283px">
<script>
function initMap() {
var xy = document.getElementById("ListBox2").value;
var x;
var y;
var sayac;
for (var i = 0; i < 100; i++) {
if (xy[i] == "(") {
sayac = i + 1;
break;
}
}
x = xy[sayac];
sayac = sayac + 1;
for (var i = sayac; i < 100; i++) {
if (xy[i] == " ") {
sayac = i + 1;
break;
}
x = x + xy[i];
}
y = xy[sayac];
sayac = sayac + 1;
for (var i = sayac; i < 100; i++) {
if (xy[i] == ")") {
break;
}
y = y + xy[i];
}
x = x * 1;
y = y * 1;
var uluru = {lat: x, lng: y};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 17,
center: uluru
});
var marker = new google.maps.Marker({
position: uluru,
map: map
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDen0QmFF5BbmnyL7nvc9ECF8GSw6RodtI&callback=initMap">
</script>
<form id="form1" runat="server">
<div style="background-color: cornflowerblue; float: left; height: 420px; width: 300px;">
<center><asp:Button ID="Button1" runat="server" Text="Bankaları Listele" OnClick="Button1_Click" /></center>
<asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="ad" DataValueField="id" style="width: 100%;" Visible="False"></asp:ListBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:odev2ConnectionString %>" SelectCommand="SELECT [id], [ad] FROM [Banka]"></asp:SqlDataSource>
</div>
<div style="background-color: mediumslateblue; float: left; height: 420px; width: 300px;">
<center><asp:Button ID="Button2" runat="server" Text="Mekanları Listele" OnClick="Button2_Click" /></center>
<asp:ListBox ID="ListBox2" runat="server" DataSourceID="SqlDataSource2" DataTextField="ad" DataValueField="location" style="width: 100%;" Visible="False"></asp:ListBox>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:odev2ConnectionString %>" SelectCommand="SELECT [banka_id], [ad] , [location] FROM [Mekan] WHERE ([banka_id] = @banka_id)">
<SelectParameters>
<asp:FormParameter FormField="ListBox1" Name="banka_id" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</div>
<div style="background-color: deepskyblue; float: left; height: 420px; width: 400px;">
<center><input type="Button" value="Haritada Göster" onClick="initMap(); return false" /></center>
<div id="map">
</div>
</div>
</form>
</body>
</html>
No comments:
Post a Comment