/// <summary>МЕТОД Создаем объект Pole</summary> /// <param name="pTypePole">Номер типа поля eTypePole</param> protected VirtualPole MET_CreateUserPole(int pTypePole) { VirtualPole _Pole; switch (pTypePole) { case 1: _Pole = new UserPole_Number(); break; case 2: _Pole = new UserPole_Text(); break; case 3: _Pole = new UserPole_Data(); break; case 4: _Pole = new UserPole_Text(); break; case 5: _Pole = new UserPole_ComboBox(); // список break; case 6: _Pole = new UserPole_Text(); break; case 7: _Pole = new UserPole_MultyList(); // пока только операции break; case 8: _Pole = new UserPole_Text(); break; case 9: _Pole = new UserPole_Razdel(); break; case 10: _Pole = new UserPole_Text(); break; case 11: _Pole = new UserPole_Text(); break; case 12: _Pole = new UserPole_RadioButton(); break; case 13: _Pole = new UserPole_Image(); break; case 14: _Pole = new UserPole_Grid(); break; case 15: _Pole = new UserPole_Label(); break; case 16: _Pole = new UserPole_Sprav(); // справочники break; case 17: _Pole = new UserPole_Calendar(); break; default: _Pole = new UserPole_Text(); break; } // Проставляем тип поля _Pole.PROP_Type = (eVopros)pTypePole; _Pole.PROP_Docum = PROP_Docum; return(_Pole); }
/// <summary>МЕТОД Создание фильтров</summary> protected void MET_CreateFiltr() { PART_Grid.RowDefinitions[0].Height = new GridLength(80, GridUnitType.Auto); PART_Expander.Visibility = Visibility.Visible; PART_Expander.IsExpanded = true; Border _Border = new Border { Style = (Style)FindResource("Border_2") }; PART_Expander.Content = _Border; StackPanel _SPanel = new StackPanel(); _Border.Child = _SPanel; // ---- Настраиваем 1й фильтр StackPanel _SPanel_1 = new StackPanel(); _SPanel_1.Orientation = Orientation.Horizontal; _SPanel_1.Margin = new Thickness(0, 2, 0, 2); _SPanel.Children.Add(_SPanel_1); // Тип документа PRI_TipRadioButton = new UserPole_RadioButton(); PRI_TipRadioButton.PROP_Description = "Где ищем:"; PRI_TipRadioButton.PROP_Items.Add(new ListBoxItem() { Content = "Пациент" }); PRI_TipRadioButton.PROP_Items.Add(new ListBoxItem() { Content = "Поликлиника" }); PRI_TipRadioButton.PROP_Items.Add(new ListBoxItem() { Content = "Стационар" }); PRI_TipRadioButton.PROP_Items.Add(new ListBoxItem() { Content = "Параклиника" }); PRI_TipRadioButton.ItemsChanged += delegate { PRI_Timer.Start(); }; _SPanel_1.Children.Add(PRI_TipRadioButton); // ---- Настраиваем 2й фильтр StackPanel _SPanel_2 = new StackPanel(); _SPanel_2.Orientation = Orientation.Horizontal; _SPanel_2.Margin = new Thickness(0, 2, 0, 2); _SPanel.Children.Add(_SPanel_2); Label _Label_1 = new Label(); _Label_1.Content = "Посещал с :"; _Label_1.Foreground = Brushes.Navy; _SPanel_2.Children.Add(_Label_1); // Дата с PRI_DatePicker_1 = new DatePicker(); PRI_DatePicker_1.SelectedDateFormat = DatePickerFormat.Short; PRI_DatePicker_1.Text = new DateTime(DateTime.Today.Year, 1, 1).ToString(); PRI_DatePicker_1.DisplayDateEnd = DateTime.Today; PRI_DatePicker_1.DisplayDateStart = DateTime.Parse("01/01/2007"); PRI_DatePicker_1.IsEnabled = true; PRI_DatePicker_1.SelectedDateChanged += delegate { PRI_Timer.Start(); }; _SPanel_2.Children.Add(PRI_DatePicker_1); Label _Label_2 = new Label(); _Label_2.Content = " по :"; _Label_2.Foreground = Brushes.Navy; _SPanel_2.Children.Add(_Label_2); // Дата по PRI_DatePicker_2 = new DatePicker(); PRI_DatePicker_2.SelectedDateFormat = DatePickerFormat.Short; PRI_DatePicker_2.Text = DateTime.Today.ToString(); PRI_DatePicker_2.DisplayDateEnd = DateTime.Today; PRI_DatePicker_2.DisplayDateStart = DateTime.Parse("01/01/2007"); PRI_DatePicker_2.IsEnabled = true; PRI_DatePicker_2.SelectedDateChanged += delegate { PRI_Timer.Start(); }; _SPanel_2.Children.Add(PRI_DatePicker_2); PRI_Timer = new DispatcherTimer(); PRI_Timer.Interval = new TimeSpan(0, 0, 1); PRI_Timer.Tick += delegate { PRI_Timer.Stop(); MET_SqlFilter(); }; }