public FrmAlmoco() { InitializeComponent(); int lastid = AlmocoViewModel.listar().Count + 1; almocoR = new AlmocoView() { Id_almoco = lastid, Frutafk = 0, Liquidofk = 0, GraoIntegralfk = 0, Proteinafk = 0, Vegetalfk = 0 }; }
//VALIDAÇÕES protected bool ValidarAlmoco(AlmocoView pobject) { if (App.Current.Actives.R_almoco.Frutafk != 0 && App.Current.Actives.R_almoco.Liquidofk != 0 && App.Current.Actives.R_almoco.Proteinafk != 0 && App.Current.Actives.R_almoco.GraoIntegralfk != 0 && App.Current.Actives.R_almoco.Vegetalfk != 0) { App.Current.Actives.bolRefeicoes[2] = true; App.Current.Actives.R_almoco.Id_almoco = AlmocoViewModel.listar().Count + 1; return(true); } else { return(false); } }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnNavigatedTo(NavigationEventArgs e) { if (App.Current.Actives.ActiveImagem != null) { thisImagem.Source = new BitmapImage(new Uri(App.Current.Actives.ActiveImagem, UriKind.RelativeOrAbsolute)); App.Current.Actives.ActiveImagem = null; } if (App.Current.Actives.R_almoco.Id_almoco != 0) { this.imgAlmocoFrutas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarFrutas()[App.Current.Actives.R_almoco.Frutafk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgcopo.Source = new BitmapImage(new Uri(AlimentoViewModel.listarCopos()[App.Current.Actives.R_almoco.Liquidofk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgAlmocoVegetais.Source = new BitmapImage(new Uri(AlimentoViewModel.listarvegetal()[App.Current.Actives.R_almoco.Vegetalfk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgAlmocoProteinas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarProteinas()[App.Current.Actives.R_almoco.Proteinafk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgAlmocoGraos.Source = new BitmapImage(new Uri(AlimentoViewModel.listarGraoIntegral()[App.Current.Actives.R_almoco.GraoIntegralfk - 1].Img_source, UriKind.RelativeOrAbsolute)); almocoR = App.Current.Actives.R_almoco; } }