public PedidoModalPage(FoodLine p, string modo) { try { InitializeComponent(); if (ViewModelLocator.PedidoUsuarioViewModel == null) { ViewModelLocator.PedidoUsuarioViewModel = new ViewModel.PedidoViewModel(null); } ViewModelLocator.PedidoUsuarioViewModel.PlatoPedidoModal = p; ViewModelLocator.PedidoUsuarioViewModel.Cantidad = 1; ViewModelLocator.PedidoUsuarioViewModel.DetallePedido = ""; BindingContext = ViewModelLocator.PedidoUsuarioViewModel; var hora = DateTime.Now; var horavar = hora.AddMinutes(30); TimeSpan ts = new TimeSpan(horavar.Hour, horavar.Minute, 0); timepicker.Time = ts; _modo = modo; geo = new Geocoder(); if (modo == "Reserva") { direcTB.IsEnabled = false; direcST.HeightRequest = 0; fechaLb.Text = "Fecha y Hora de Consumo"; } else { direcTB.IsEnabled = true; } } catch (Exception ex) { } }
public async Task OpenPlato(FoodLine fl) { //if (IsBusy || Settings.User == null) // return; //if (ForceSync) // Settings.LastSync = DateTime.Now.AddDays(-30); //IsBusy = true; //ShowPlatoCommand.ChangeCanExecute(); //var showAlert = false; //try //{ //} //catch (Exception ex) //{ // showAlert = true; //} //finally //{ // IsBusy = false; // ShowPlatoCommand.ChangeCanExecute(); //} //if (showAlert) // await page.DisplayAlert("Uh Oh :(", "Ocurrio un error.", "OK"); }
public PlatoPage(FoodLine plato) { InitializeComponent(); dataWCF = DependencyService.Get <IDataStore>(); viewModel = new PlatoViewModel(plato, this); viewModel.SetHeight += ViewModel_SetHeight; BindingContext = viewModel; }
public PlatoViewModel(FoodLine Plato, Page page) : base(page) { this.Plato = Plato; dataWCF = DependencyService.Get <IDataStore>(); this.Comentarios = new ObservableRangeCollection <Comentario>(); Load(); //this.Comentarios.Add(new Comentario { Imagen = "https://s3.hdstatic.net/gridfs/holadoctor/625x470_4f62c7f0b937955271000000_6_32-1331876302.jpg", Contenido = "Este plato esta muy bueno", Usuario = "Juan Perez" }); //this.Comentarios.Add(new Comentario { Imagen = "https://s-media-cache-ak0.pinimg.com/736x/65/2a/c8/652ac88b9fa5bfca6211ea2f0de5b7ab.jpg", Contenido = "No lo prueben me engañaron", Usuario = "Luis Diaz" }); //this.Comentarios.Add(new Comentario { Imagen = "http://arcdn02.mundotkm.com/2015/09/Famosos-1-500x750-267x400.jpg", Contenido = "Este plato lo sirven mejor en otro lugar", Usuario = "Luis Alfaro" }); //this.Comentarios.Add(new Comentario { Imagen = "https://s3.hdstatic.net/gridfs/holadoctor/625x470_4f62c7f0b937955271000000_6_32-1331876302.jpg", Contenido = "Podrian prepararme uno especial", Usuario = "Pedro Arrollo" }); //this.Comentarios.Add(new Comentario { Imagen = "https://s-media-cache-ak0.pinimg.com/736x/65/2a/c8/652ac88b9fa5bfca6211ea2f0de5b7ab.jpg", Contenido = "A este plato le falta su nose que", Usuario = "Teresa Olmedo" }); //this.Comentarios.Add(new Comentario { Imagen = "http://arcdn02.mundotkm.com/2015/09/Famosos-1-500x750-267x400.jpg", Contenido = "Este plato esta muy bueno", Usuario = "Torres J." }); }
void AgregarPedido_Click(object sender, EventArgs e) { Button bt = sender as Button; if (!String.IsNullOrEmpty(bt.CommandParameter.ToString())) { var id = bt.CommandParameter.ToString(); FoodLine fl = new FoodLine { CPlato = viewModel.Carta.FirstOrDefault(p => p._id == id), CProveedor = viewModel.Proveedor }; var ped = new PedidoModalTipo(fl); this.Navigation.PushPopupAsync(ped); } else { var tt = bt.CommandParameter.ToString(); } }
public PedidoModalTipo(FoodLine fl) { InitializeComponent(); fll = fl; }
public OfertarPopUp(FoodLine p) { InitializeComponent(); dataPedido = DependencyService.Get <IDataStore>(); platooferta = p; }