コード例 #1
0
        private void paocerealList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            lst = AlimentoViewModel.listarPaes();
            thisApp.Actives.ActiveImagem      = lst[paocerealList.SelectedIndex].Img_source;
            thisApp.Actives.IdAlimento_Select = paocerealList.SelectedIndex + 1;

            switch (App.Current.Actives.IdRefeicao_Select)
            {
            case 1:
                App.Current.Actives.R_cafedamanha.Paofk = paocerealList.SelectedIndex + 1;
                break;

            case 2:
                App.Current.Actives.R_lanchedamanha.Paofk = paocerealList.SelectedIndex + 1;
                break;

            case 4:
                App.Current.Actives.R_lanchetarde.Paofk = paocerealList.SelectedIndex + 1;
                break;

            case 6:
                App.Current.Actives.R_lanchenoite.Paofk = paocerealList.SelectedIndex + 1;
                break;

            default:
                break;
            }

            this.NavigationService.GoBack();
        }
コード例 #2
0
        //FIM EVENTOS IMAGENS

        /// <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_lanchetarde.Id_lanchedatarde != 0)
            {
                this.imgLANCHETardeFrutas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarFrutas()[App.Current.Actives.R_lanchetarde.Frutafk - 1].Img_source, UriKind.RelativeOrAbsolute));
                this.imgcopo.Source = new BitmapImage(new Uri(AlimentoViewModel.listarCopos()[App.Current.Actives.R_lanchetarde.Liquidofk - 1].Img_source, UriKind.RelativeOrAbsolute));
                this.imgLANCHETardePaesCereais.Source = new BitmapImage(new Uri(AlimentoViewModel.listarPaes()[App.Current.Actives.R_lanchetarde.Paofk - 1].Img_source, UriKind.RelativeOrAbsolute));
                lanchetardeR = App.Current.Actives.R_lanchetarde;
            }
        }
コード例 #3
0
        //FIM EVENTOS IMAGENS

        /// <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_cafedamanha.Id_cafedamanha != 0)
            {
                this.imgFrutas.Source          = new BitmapImage(new Uri(AlimentoViewModel.listarFrutas()[App.Current.Actives.R_cafedamanha.Frutafk - 1].Img_source, UriKind.RelativeOrAbsolute));
                this.imgcopo.Source            = new BitmapImage(new Uri(AlimentoViewModel.listarCopos()[App.Current.Actives.R_cafedamanha.Liquidofk - 1].Img_source, UriKind.RelativeOrAbsolute));
                this.imgCafePaesCereais.Source = AlimentoViewModel.listarPaes()[App.Current.Actives.R_cafedamanha.Paofk - 1].ImgConvertedSource();
                cafedamanhaR = App.Current.Actives.R_cafedamanha;
            }
        }
コード例 #4
0
        /// <summary>
        /// Exibe os pretos de cada tipo de refeição.
        /// </summary>
        public void MostrarPratos()
        {
            atual = MontapratoViewModel.BuscarporIDSemana(
                App.Current.Actives.IdSemena_Select);
            if (atual.Statuspronto)
            {
                //"café da manhã";
                this.Ctrlprato_cafedamanha.imgFrutas.Source =
                    AlimentoViewModel.listarFrutas()[
                        CafedaManhaViewModel.listar()
                        [atual.Cafedamanha_fk - 1].Frutafk - 1].ImgConvertedSource();
                this.Ctrlprato_cafedamanha.imgPaos.Source =
                    AlimentoViewModel.listarPaes()[
                        CafedaManhaViewModel.listar()
                        [atual.Cafedamanha_fk - 1].Paofk - 1].ImgConvertedSource();
                //"lanche da manhã";
                this.Ctrlprato_lanchedamanha.imgFrutas.Source =
                    AlimentoViewModel.listarFrutas()[
                        LanchedaManhaViewModel.listar()
                        [atual.Lanchemanha_fk - 1].Frutafk - 1].ImgConvertedSource();
                this.Ctrlprato_lanchedamanha.imgPaos.Source =
                    AlimentoViewModel.listarPaes()[
                        LanchedaManhaViewModel.listar()
                        [atual.Lanchemanha_fk - 1].Paofk - 1].ImgConvertedSource();
                // "almoço";

                this.Ctrlprato_almoco.imgFrutas.Source =
                    AlimentoViewModel.listarFrutas()[
                        AlmocoViewModel.listar()
                        [atual.Almoco_fk - 1].Frutafk - 1].ImgConvertedSource();
                this.Ctrlprato_almoco.imgGraos.Source = AlimentoViewModel.listarGraoIntegral()[
                    AlmocoViewModel.listar()
                    [atual.Almoco_fk - 1].GraoIntegralfk - 1].ImgConvertedSource();
                this.Ctrlprato_almoco.imgProteinas.Source = AlimentoViewModel.listarProteinas()[
                    AlmocoViewModel.listar()
                    [atual.Almoco_fk - 1].Proteinafk - 1].ImgConvertedSource();
                this.Ctrlprato_almoco.imgVegetais.Source = AlimentoViewModel.listarvegetal()[
                    AlmocoViewModel.listar()
                    [atual.Almoco_fk - 1].Vegetalfk - 1].ImgConvertedSource();
                //"lanche da tarde";

                this.Ctrlprato_lanchedatarde.imgFrutas.Source =
                    AlimentoViewModel.listarFrutas()[
                        LanchedaTardeViewModel.listar()
                        [atual.Lanchetarde_fk - 1].Frutafk - 1].ImgConvertedSource();
                this.Ctrlprato_lanchedatarde.imgPaos.Source =
                    AlimentoViewModel.listarPaes()[
                        LanchedaTardeViewModel.listar()
                        [atual.Lanchetarde_fk - 1].Paofk - 1].ImgConvertedSource();

                //janta

                this.Ctrlprato_janta.imgFrutas.Source = AlimentoViewModel.listarFrutas()[
                    JantaViewModel.listar()
                    [atual.Jantar_fk - 1].Frutafk - 1].ImgConvertedSource();
                this.Ctrlprato_janta.imgGraos.Source = AlimentoViewModel.listarGraoIntegral()[
                    JantaViewModel.listar()
                    [atual.Jantar_fk - 1].GraoIntegralfk - 1].ImgConvertedSource();
                this.Ctrlprato_janta.imgProteinas.Source = AlimentoViewModel.listarProteinas()[
                    JantaViewModel.listar()
                    [atual.Jantar_fk - 1].Proteinafk - 1].ImgConvertedSource();
                this.Ctrlprato_janta.imgVegetais.Source = AlimentoViewModel.listarvegetal()[
                    JantaViewModel.listar()
                    [atual.Jantar_fk - 1].Vegetalfk - 1].ImgConvertedSource();

                //"lanche da noite";

                this.Ctrlprato_lanchedanoite.imgFrutas.Source = AlimentoViewModel.listarFrutas()[
                    LanchedaNoiteViewModel.listar()
                    [atual.Lanchedanoite_fk - 1].Frutafk - 1].ImgConvertedSource();
                this.Ctrlprato_lanchedanoite.imgPaos.Source =
                    AlimentoViewModel.listarPaes()[
                        LanchedaNoiteViewModel.listar()
                        [atual.Lanchedanoite_fk - 1].Paofk - 1].ImgConvertedSource();
            }
        }
コード例 #5
0
        public void trocarNomeHeader()
        {
            #region Verificação do tipo de qual alimento será referenciado
            //Lista de alimentos a exibir;
            List <AlimentoView> lstDados = new List <AlimentoView>();

            switch (App.Current.Actives.IdRefeicao_Select)
            {
            case 1:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "café da manhã";
                // Recolhando os alimentos que serão exibidos:
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        CafedaManhaViewModel.listar()[atual.Cafedamanha_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarPaes()[
                        CafedaManhaViewModel.listar()[atual.Cafedamanha_fk - 1].Paofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarCopos()[
                        CafedaManhaViewModel.listar()[atual.Cafedamanha_fk - 1].Liquidofk - 1]);
                break;

            case 2:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "lanche da manhã";
                // Recolhando os alimentos que serão exibidos:
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        LanchedaManhaViewModel.listar()[atual.Lanchemanha_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarCopos()[
                        LanchedaManhaViewModel.listar()[atual.Lanchemanha_fk - 1].Liquidofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarPaes()[
                        LanchedaManhaViewModel.listar()[atual.Lanchemanha_fk - 1].Paofk - 1]);
                break;

            case 3:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "almoço";
                // Recolhando os alimentos que serão exibidos:
                lstDados.Add(
                    AlimentoViewModel.listarCopos() [
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].Liquidofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarGraoIntegral()[
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].GraoIntegralfk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarvegetal()[
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].Vegetalfk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarProteinas()[
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].Proteinafk - 1]);
                break;

            case 4:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "lanche da tarde";
                // Exibe as imagens correspondentes no prato e copo:
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        LanchedaTardeViewModel.listar()[atual.Lanchetarde_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarCopos()[
                        LanchedaTardeViewModel.listar()[atual.Lanchetarde_fk - 1].Liquidofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarPaes()[
                        LanchedaTardeViewModel.listar()[atual.Lanchetarde_fk - 1].Paofk - 1]);
                break;

            case 5:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "jantar";
                // Exibe as imagens correspondentes no prato e copo:
                lstDados.Add(
                    AlimentoViewModel.listarCopos() [
                        JantaViewModel.listar()[atual.Jantar_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarGraoIntegral()[
                        JantaViewModel.listar()[atual.Jantar_fk - 1].GraoIntegralfk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarvegetal()[
                        JantaViewModel.listar()[atual.Jantar_fk - 1].Vegetalfk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        JantaViewModel.listar()[atual.Jantar_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarProteinas()[
                        JantaViewModel.listar()[atual.Jantar_fk - 1].Proteinafk - 1]);
                break;

            case 6:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "lanche da noite";
                // Exibe as imagens correspondentes no prato e copo:
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        LanchedaNoiteViewModel.listar()
                        [atual.Lanchedanoite_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarCopos()[
                        LanchedaNoiteViewModel.listar()
                        [atual.Lanchedanoite_fk - 1].Liquidofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarPaes()[
                        LanchedaNoiteViewModel.listar()
                        [atual.Lanchedanoite_fk - 1].Paofk - 1]);

                break;

            default:
                break;
            }
            // Fim da Listagem detalhada da refeição:
            for (int i = 0; i < lstDados.Count; i++)
            {
                lstDados[i].Id_alimento = i + 1;
            }
            this.DadosalimentosCtrl.lstDadosAlimento.ItemsSource = lstDados;
            #endregion
        }
コード例 #6
0
        public FrmCafe()
        {
            InitializeComponent();

            this.paocerealList.ItemsSource = AlimentoViewModel.listarPaes();
        }