private void dgvGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { try { var typeId = dgvGrid.Rows[e.RowIndex].Cells["InputType"].Value.ToString(); type = typeId; var codeId = dgvGrid.Rows[e.RowIndex].Cells["StockCode"].Value.ToString(); code = codeId; date = dgvGrid.Rows[e.RowIndex].Cells["CreateAt"].Value.ToString(); price = dgvGrid.Rows[e.RowIndex].Cells["TotalPrice"].Value.ToString(); branch = dgvGrid.Rows[e.RowIndex].Cells["BranchName"].Value.ToString(); note = dgvGrid.Rows[e.RowIndex].Cells["Note1"].Value.ToString(); discount = dgvGrid.Rows[e.RowIndex].Cells["Discount1"].Value == null ? "0" : dgvGrid.Rows[e.RowIndex].Cells["Discount1"].Value.ToString(); frmSummaryStockOutputDetail.type = type; frmSummaryStockOutputDetail.code = code; frmSummaryStockOutputDetail.date = date; frmSummaryStockOutputDetail.price = price; frmSummaryStockOutputDetail.branch = branch; frmSummaryStockOutputDetail.note = note; frmSummaryStockOutputDetail.discount = discount; var f = new frmSummaryStockOutputDetail(); f.MdiParent = WindowsFormsApplication3.Form1.ActiveForm; f.Show(); } catch (Exception ax) { MessageBox.Show("Có lỗi phát sinh: " + ax.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void dgvGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { var typeId = dgvGrid.Rows[e.RowIndex].Cells["InputType"].Value.ToString(); type = typeId; var codeId = dgvGrid.Rows[e.RowIndex].Cells["StockCode"].Value.ToString(); code = codeId; date = dgvGrid.Rows[e.RowIndex].Cells["CreateAt"].Value.ToString(); price = dgvGrid.Rows[e.RowIndex].Cells["Total"].Value.ToString(); branch = dgvGrid.Rows[e.RowIndex].Cells["BranchName"].Value.ToString(); note = dgvGrid.Rows[e.RowIndex].Cells["Note1"].Value.ToString(); discount = dgvGrid.Rows[e.RowIndex].Cells["Discount1"].Value == null ?"0": dgvGrid.Rows[e.RowIndex].Cells["Discount1"].Value.ToString(); frmSummaryStockOutputDetail.type = type; frmSummaryStockOutputDetail.code = code; frmSummaryStockOutputDetail.date = date; frmSummaryStockOutputDetail.price = price; frmSummaryStockOutputDetail.branch = branch; frmSummaryStockOutputDetail.note = note; frmSummaryStockOutputDetail.discount = discount; var f = new frmSummaryStockOutputDetail(); f.MdiParent = WindowsFormsApplication3.Form1.ActiveForm; f.Show(); } }