Пример #1
0
        private void BuildExamsFuncionario(Data.ExameItemColletion exames)
        {
            //BuildRowColletion(_exames.Exames, "Exames");
            //expanded panel
            FlowLayoutPanel expandPanel = new FlowLayoutPanel
            {
                Name      = $"ExpandExame",
                Tag       = $"ExpandExame",
                Dock      = DockStyle.Top,
                Size      = new Size(VacinaPanel.Size.Width, 31),
                BackColor = Color.Red
            };


            foreach (Data.ExamList exameList in exames.Exames)
            {
                var objTypeExam = new Exame(false, exameList.Tipagem)
                {
                    Name = "tipo"
                };
                expandPanel.Controls.Add(objTypeExam);

                foreach (Data.Examitem exame in exameList.ExameColletion)
                {
                    FlowLayoutPanel expandPanelChildTipo = new FlowLayoutPanel
                    {
                        Name      = $"nomeExame",
                        Tag       = $"nomeExame",
                        Dock      = DockStyle.Top,
                        Size      = new Size(VacinaPanel.Size.Width, 30),
                        BackColor = Color.Yellow
                    };
                    var objExameItem = new Exame(true, exame.Nome);
                    expandPanelChildTipo.Controls.Add(objExameItem);
                    FlowLayoutPanel expandPanelChildChildExame = new FlowLayoutPanel
                    {
                        Name      = $"ChildExam",
                        Tag       = $"ChildExam",
                        Dock      = DockStyle.Top,
                        Size      = new Size(VacinaPanel.Size.Width, 30),
                        BackColor = Color.Yellow
                    };
                    //ExpandPanelChildChildExame.Name = "ChildExam";

                    for (int i = 0; i < exame.DataExame.Count; i++)
                    {
                        var objDescricaoExame = new Exame(true, string.Format($"Data: {exame.DataExame[i]} Protocolo {exame.Protocolo[i]}"));

                        expandPanelChildChildExame.Controls.Add(objExameItem);
                        expandPanelChildTipo.Controls.Add(expandPanelChildChildExame);
                    }
                    expandPanel.Controls.Add(expandPanelChildTipo);
                    expandPanel.Size        = new Size(expandPanel.Size.Width, expandPanel.Controls.Count * 34);
                    expandPanel.MaximumSize = new Size(expandPanel.Size.Width, expandPanel.Controls.Count * 34);
                }


                VacinaPanel.Controls.Add(expandPanel);
            }
        }
Пример #2
0
        /// <summary>
        /// trying again using desenho
        /// </summary>
        /// <param name="exames"></param>


        private void BuildExamFunc(Data.ExameItemColletion exames)
        {
            var margim = VacinaPanel.Margin;

            margim.All = 0;


            //foreach list inside exameitemcolletion from funcionario
            foreach (Data.ExamList listaTipo in exames.Exames)
            {
                //CREATES FIRST PANEL, FOR NAME "EXAME" FOR EXAMPLE
                FlowLayoutPanel expand = new FlowLayoutPanel
                {
                    Name          = $"ExpandTipo",
                    Tag           = listaTipo.Tipagem,
                    Dock          = DockStyle.Top,
                    Margin        = margim,
                    FlowDirection = FlowDirection.TopDown,
                    MaximumSize   = new Size(VacinaPanel.Width, 34),
                    Size          = new Size(VacinaPanel.Width, 34),
                    //BackColor = Color.Red
                };
                //add text for desciption of exam tipagem
                var objTipagem = new Exame(false, listaTipo.Tipagem);
                expand.Controls.Add(objTipagem);

                foreach (Data.Examitem listaExame in listaTipo.ExameColletion)
                {
                    //CREATES SECOND PANEL FOR EXAME EXPAND
                    FlowLayoutPanel exameExpandChild1 = new FlowLayoutPanel
                    {
                        Name          = $"ExameExpandChild1",
                        Tag           = listaExame.Nome,
                        Dock          = DockStyle.Top,
                        Margin        = margim,
                        FlowDirection = FlowDirection.TopDown,
                        MaximumSize   = new Size(expand.Width, 34),
                        Size          = new Size(expand.Width, 34),

                        //BackColor = Color.Yellow
                    };
                    //if (testeBool)
                    //{
                    //    ExameExpandChild1.BackColor = Color.Blue;
                    //    testeBool = false;

                    //}
                    //else
                    //{
                    //    testeBool = true;
                    //}
                    var objListaExame = new Exame(true, listaExame.Nome);
                    exameExpandChild1.Controls.Add(objListaExame);

                    for (int i = 0; i < listaExame.DataExame.Count; i++)
                    {
                        var objExameDatas = new Exame(true, listaExame.DataExame[i] + listaExame.Protocolo[i]);
                        objExameDatas.picOpen.Visible = false;
                        objExameDatas.Size            = new Size(VacinaPanel.Width, objExameDatas.Size.Height);
                        var objCheck = new ExameCheckOk();

                        PictureBox examStatus = new PictureBox();
                        examStatus.MaximumSize = new Size(30, 30);
                        examStatus.SizeMode    = PictureBoxSizeMode.StretchImage;
                        if (listaExame.DataExame.Count - 1 == i)
                        {
                            examStatus.Image = objCheck.ReturnImageExamFunc(listaExame);
                        }
                        else
                        {
                            examStatus.Image = Image.FromFile(@"Imagens\Checked.png");
                        }
                        objExameDatas.panelExansOK.Dock = DockStyle.Right;
                        objExameDatas.panelExansOK.Controls.Add(examStatus);


                        objExameDatas.panelChild.Size = new Size(60, 30);
                        exameExpandChild1.Controls.Add(objExameDatas);
                    }
                    expand.Controls.Add(exameExpandChild1);
                }
                VacinaPanel.Controls.Add(expand);
            }
        }
Пример #3
0
        private void BuildExamList(List <Data.ExamList> exames, string nomeexame, int m)
        {
            FlowLayoutPanel expand = new FlowLayoutPanel
            {
                Name = $"ExpandGeral",
                Tag  = $"ExpandGeral",
                Dock = DockStyle.Top
            };

            Color[] cores  = { Color.Red, Color.Blue, Color.LightBlue };
            var     margim = expand.Margin;

            margim.All           = 0;
            expand.FlowDirection = FlowDirection.TopDown;
            expand.Margin        = margim;
            expand.Size          = new Size(VacinaPanel.Size.Width, 200);
            expand.BackColor     = cores[m];

            //add exame tipo
            //EXAME EXTRAS ASO
            //


            Exame exame = new Exame(false, nomeexame)
            {
                Name = "Tipo"
            };
            Exame objTypeExam = exame;

            expand.Controls.Add(objTypeExam);
            //ExpandTipo.Controls.Add(objExames);

            Color[] colors = { Color.Yellow, Color.Blue, Color.Purple };



            for (int i = 0; i < exames.Count; i++)
            {
                //add nomes dos exames
                //hemograma completo
                FlowLayoutPanel expandTipo = new FlowLayoutPanel
                {
                    FlowDirection = FlowDirection.TopDown,
                    Name          = $"ExpandTipo",
                    Tag           = $"ExpandTipo",
                    //AutoSize = true,
                    Dock = DockStyle.Top
                };
                margim.All           = 0;
                expandTipo.Margin    = margim;
                expandTipo.Size      = new Size(VacinaPanel.Size.Width, 31);
                expandTipo.BackColor = colors[i];
                var objExames = new Exame(true, exames[i].ExameColletion[i].Nome.ToString());
                expandTipo.Controls.Add(objExames);



                FlowLayoutPanel expandData = new FlowLayoutPanel
                {
                    FlowDirection = FlowDirection.TopDown,
                    Name          = $"ExpandExame",
                    Tag           = $"ExpandExame",
                    Dock          = DockStyle.Top,
                    AutoSize      = true,
                    AutoSizeMode  = AutoSizeMode.GrowOnly,

                    BackColor = Color.Brown,
                    Margin    = margim
                };



                for (int j = 0; j < exames[i].ExameColletion[i].DataExame.Count; j++)
                {
                    string dataProtocolo    = string.Format($"Data: {exames[i].ExameColletion[i].DataExame[j].ToString("dd/MM/yyyy")} Protocolo nº {exames[i].ExameColletion[i].Protocolo[j]}");
                    var    objDataProtocolo = new Exame(true, dataProtocolo);
                    objDataProtocolo.panelChild.Size = new Size(52, 30);
                    objDataProtocolo.picOpen.Image   = Image.FromFile(@"Imagens\checked.png");
                    objDataProtocolo.picOpen.Tag     = "checked";
                    expandData.Controls.Add(objDataProtocolo);
                }
                Control.ControlCollection teste = expandData.Controls;
                int size = 13;
                foreach (Control item in teste)
                {
                    size += item.Size.Height;
                }
                expandData.Size = new Size(VacinaPanel.Size.Width, size);
                expand.Controls.Add(expandTipo);
                expand.Controls.Add(expandData);
                expand.Size        = new Size(expand.Size.Width, 31);
                expand.MaximumSize = new Size(expand.Size.Width, 31);
            }
            expand.Size        = new Size(expand.Size.Width, 30);
            expand.MaximumSize = new Size(expand.Size.Width, 30);
            //ADD MAIN EXPAND PANEL TO PREVIOUSLY OWNED PANEL IN TALBCONTROL FUNCIONARIOVIEW
            VacinaPanel.Controls.Add(expand);
        }