Esempio n. 1
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            var data = (Person)PersonListBinding.Current;

            switch (e.ColumnIndex)
            {
            case 0:
                EventConsultationListBinding.DataSource = data.EventConsultations.ToList();
                ConsultationListBinding.DataSource      = data.Consultations.ToList();
                dtgvConsultations.DataSource            = ConsultationListBinding;
                eventConsultationsDtgv.DataSource       = EventConsultationListBinding;
                propertyGrid1.SelectedObject            = data;

                break;

            case 1:
                var pg = ControlsFactory.Resolve <ManagePersonPage>();
                pg.GetModelData(data);
                DialogActivator.OpenDialog(pg, $"Edit person detail: {data.FullName}.",
                                           () =>
                {
                    HealthCenterService.ModifyProfile(data);
                });
                break;

            case 2:
                ExcelReports.GeneratePersonReport(data);
                break;
            }
        }
Esempio n. 2
0
        private async void LoadDetails()
        {
            var control = ControlsFactory.ResolveWpfControl <EventsView>();

            elementHost1.Child = control;

            var data = await HealthCenterService.LoadEvents();

            EventList = data.ToList();

            control.ExportAction = () =>
            {
                ExcelReports.GenerateEventParticipants(EventList);
            };

            control.ExportSingleAction = (ev) =>
            {
                ExcelReports.GemerateParticipantEvent(ev);
            };

            control.ViewAction = (obj) =>
            {
                CurrentEvent = obj;
                EventLogBinding.DataSource  = obj.Logs.ToList();
                dtgvPersonevents.DataSource = EventLogBinding;
            };


            control.CreateAction = () =>
            {
                var pg           = ControlsFactory.Resolve <ManageEventsPage>();
                var currentevent = new PersonEvents();
                pg.GetModelData(currentevent);
                DialogActivator.OpenDialog(pg, $"New event", () =>
                {
                    HealthCenterService.CreateEvent(currentevent);
                    LoadDetails();
                });
            };

            control.UpdateAction = (obj) =>
            {
                var pg           = ControlsFactory.Resolve <ManageEventsPage>();
                var currentevent = obj;
                pg.GetModelData(currentevent);
                DialogActivator.OpenDialog(pg, $"Update event {obj.Title}", () =>
                {
                    HealthCenterService.ModifyEvent(currentevent);
                    LoadDetails();
                });
            };



            control.LoadEvents(data);

            LoadEventParticipantChart();
            LoadEventPersonCategoriesChart();
        }
Esempio n. 3
0
 // => active
 public void ToggleActive(string[] lines, DialogActivator da)
 {
     gm.DialogOpen = true;
     this.da       = da;
     dialogLines   = lines;
     dialogBox.SetActive(true);
     StartCoroutine("typeText");
 }
Esempio n. 4
0
 void clear()
 {
     StopAllCoroutines();
     dialogText.text      = "";
     dialogBadgeText.text = "";
     dialogLines          = null;
     da          = null;
     currentLine = 0;
     focussed    = false;
 }
Esempio n. 5
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            var pg   = ControlsFactory.Resolve <ManageAccountPage>();
            var data = new Account();

            pg.GetModelData(data);
            DialogActivator.OpenDialog(pg, "New account detail",
                                       () =>
            {
                HealthCenterService.CreateAccount(data);
            });
        }
Esempio n. 6
0
        private void CreateBtn_Click(object sender, EventArgs e)
        {
            var pg   = ControlsFactory.Resolve <ManagePersonPage>();
            var data = new Person();

            pg.GetModelData(data);
            DialogActivator.OpenDialog(pg, "New person detail",
                                       () =>
            {
                HealthCenterService.CreateProfile(data);
            });
        }
Esempio n. 7
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            var pg = ControlsFactory.Resolve <ManageCreateNewConsultationPage>();

            DialogActivator.OpenDialog(pg, $"New participant", async() =>
            {
                pg.Data.Event = CurrentEvent.Id;
                await HealthCenterService.CreateEventLogs(pg.Data);

                LoadDetails();
            });
        }
Esempio n. 8
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            var pg   = ControlsFactory.Resolve <ManageCategoryPage>();
            var data = new PersonCategory();

            pg.GetModelData(data);
            DialogActivator.OpenDialog(pg, "New Category",
                                       () =>
            {
                HealthCenterService.CreateCategory(data);
            });
        }
Esempio n. 9
0
 private void dtgvailment_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     switch (e.ColumnIndex)
     {
     case 0:
         var pg   = ControlsFactory.Resolve <ManageAilmentPage>();
         var data = (Ailments)AilmentListBinding.Current;
         pg.GetModelData(data);
         DialogActivator.OpenDialog(pg, "Modify Ailment",
                                    () =>
         {
             HealthCenterService.ModifyAilment(data);
         });
         break;
     }
 }
Esempio n. 10
0
        private void dtgvConsultations_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            var person = (Person)PersonListBinding.Current;
            var data   = (Consultation)ConsultationListBinding.Current;

            switch (e.ColumnIndex)
            {
            case 0:
                var pg = ControlsFactory.Resolve <ManageConsultationPage>();
                pg.GetModelData(data);
                DialogActivator.OpenDialog(pg, $"Edit medical consultation {person.FullName}",
                                           async() =>
                {
                    await HealthCenterService.ModifyMedicalConsultation(data);
                });
                break;
            }
        }
Esempio n. 11
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            var person = (Person)PersonListBinding.Current;

            var pg   = ControlsFactory.Resolve <ManageConsultationPage>();
            var data = new Consultation()
            {
                PersonId = person.Id
            };


            pg.GetModelData(data);
            DialogActivator.OpenDialog(pg, "New medical consultation",
                                       async() =>
            {
                await HealthCenterService.CreateMedicalConsultation(data);
            });
        }
Esempio n. 12
0
        private void dtgvAcc_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            var data = (Account)AccountListBinding.Current;

            switch (e.ColumnIndex)
            {
            case 0:
                AccountLogsListBinding.DataSource = data.Logs.ToList();
                dtgvlogs.DataSource = AccountLogsListBinding;
                break;

            case 1:
                var pg = ControlsFactory.Resolve <ManageAccountPage>();
                pg.GetModelData(data);
                DialogActivator.OpenDialog(pg, "New account detail",
                                           () =>
                {
                    HealthCenterService.ModifyAccount(data);
                });
                break;
            }
        }
Esempio n. 13
0
 public void UnregisterDialogEntity(DialogActivator dialogEntity)
 {
     dialogEntities.Remove(dialogEntity);
 }
Esempio n. 14
0
 public void RegisterDialogEntity(DialogActivator newDialogEntity)
 {
     dialogEntities.Add(newDialogEntity);
 }