private void Page_Loaded(object sender, RoutedEventArgs e) { //try //{ // pageMode = PageFunctions.pageParameter(this, "Mode"); //} //catch (Exception generalException) //{ // MessageFunctions.Error("Error retrieving query details", generalException); // PageFunctions.ShowTilesPage(); //} FromDate.SelectedDate = fromDate = Globals.StartOfMonth; ToDate.SelectedDate = toDate = Globals.Today; refreshTypeNames(); refreshStaffCombo(); FromDate.Focus(); ToDate.Focus(); TypeCombo.Focus(); }
private void Page_Loaded(object sender, RoutedEventArgs e) { //try //{ // pageMode = PageFunctions.pageParameter(this, "Mode"); //} //catch (Exception generalException) //{ // MessageFunctions.Error("Error retrieving query details", generalException); // PageFunctions.ShowTilesPage(); //} FromDate.SelectedDate = fromDate = Globals.StartOfMonth; ToDate.SelectedDate = toDate = Globals.Today; refreshTableNames(); refreshStaffCombo(); FromDate.Focus(); ToDate.Focus(); TableCombo.Focus(); MessageFunctions.InfoAlert("Only records within or relevant to the current Entity (" + Globals.CurrentEntityName + ") are displayed.", "Please note:"); }
private void Button_Clicked(object sender, EventArgs e) { string fdate = FromDate.DateTime.ToString(); DateTime t = Convert.ToDateTime(fdate); //DateTime t = ToDate.DateTime; TimeSpan selectTime = timepick._timePicker.Time; // DateTime selectDateTime = DateTime.ParseExact(fdate + " " + selectTime, "dd/MM/yy hh:mm:ss tt", CultureInfo.GetCultureInfo("en-IN")); string current = DateTime.Now.ToShortDateString(); DateTime c = Convert.ToDateTime(current); TimeSpan now = DateTime.Now.TimeOfDay; string td = tableDetails.Text; if (c <= t) { if (now < selectTime) { if (td != "") { if (NumberofPerson.SelectedItem != null) { _book.BookModel.customerName = CustName.Text; _book.BookModel.bookedTable = tableDetails.Text; _book.BookModel.bookedCount = TotalCount; _book.BookModel.fromDate = FromDate.DateTime; _book.BookModel.Time = timepick._timePicker.Time; _book.BookModel.numberOfPerson = Convert.ToInt32(NumberofPerson.SelectedItem.ToString()); _book.BookModel.venue = Venue.Text; _book.BookModel.specialNote = SpecialNotes.Text; if (shisha.IsToggled == true) { _book.BookModel.shisha = "YES"; } else { _book.BookModel.shisha = "NO"; } int s = _book.OnAddItem(); if (s == 1) { DisplayAlert("Reservation", "The Table Reservation Request is Success", "OK"); DisplayAlert.IsVisible = true; shisha.IsToggled = false; tableDetails.Text = ""; SpecialNotes.Text = ""; Venue.Text = ""; array.Clear(); } else { DisplayAlert("Reservation", "Server down, Please try later", "OK"); } } else { DisplayAlert("Error", "Select Number of Person", "OK"); NumberofPerson.Focus(); } } else { DisplayAlert("Error", "Choose Table", "OK"); } } else { DisplayAlert("Error", "Invalid Time", "OK"); timepick.Focus(); } } else { DisplayAlert("Error", "Invalid Date", "OK"); FromDate.Focus(); } }