private void btnSave_Click(object sender, EventArgs e) { WsSCodeGrpPra.WsSysCodeGrpPra pwSvc = null; string reCode = ""; string reMsg = ""; try { pwSvc = new WsSCodeGrpPra.WsSysCodeGrpPra(); pwSvc.Url = "http://" + AppInfo.SsServer + "/WebSvc/Sys/SysCode/WsSysCodeGrpPra.svc"; pwSvc.Timeout = 1000; int reCnt = 0; for (int i = 0; i < dataGridView1.Rows.Count; i++) { if (dataGridView1.Rows[i].Cells["dgv1_CHK"].Value != null) { if (dataGridView1.Rows[i].Cells["dgv1_CHK"].Value.ToString() == "1") { string scodeGrp_val = dataGridView1.Rows[i].Cells["dgv1_SCODE_GRP"].Value.ToString(); string scodeNm_val = dataGridView1.Rows[i].Cells["dgv1_SCODE_NM"].Value.ToString(); string usingFlag_val = dataGridView1.Rows[i].Cells["dgv1_USING_FLAG"].Value.ToString(); string sortNo_val = dataGridView1.Rows[i].Cells["dgv1_SORT_NO"].Value.ToString(); string memo_val = dataGridView1.Rows[i].Cells["dgv1_MEMO"].Value.ToString(); reCode = pwSvc.pmSysCodeGrp(scodeGrp_val, scodeNm_val, usingFlag_val, sortNo_val, memo_val, out reMsg); if (reCode == "Y") { reCnt++; } } } } if (reCnt > 0) { MessageBox.Show("저장 성공" + " : " + reCnt.ToString()); } else { MessageBox.Show("저장 실패"); } setDataBind_grideView1(scodeGrp); } catch (Exception ex) { logs.SaveLog("[error] (page)::FrmSysCodeGrp.cs (Function)::btnSave_Click (Detail):: " + "\r\n" + ex.ToString(), "Error"); } finally { if (pwSvc != null) { pwSvc.Dispose(); } } }