【发布时间】:2016-03-31 20:05:27
【问题描述】:
我正在开发 Windows 移动应用程序。我想在将位置存储到 sqlite 数据库时创建地理围栏,以便在进入地理围栏时生成 SMS 警报。我正在通过地图将位置加载到文本框中。
这是目前的代码
private void Load_Location(object sender, RoutedEventArgs e)
{
LattxtBx.Text = String.Format("{0}", AddLocation.Center.Position.Latitude);
LongtxtBx.Text = String.Format("{0}", AddLocation.Center.Position.Longitude);
}
private async void AddContact_Click(object sender, RoutedEventArgs e)
{
DatabaseHelperClass Db_Helper = new DatabaseHelperClass();//Creating object for DatabaseHelperClass.cs from ViewModel/DatabaseHelperClass.cs
if (NametxtBx.Text != "" & AgetxtBx.Text != "" & AddresstxtBx.Text != "" & SchooltxtBx.Text != "" & GardienttxtBx.Text != "" & PhonetxtBx.Text != "" & LattxtBx.Text != "" & LongtxtBx.Text != "")
{
Db_Helper.Insert(new Contacts(NametxtBx.Text, AgetxtBx.Text, AddresstxtBx.Text, SchooltxtBx.Text, GardienttxtBx.Text, PhonetxtBx.Text, LattxtBx.Text, LongtxtBx.Text));
Frame.Navigate(typeof(ReadContactList));//after add contact redirect to contact listbox page
}
else
{
MessageDialog messageDialog = new MessageDialog("Please fill all fields");//Text should not be empty
await messageDialog.ShowAsync();
}
}
【问题讨论】:
-
您希望我们为您编写代码吗?你遇到了什么问题?
-
我是新手 :( 。我认为这种事情以前有人做过。任何类似的例子都会有所帮助。提前感谢您的时间。
标签: c# sqlite windows-phone-8 windows-phone-8.1 geofencing