Пример #1
0
        private void appointmentTypeButton_Click(object sender, EventArgs e)
        {
            var form = formManager.GetForm <SelectionPopUp>();

            form.SetDateSelection(true);

            form.SetSubmitSelection((string selectedOption, Form selectionForm) =>
            {
                selectionForm.Close();
                var reportForm         = formManager.GetForm <ReportForm>();
                reportForm.onDoneClick = ((Form formToClose) =>
                {
                    formToClose.Close();
                    Show();
                });

                var appointmentTypeDictionary = appointmentService.FindTypesByMonth(DateTime.Parse(selectedOption).Month);
                var reportItems = new List <ReportBase>();
                appointmentTypeDictionary.Keys.ToList().ForEach(p =>
                {
                    var properties = new Dictionary <string, string>();
                    properties.Add("Count", appointmentTypeDictionary[p].ToString());
                    reportItems.Add(new ReportBase()
                    {
                        Title      = p,
                        Properties = properties
                    });
                });

                reportForm.SetReportItems(reportItems);
                reportForm.Show();
            });
            Hide();
            form.Show();
        }