private void BtnEditTypeProg_Click(object sender, EventArgs e) { //Редактирование данных о типе программы AddEditEducation frm = new AddEditEducation(typeprog); p = typeprog; //Передача данных о типе программы на форму редактирования using (SqlConnection connecting = new SqlConnection(Program.connection)) { connecting.Open(); // Данные из таблицы Тип программы SqlCommand nametype = connecting.CreateCommand(); nametype.CommandText = "SELECT NameType FROM [TypeProg] WHERE ID= " + p; nametype.ExecuteScalar(); SqlCommand kolchas = connecting.CreateCommand(); kolchas.CommandText = "SELECT KolChas FROM [TypeProg] WHERE ID= " + p; kolchas.ExecuteScalar(); SqlCommand typedoc = connecting.CreateCommand(); typedoc.CommandText = "SELECT TypeDoc FROM [TypeProg] WHERE ID= " + p; typedoc.ExecuteScalar(); //Заполнение полей на форме редактирования данных о типе программы frm.TbType.Text = Convert.ToString(nametype.ExecuteScalar()); frm.TbKolChas.Text = Convert.ToString(kolchas.ExecuteScalar()); frm.CbDocEducat.Text = Convert.ToString(typedoc.ExecuteScalar()); //Блокировка кнопок frm.BtnCourseNew.Enabled = false; frm.BtnCourseEdit.Enabled = false; frm.BtnProgNew.Enabled = false; frm.BtnProgEdit.Enabled = false; frm.BtnTypeNew.Enabled = false; frm.BtnTypeEdit.Enabled = true; frm.BtnTypePractikNew.Enabled = false; frm.BtnTypePractikEdit.Enabled = false; frm.btnAddGroup.Enabled = false; frm.Show(); this.Hide(); connecting.Close(); } }
private void BtnGroup_Click(object sender, EventArgs e) { k = ""; AddEditEducation ifrm = new AddEditEducation(k); ifrm.BtnCourseNew.Enabled = false; ifrm.BtnCourseEdit.Enabled = false; ifrm.BtnProgNew.Enabled = false; ifrm.BtnProgEdit.Enabled = false; ifrm.BtnTypeNew.Enabled = false; ifrm.BtnTypeEdit.Enabled = false; ifrm.BtnTypePractikNew.Enabled = false; ifrm.BtnTypePractikEdit.Enabled = false; ifrm.btnAddGroup.Enabled = true; }
private void BtnEditProgam_Click(object sender, EventArgs e) { //Редактирование данных о программе AddEditEducation frm = new AddEditEducation(prog); p = prog; //Передача данных о программе на форму редактирования using (SqlConnection connecting = new SqlConnection(Program.connection)) { connecting.Open(); // Данные из таблицы Программы SqlCommand nameprog = connecting.CreateCommand(); nameprog.CommandText = "SELECT NameProg FROM [Program] WHERE ID= " + p; nameprog.ExecuteScalar(); //Заполнение полей на форме редактирования данных о программе frm.TbProg.Text = Convert.ToString(nameprog.ExecuteScalar()); //Блокировка кнопок frm.BtnCourseNew.Enabled = false; frm.BtnCourseEdit.Enabled = false; frm.BtnProgNew.Enabled = false; frm.BtnProgEdit.Enabled = true; frm.BtnTypeNew.Enabled = false; frm.BtnTypeEdit.Enabled = false; frm.BtnTypePractikNew.Enabled = false; frm.BtnTypePractikEdit.Enabled = false; frm.btnAddGroup.Enabled = false; frm.Show(); this.Hide(); connecting.Close(); } }