private void AtualizaForm()
        {
            if (ListAgenda != null)
            {
                ListAgenda.Clear();
            }

            ListAgenda = AgendaRepositorySQLite.GetAll().ToList <Agenda>();
            var a       = ListAgenda.OrderBy(p => p.PacienteNome).ThenBy(p => p.Data).ThenBy(p => p.Horas).ToList();
            var binding = new BindingList <Agenda>(a);

            grdAgenda.DataSource = binding;
            grdAgenda.Refresh();

            lblResults.Text = ListAgenda.Count.ToString() + " registros encontrados";

            var listaPaciente = ClienteRepositorySQLite.GetAll();
            AutoCompleteStringCollection dados = new AutoCompleteStringCollection();

            foreach (var item in listaPaciente)
            {
                dados.Add(item.Nome + " • " + item.Id);
            }

            txtPaciente.AutoCompleteCustomSource = dados;

            txtPaciente.Text    = "";
            txtDataInicial.Text = "__/__/____";
            txtDataFim.Text     = "__/__/____";
            txtHoraInicial.Text = "__:__";
            txtHoraInicial.Text = "__:__";

            FillDdl();
        }
Exemple #2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string path = @"Clinica_01.Reports.AgendaReport.rdlc";

            if (this.reportViewer == null)
            {
                this.reportViewer = new ReportViewer();
            }

            var ListAgenda = AgendaRepositorySQLite.GetAll().ToList <Agenda>();

            this.reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", ListAgenda));

            FormReport frmReport = new FormReport(this.reportViewer, path, GetParametersToPrint());

            frmReport.ShowDialog();
        }