コード例 #1
0
        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));
        }
コード例 #2
0
        public void RateDoctor(ItemDoctor doctor, string mark)
        {
            Initialize();

            if (doctor == null)
            {
                throw new ArgumentNullException(nameof(doctor));
            }

            DCode         = doctor.Code;
            DocName       = doctor.Name;
            DocDepartment = doctor.Department;
            DocDeptCode   = doctor.DeptCode;
            Mark          = mark;
            Type          = SurveyType.Doctor;
        }