private void button1_Click(object sender, EventArgs e) { try { int a = 0; int bqty = 0; int gqty = 0; int reorder = 0; int reorderD = 0; string code = ""; string id = ""; COMPANY.EndEdit(); ReorderService service = new ReorderService(); foreach (DataGridViewRow item in COMPANY.Rows) { if (Convert.ToBoolean(item.Cells[1].Value) == true) { if (item.Cells[11].Value == null) { bqty = 0; } else { bqty = Convert.ToInt32(item.Cells[11].Value); } gqty = Convert.ToInt32(item.Cells[10].Value); bqty = Convert.ToInt32(item.Cells[11].Value); reorder = Convert.ToInt32(item.Cells[2].Value); reorderD = Convert.ToInt32(item.Cells[3].Value); code = item.Cells[7].Value.ToString(); id = item.Cells[12].Value.ToString(); service.insertInspection(gqty, bqty, reorder, reorderD, code, id); a++; } } if (a == 0) { MessageBox.Show("검사할 발주를 선택해주세요"); return; } DataGridViewBinding2(); MessageBox.Show("검사가 완료 되었습니다."); Reset(null, null); } catch (Exception err) { this.Log.WriteError($"[[RECV {this.Name}]]:{err.Message}"); } }
private void HeaderChk_Clicked2(object sender, EventArgs e) { try { COMPANY.EndEdit(); //데이터그리드뷰의 전체 행의 체크를 체크 or 언체크 foreach (DataGridViewRow row in COMPANY.Rows) { DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["all"]; chk.Value = headerChk1.Checked; } } catch (Exception err) { this.Log.WriteError($"[[RECV {this.Name}]]:{err.Message}"); } }