} // ООткрытие формы авторизации private void OcenkaPanelBtn_Click(object sender, EventArgs e) { if (Program.Dolj == "3") { MessageBox.Show("У вас нет доступа для данной функции!"); OcenkaPanelBtn.Enabled = false; } else { if (Height != 168) { Height = 168; this.Controls.Remove(OcenkaDiv); this.Controls.Remove(SotrLbl); this.Controls.Remove(KritLbl); this.Controls.Remove(NameKritLbl); this.Controls.Remove(OcenSotrLbl); this.Controls.Remove(PokazTextBox); this.Controls.Remove(ContinueBtn); this.Controls.Remove(CompleteBtn); this.Controls.Remove(OcenkaListBtn); this.Controls.Remove(SotrComBox); this.Controls.Remove(OtchetBtn); this.Controls.Remove(CancelBtn); } else { Height = 425; OcenkaDiv = new MaterialDivider { Location = new Point(-3, 176), Size = new Size(680, 10) }; this.Controls.Add(OcenkaDiv); SotrLbl = new MaterialLabel { Location = new Point(25, 197), Text = "Сотрудник", AutoSize = true }; this.Controls.Add(SotrLbl); KritLbl = new MaterialLabel { Location = new Point(25, 275), Text = "Название критерия", AutoSize = true }; this.Controls.Add(KritLbl); NameKritLbl = new MaterialLabel { Location = new Point(24, 301), Text = " ", AutoSize = true }; this.Controls.Add(NameKritLbl); OcenSotrLbl = new MaterialLabel { Location = new Point(235, 274), Text = "Показатель сотрудника", AutoSize = true }; this.Controls.Add(OcenSotrLbl); ResultLbl = new MaterialLabel { Location = new Point(24, 366), Text = "Результат оценки", AutoSize = true }; PokazTextBox = new MaterialSingleLineTextField { Location = new Point(239, 301), Size = new Size(175, 23) }; PokazTextBox.KeyPress += PokazTextBox_KeyPress; this.Controls.Add(PokazTextBox); OtchetBtn = new MaterialRaisedButton { Text = "Сформировать отчет", Location = new Point(484, 358) }; OtchetBtn.Click += new EventHandler(OtchetBtn_Click); this.Controls.Add(OtchetBtn); CancelBtn = new MaterialRaisedButton { Text = "Отмена", Location = new Point(587, 204) }; CancelBtn.Click += new EventHandler(CancelBtn_Click); this.Controls.Add(CancelBtn); ContinueBtn = new MaterialRaisedButton { Text = "Далее", Location = new Point(491, 284) }; ContinueBtn.Click += new EventHandler(ContinueBtn_Click); this.Controls.Add(ContinueBtn); CompleteBtn = new MaterialRaisedButton { Text = "Завершить", Location = new Point(561, 284) }; CompleteBtn.Click += new EventHandler(CompleteBtn_Click); this.Controls.Add(CompleteBtn); OcenkaListBtn = new MaterialRaisedButton { Text = "Просмотреть", Location = new Point(293, 385) }; OcenkaListBtn.Click += new EventHandler(OcenkaListBtn_Click); this.Controls.Add(OcenkaListBtn); this.Controls.Add(SotrComBox); PokazTextBox.MaxLength = 1; NameKritLbl.Text = tabl.Rows[0].Field <string>(1).ToString(); this.NameKritLbl.MaximumSize = new Size(200, 100); } } }
} // Открытие формы параметров отчета private void OcenkaListBtn_Click(object sender, EventArgs e) { if (Height != 425) { Height = 425; } else { Height = 631; ListDiv = new MaterialDivider { Location = new Point(-3, 427), Size = new Size(680, 10) }; this.Controls.Add(ListDiv); SearchTextBox = new MaterialSingleLineTextField { Location = new Point(464, 485), Size = new Size(170, 23), Hint = "Найти" }; // Поле ввода поиска this.Controls.Add(SearchTextBox); IdTextBox = new MaterialSingleLineTextField { Location = new Point(451, 604), Size = new Size(29, 23), Hint = "Код", Enabled = false }; this.Controls.Add(IdTextBox); this.Controls.Add(FiltrComBox); this.Controls.Add(OcenkaDtGrView); SearchBtn = new MaterialRaisedButton { Text = "Поиск", Location = new Point(522, 451) }; // Кнопка поиска записи оценки SearchBtn.Click += new EventHandler(SearchBtn_Click); this.Controls.Add(SearchBtn); FiltrBtn = new MaterialRaisedButton { Text = "Фильтрация", Location = new Point(499, 521) }; // Кнопка фильтрации записи оценки FiltrBtn.Click += new EventHandler(FiltrBtn_Click); this.Controls.Add(FiltrBtn); DeleteBtn = new MaterialRaisedButton { Text = "Удалить", Location = new Point(517, 591) }; // Кнопка удаления записи оценки DeleteBtn.Click += new EventHandler(DeleteBtn_Click); this.Controls.Add(DeleteBtn); } }
private async void Otchot_Load(object sender, EventArgs e) { OthDiv = new MaterialDivider { Location = new Point(-1, 168), Size = new Size(565, 11) }; this.Controls.Add(OthDiv); allCheck = new MaterialCheckBox { Text = "Выбрать все", Location = new Point(257, 193), AutoSize = true }; allCheck.CheckedChanged += new EventHandler(allcheck_CheckedChanged); this.Controls.Add(allCheck); WordChek = new MaterialCheckBox { Text = "", Location = new Point(185, 113), AutoSize = true }; this.Controls.Add(WordChek); ExcelChek = new MaterialCheckBox { Text = "", Location = new Point(311, 113), AutoSize = true }; this.Controls.Add(ExcelChek); PdfChek = new MaterialCheckBox { Text = "", Location = new Point(434, 113), AutoSize = true }; this.Controls.Add(PdfChek); Bitmap Word = new Bitmap(@"D:\Флешка\4 курс\Программа работа\Rating_sotr\Word.png"); WordImage = new PictureBox { Location = new Point(214, 88), Size = new Size(77, 67), BackgroundImage = Word, BackgroundImageLayout = ImageLayout.Zoom }; WordImage.Click += new EventHandler(WordImage_Click); this.Controls.Add(WordImage); Bitmap Excel = new Bitmap(@"D:\Флешка\4 курс\Программа работа\Rating_sotr\Excel.png"); ExcelImage = new PictureBox { Location = new Point(340, 88), Size = new Size(77, 67), BackgroundImage = Excel, BackgroundImageLayout = ImageLayout.Zoom }; ExcelImage.Click += new EventHandler(ExcelImage_Click); this.Controls.Add(ExcelImage); Bitmap Pdf = new Bitmap(@"D:\Флешка\4 курс\Программа работа\Rating_sotr\pdf.png"); PdfImage = new PictureBox { Location = new Point(463, 88), Size = new Size(77, 67), BackgroundImage = Pdf, BackgroundImageLayout = ImageLayout.Zoom }; PdfImage.Click += new EventHandler(PdfImage_Click); this.Controls.Add(PdfImage); vibvers = new MaterialLabel { Location = new Point(23, 105), Text = "Выбор формата " + "документа", AutoSize = true }; this.Controls.Add(vibvers); vibkrit = new MaterialLabel { Location = new Point(22, 197), Text = "Выбор критерий для отчета", AutoSize = true }; this.Controls.Add(vibkrit); BackBtn = new MaterialRaisedButton { Text = "Отмена", Location = new Point(276, 393) }; BackBtn.Click += new EventHandler(BackBtn_Click); this.Controls.Add(BackBtn); CompleteBtn = new MaterialRaisedButton { Text = "Сформировать отчет", Location = new Point(359, 393) }; CompleteBtn.Click += new EventHandler(CompleteBtn_Click); this.Controls.Add(CompleteBtn); string connectionString = @"Data Source = DESKTOP-EPNEITS; Initial Catalog = " + Program.server + "; Integrated Security = True"; sqlConnection = new SqlConnection(connectionString); await sqlConnection.OpenAsync(); DB.LoadDataCritery(); SqlConnection connect = new SqlConnection(connectionString); string podkl = "SELECT * FROM critery"; SqlCommand com = new SqlCommand(podkl, connect); connect.Open(); SqlDataReader read = com.ExecuteReader(); tabl.Load(read); int name = 26; int nume = 236; for (int i = 0; i < tabl.Rows.Count; i++) { MaterialCheckBox bt = new MaterialCheckBox(); bt.Text = tabl.Rows[i][1].ToString(); bt.AutoSize = true; bt.Name = tabl.Rows[i][1].ToString(); bt.Location = new Point(name, nume); Controls.Add(bt); nume = nume + 30; this.Height = nume + 45; BackBtn.Location = new Point(276, nume + 5); CompleteBtn.Location = new Point(359, nume + 5); checkBoxes.Add(bt); } this.vibvers.MaximumSize = new Size(200, 100); }