private void button1_Click(object sender, EventArgs e) { try { DB_functions fun = new DB_functions(); DB_functions.Fields_Vacation fields = new DB_functions.Fields_Vacation(); fields.f1 = txtName.Text; fields.f2 = txtDescription.Text; fields.f3 = txtDescriptionFull.Text; fields.f4 = txtRequriments.Text; fields.f5 = int.Parse(txtMoney.Text); fields.f6 = chbOffice.Checked; fun.Save(fields); dsTableAdapters.VacationTableAdapter taV = new dsTableAdapters.VacationTableAdapter(); taV.Update(ds.Vacation); this.Close(); } catch (Exception E) { MessageBox.Show("Невозможно сохранить", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void должностиToolStripMenuItem_Click(object sender, EventArgs e) { frmAdmin frm = new frmAdmin(); dsTableAdapters.VacationTableAdapter ta = new dsTableAdapters.VacationTableAdapter(); ta.Fill(ds.Vacation); frm.dgvAdmin.DataSource = ds.Vacation; frm.dgvAdmin.Update(); frm.ShowDialog(); ta.Update(ds.Vacation); }
private void btnVacations_Click(object sender, EventArgs e) { dsTableAdapters.VacationTableAdapter taVacation = new dsTableAdapters.VacationTableAdapter(); taVacation.Fill(ds.Vacation); dgvMain.DataSource = ds.Vacation; dgvMain.Columns[1].HeaderText = "Название"; dgvMain.Columns[2].HeaderText = "Описание"; dgvMain.Columns[3].HeaderText = "Требования"; dgvMain.Columns[4].HeaderText = "Подробное описание"; dgvMain.Columns[5].HeaderText = "Минимальная з/п"; dgvMain.Columns[6].HeaderText = "В офисе"; dgvMain.Update(); }