private void dataGridViewPosts_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { int id = int.Parse(dataGridViewPosts.SelectedRows[0].Cells[0].Value.ToString()); var post = _qt.GetDirectoryPost(id); textBoxNameOfPost.Text = post.Name; comboBoxTypeOfPost.SelectedItem = post.DirectoryTypeOfPost.Name; comboBoxNameOfCompany.SelectedItem = post.DirectoryCompany.Name; dateTimePickerDate.Value = post.Date; textBoxWorkerSalary.Text = post.UserWorkerSalary.ToString(); textBoxHalfWorkerSalary.Text = post.UserHalfWorkerSalary.ToString(); }
private void buttonAddCompanyAndPost_Click(object sender, EventArgs e) { using (var form = new FormAddComanyAnadPostToWorker()) { form.ShowDialog(); var currentTmpPost = form.GetPost(); var directoryPost = _qt.GetDirectoryPost(currentTmpPost.Date, currentTmpPost.PostName, currentTmpPost.CompanyName); AddCurrentPostToDataGrid(directoryPost, currentTmpPost.Date); } }