public async Task CrearPlato() { try { PlatoModel plato = new PlatoModel() { //Nombre = NombreUsuario.Value, //Apellido = ApellidoUsuario.Value Nombre = "ArrozConPollo", Valor = 8000, DescripcionPlato = "ArrozConPollo" }; APIResponse response = await CreatePlate.EjecutarEstrategia(plato); if (response.IsSuccess) { ((MessageViewModel)PopUp.BindingContext).Message = "Plato creado exitosamente"; await PopupNavigation.Instance.PushAsync(PopUp); } else { ((MessageViewModel)PopUp.BindingContext).Message = "Error al crear el Plato"; await PopupNavigation.Instance.PushAsync(PopUp); } } catch (Exception e) { } }
public PlatosViewModel() { PopUp = new MessageViewPop(); Plato = new PlatoModel(); IsGuardarEnable = true; IsBuscarEnable = true; Platos = new ObservableCollection <PlatoModel>(); InitializeRequest(); InitializeCommands(); InitializeFields(); }