public PageRateDoctor(ItemDoctor doctor) { InitializeComponent(); this.doctor = doctor ?? throw new ArgumentNullException(nameof(doctor)); MainWindow.Instance.SetupPage(this, ButtonBack, ButtonHome); Loaded += (s, e) => { (Application.Current.MainWindow as MainWindow).SetupTitle("Оцените приём у врача", doctor.Department + " @ " + doctor.Name); }; foreach (UIElement uiElement in StackPanelRates.Children) { if (uiElement is Button button) { MainWindow.ApplyStyleForButtons(new List <Button> { uiElement as Button }); } } TextBlockDocName.Text = doctor.Name; TextBlockDocName.FontSize = 40; ImageDocPhoto.Source = ControlsFactory.ImageSourceForBitmap( (System.Drawing.Bitmap)ControlsFactory.GetImageForDoctor(doctor.Name)); }
public PageServices(string department) { InitializeComponent(); MainWindow.Instance.SetupPage(this, ButtonBack, ButtonHome); UserContent.JournalOwnership = JournalOwnership.OwnsJournal; Loaded += (s, e) => { (Application.Current.MainWindow as MainWindow).SetupTitle("Услуги и цены"); }; MainWindow.ApplyStyleForButtons(new List <Button> { ButtonScrollDown, ButtonScrollUp }); TextBlockDepartment.Text = department; TextBlockDepartment.FontSize = 40; ImageDepartment.Source = ControlsFactory.ImageSourceForBitmap((System.Drawing.Bitmap)ControlsFactory.GetImageForDepartment(department)); List <ItemService> pageObjects = new List <ItemService>(); List <ItemService> priceList = Services.DataProvider.Services[department]; for (int i = 0; i < priceList.Count; i++) { pageObjects.Add(priceList[i]); if (pageObjects.Count == 10) { AddPageToList(pageObjects); } } if (pageObjects.Count > 0) { AddPageToList(pageObjects); } UserContent.Content = pages[0].Key; if (pages.Count > 1) { ButtonScrollDown.Click += ButtonScrollDown_Click; ButtonScrollUp.Click += ButtonScrollUp_Click; pages[0].Value.Background = new SolidColorBrush(Colors.Gray); ButtonScrollDown.Visibility = Visibility.Visible; GridPagesIndicator.Visibility = Visibility.Visible; } currentPageIndex = 0; }
public PageSchedule(string department) { InitializeComponent(); MainWindow.Instance.SetupPage(this, ButtonBack, ButtonHome); UserContent.JournalOwnership = JournalOwnership.OwnsJournal; Loaded += (s, e) => { (Application.Current.MainWindow as MainWindow).SetupTitle("Расписание приёма врачей"); }; MainWindow.ApplyStyleForButtons(new List <Button> { ButtonScrollDown, ButtonScrollUp }); TextBlockDepartment.Text = department; TextBlockDepartment.FontSize = 40; ImageDepartment.Source = ControlsFactory.ImageSourceForBitmap((System.Drawing.Bitmap)ControlsFactory.GetImageForDepartment(department)); List <KeyValuePair <string, SortedDictionary <string, string> > > pageObjects = new List <KeyValuePair <string, SortedDictionary <string, string> > >(); foreach (KeyValuePair <string, SortedDictionary <string, string> > keyValuePair in Services.DataProvider.Schedule[department]) { pageObjects.Add(keyValuePair); if (pageObjects.Count == 11) { AddPageToList(pageObjects); } } if (pageObjects.Count > 0) { AddPageToList(pageObjects); } UserContent.Content = pages[0].Key; if (pages.Count > 1) { ButtonScrollDown.Click += ButtonScrollDown_Click; ButtonScrollUp.Click += ButtonScrollUp_Click; pages[0].Value.Background = new SolidColorBrush(Colors.Gray); ButtonScrollDown.Visibility = Visibility.Visible; GridPagesIndicator.Visibility = Visibility.Visible; } currentPageIndex = 0; }
public PageSelectDoctor(string department, bool isSourceDocInfo = false) { InitializeComponent(); MainWindow.Instance.SetupPage(this, ButtonBack, ButtonHome); this.isSourceDocInfo = isSourceDocInfo; title = isSourceDocInfo ? "Врачи" : "Оценка приёма у врача"; UserContent.JournalOwnership = JournalOwnership.OwnsJournal; Loaded += (s, e) => { (Application.Current.MainWindow as MainWindow).SetupTitle(title, department); if (!isLoaded) { List <ItemDoctor> pageObjects = new List <ItemDoctor>(); List <ItemDoctor> doctors = Services.DataProvider.Survey[department]; for (int i = 0; i < doctors.Count; i++) { pageObjects.Add(doctors[i]); if (pageObjects.Count == 10) { AddPageToList(pageObjects); } } if (pageObjects.Count > 0) { AddPageToList(pageObjects); } UserContent.Content = pages[0].Key; if (pages.Count > 1) { ButtonScrollDown.Click += ButtonScrollDown_Click; ButtonScrollUp.Click += ButtonScrollUp_Click; pages[0].Value.Background = new SolidColorBrush(Colors.Gray); ButtonScrollDown.Visibility = Visibility.Visible; GridPagesIndicator.Visibility = Visibility.Visible; } currentPageIndex = 0; isLoaded = true; } }; MainWindow.ApplyStyleForButtons(new List <Button> { ButtonScrollDown, ButtonScrollUp }); if (isSourceDocInfo) { TextBlockSubtitle.Text = "Выберите врача, для просмотра подробной информации" + Environment.NewLine + "Для выбора коснитесь нужной кнопки:"; TextBlockSubtitle.FontSize = 40; } TextBlockDepartment.Text = department; TextBlockDepartment.FontSize = 40; TextBlockSubtitle.FontSize = 40; ImageDepartment.Source = ControlsFactory.ImageSourceForBitmap((System.Drawing.Bitmap)ControlsFactory.GetImageForDepartment(department)); }