private void CompletedTaskDataGridView1_DoubleClick(object sender, EventArgs e) { if (CompletedTaskDataGridView1.SelectedCells.Count > 0) { int selectedrowindex = CompletedTaskDataGridView1.SelectedCells[0].RowIndex; SelectedRow = CompletedTaskDataGridView1.Rows[selectedrowindex]; var creationDate = DateTime.Now; Id = Convert.ToInt32(SelectedRow.Cells["IDZadania"].Value); string name = Convert.ToString(SelectedRow.Cells["Nazwa"].Value); string category = Convert.ToString(SelectedRow.Cells["Kategoria"].Value); string description = Convert.ToString(SelectedRow.Cells["Opis"].Value); creationDate = Convert.ToDateTime(SelectedRow.Cells["DataUtworzenia"].Value); TaskInfoForm frm = new TaskInfoForm(); frm.SetDoubleClickInfo(name, category, description, creationDate); frm.HideFinishTaskButton(); frm.StatusInfoLabel1.Text = "Zakończono"; frm.LoadOrders(this); frm.Show(); } }
public void TaskDataGridView_DoubleClick(object sender, EventArgs e) { if (TaskDataGridView.SelectedCells.Count > 0) { int selectedRowIndex = TaskDataGridView.SelectedCells[0].RowIndex; SelectedRow = TaskDataGridView.Rows[selectedRowIndex]; var creationDate = DateTime.Now; Id = Convert.ToInt32(SelectedRow.Cells["IDZadania"].Value); string name = Convert.ToString(SelectedRow.Cells["Nazwa"].Value); string category = Convert.ToString(SelectedRow.Cells["Kategoria"].Value); string description = Convert.ToString(SelectedRow.Cells["Opis"].Value); creationDate = Convert.ToDateTime(SelectedRow.Cells["DataUtworzenia"].Value); Status = Convert.ToBoolean(SelectedRow.Cells["CzyZakonczone"].Value); TaskInfoForm frm = new TaskInfoForm(); frm.SetDoubleClickInfo(name, category, description, creationDate); frm.Show(); if (Status) { frm.StatusInfoLabel1.Text = "Zakończono"; } else { frm.StatusInfoLabel1.Text = "Nie zakończono"; } frm.LoadOrders(this); } }