/// <summary> /// 마감처리 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { List <ShipmentOutVO> list = new List <ShipmentOutVO>(); foreach (DataGridViewRow row in dgvClientOrder.Rows) { bool isCellChecked = Convert.ToBoolean(row.Cells["chk"].EditedFormattedValue); if (isCellChecked) { ShipmentOutVO vo = new ShipmentOutVO(); vo.so_id = Convert.ToInt32(row.Cells[13].Value); vo.product_id = Convert.ToInt32(row.Cells[12].Value); vo.plan_id = row.Cells[27].Value.ToString(); //vo.product_codename = row.Cells[3].Value.ToString(); vo.s_count = Convert.ToInt32(row.Cells[9].Value); vo.company_code = row.Cells[2].Value.ToString(); vo.s_date = row.Cells[11].Value.ToString(); vo.s_totalprice = Convert.ToDecimal(row.Cells[10].Value); //vo.so_pcount = Convert.ToInt32(row.Cells[4].Value); //vo.w_count_present = Convert.ToInt32(row.Cells[9].Value); //vo.uadmin = 1002; //vo.wh_comment = (row.Cells[8].Value == null) ? "" : row.Cells[8].Value.ToString(); //vo.udate = DateTime.Now.ToString("yyyy-MM-dd"); //vo.category = "P_SALES_COMPLETE"; list.Add(vo); } } try { ShipmentService shipment_service = new ShipmentService(); if (MessageBox.Show($"선택하신 {list.Count}건을 마감처리 하시겠습니까?", "마감 처리" , MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { bool bResult = shipment_service.EndProcessing(list); if (bResult) //마감처리 성공시 { SetDGV(); SetBottomStatusLabel($"선택하신 {list.Count}건의 마감처리가 완료되었습니다."); } } } catch (Exception err) { //이동처리실패 SetBottomStatusLabel("마감처리에 실패하였습니다. 다시시도 하세요"); LoggingUtility.GetLoggingUtility(err.Message, Level.Error); return; } }