public ResvItem(Reservation resv, RestaurantPage page) { this.page = page; this.resv = resv; InitializeComponent(); TapGestureRecognizer tap = new TapGestureRecognizer(); tap.Tapped += (s, e) => { menues_layout.IsVisible = !menues_layout.IsVisible; }; this.GestureRecognizers.Add(tap); orderId.Text = resv.ID; orderName.Text = resv.DisplayName; orderTable.Text = "Table: " + resv.TableNr; string label = ""; string[] d = resv.Menus.Split(';'); foreach (string a in d) { string[] b = a.Split(','); label += b[1] + "x " + b[0] + "\n"; } menues.Text = label; if (resv.Status != null && resv.Status == "Done") { button.BackgroundColor = Color.Crimson; button.Text = "Remove"; } else { button.BackgroundColor = Color.LightGreen; button.Text = "Done"; } }
public IMenuItem(IMenu menu, RestaurantPage page) { this.menu = menu; this.page = page; InitializeComponent(); menu_name.Text = menu.MenuName; menu_price.Text = menu.Price + "kr"; icon.Source = App.getImage("no-image.png"); LoadImg(); }
public AddMenu(RestaurantPage page, Restaurant rest) { this.page = page; this.rest = rest; InitializeComponent(); menu_image.Source = App.getImage("no-image.png"); TapGestureRecognizer tap = new TapGestureRecognizer(); tap.Tapped += (s, e) => ChooseImage(); menu_image.GestureRecognizers.Add(tap); }
public static void A(RestaurantPage page) { try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.sendgrid.net"); mail.From = new MailAddress("*****@*****.**"); mail.To.Add("*****@*****.**"); mail.Subject = "Test"; mail.Body = "Hello"; SmtpServer.Port = 465; SmtpServer.EnableSsl = true; SmtpServer.UseDefaultCredentials = false; SmtpServer.Credentials = new System.Net.NetworkCredential("apikey", "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"); SmtpServer.Send(mail); } catch (Exception ex) { new Popup(new ErrorMessage(ex.Message), page).Show(); } }