/// <summary> /// 납기일 변경하기 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgv2_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DueDatePopUpForm frm = new DueDatePopUpForm(); frm.Order_no = Convert.ToInt32(dgv2.SelectedRows[0].Cells[0].Value); frm.Due_date = Convert.ToDateTime(dgv2.SelectedRows[0].Cells[7].Value); frm.Product_no = Convert.ToInt32(dgv2.SelectedRows[0].Cells["product_id"].Value); frm.Gubun = "출고"; if (frm.ShowDialog() == DialogResult.OK) { dgv2.DataSource = releaseService.GetReleasePlanDetail(Convert.ToInt32(dgv2.SelectedRows[0].Cells[0].Value)); DateTime request_date = Convert.ToDateTime(dgv2.SelectedRows[0].Cells[7].Value); DateTime release_date = Convert.ToDateTime(dgv2.SelectedRows[0].Cells[8].Value); if (request_date < release_date) { MessageBox.Show("출고 요청일은 출고 예정일보다 빠르면 안됩니다. 다시 변경해주세요."); dgv2.SelectedRows[0].DefaultCellStyle.BackColor = Color.LightCoral; return; } else { releaseService.UpdateReleaseDate(Convert.ToInt32(dgv2.SelectedRows[0].Cells[0].Value), Convert.ToInt32(dgv2.SelectedRows[0].Cells[3].Value)); dgv2.SelectedRows[0].DefaultCellStyle.BackColor = Color.Transparent; dgv2.DataSource = releaseService.GetReleasePlanDetail(Convert.ToInt32(dgv2.SelectedRows[0].Cells[0].Value)); } } }
private void dgv_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 8) { DueDatePopUpForm frm = new DueDatePopUpForm(); frm.Due_date = Convert.ToDateTime(dgv.SelectedRows[0].Cells["order_request_date"].Value.ToString()); frm.Order_no = Convert.ToInt32(dgv.SelectedRows[0].Cells[0].Value); frm.Product_no = Convert.ToInt32(dgv.SelectedRows[0].Cells["product_id"].Value); frm.Gubun = "발주"; if (frm.ShowDialog() == DialogResult.OK) { dgv.DataSource = orderService.GetOrderList(); } } }