private void SetDataBind_gridView1(string pScodeGrp) { M_WsSysCodeGrp.WsSysCodeGrp wSvc = null; string reCode = ""; string reMsg = ""; M_WsSysCodeGrp.DataSysCodeGrp[] getData = null; try { wSvc = new M_WsSysCodeGrp.WsSysCodeGrp(); wSvc.Url = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/SysCode/WsSysCodeGrp.svc"; wSvc.Timeout = 1000; reCode = wSvc.sSysCodeGrp(pScodeGrp, out getData, out reMsg); if (reCode == "Y") { if (getData != null && getData.Length > 0) { dataGridView1.Rows.Clear(); for (int i = 0; i < getData.Length; i++) { dataGridView1.Rows.Add(); dataGridView1.Rows[i].Cells["dgv1_CHK"].Value = "0"; dataGridView1.Rows[i].Cells["dgv1_SCODE_GRP"].Value = getData[i].SCODE_GRP.ToString(); dataGridView1.Rows[i].Cells["dgv1_SCODE_GRP_NM"].Value = getData[i].SCODE_GRP_NM.ToString(); dataGridView1.Rows[i].Cells["dgv1_USING_FLAG"].Value = getData[i].USING_FLAG.ToString(); dataGridView1.Rows[i].Cells["dgv1_SORT_NO"].Value = getData[i].SORT_NO.ToString(); dataGridView1.Rows[i].Cells["dgv1_MEMO"].Value = getData[i].MEMO.ToString(); } SetRowNumber(dataGridView1); } } } catch (Exception ex) { logs.SaveLog("[error] (page)::FrmSysCodeGrp.cs (Function)::SetDataBind_gridView1 (Detail)::pScodeGrp=[" + pScodeGrp + "]", "Error"); logs.SaveLog("[error] (page)::FrmSysCodeGrp.cs (Function)::SetDataBind_gridView1 (Detail)::reMsg=[" + reMsg + "]", "Error"); logs.SaveLog("[error] (page)::FrmSysCodeGrp.cs (Function)::SetDataBind_gridView1 (Detail):: " + "\r\n" + ex.ToString(), "Error"); } finally { if (wSvc != null) { wSvc.Dispose(); } } }
private void btnSave_Click(object sender, EventArgs e) { M_WsSysCodeGrp.WsSysCodeGrp wSvc = null; string reCode = ""; string reMsg = ""; string reData = ""; try { wSvc = new M_WsSysCodeGrp.WsSysCodeGrp(); wSvc.Url = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/SysCode/WsSysCodeGrp.svc"; wSvc.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 scode_val = dataGridView1.Rows[i].Cells["dgv1_SCODE"].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 = "1"; if (dataGridView1.Rows[i].Cells["dgv1_SORT_NO"].Value != null) { sortNo_val = dataGridView1.Rows[i].Cells["dgv1_SORT_NO"].Value.ToString(); } string memo_val = ""; if (dataGridView1.Rows[i].Cells["dgv1_MEMO"].Value != null) { memo_val = dataGridView1.Rows[i].Cells["dgv1_MEMO"].Value.ToString(); } string inputId_val = "1"; reCode = wSvc.mSysCode(scode_val, scodeNm_val, usingFlag_val, sortNo_val, memo_val, inputId_val, out reMsg, out reData); if (reCode == "Y" && reData != "") { reCnt += Convert.ToInt16(reData); } } } } if (reCnt > 0) { MessageBox.Show(wRM.GetString("wSave") + " " + wRM.GetString("wSuccess") + " : " + reCnt.ToString()); } else { MessageBox.Show(wRM.GetString("wSave") + " " + wRM.GetString("wFail")); } SetDataBind_gridView1(_scodeGrp); } catch (Exception ex) { logs.SaveLog("[error] (page)::FrmSysCode.cs (Function)::btnSave_Click (Detail):: " + "\r\n" + ex.ToString(), "Error"); } finally { if (wSvc != null) { wSvc.Dispose(); } } }
private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e) { string colNm = dataGridView2.Columns[e.ColumnIndex].Name; if (colNm == "dgv2_BTNADD") { string reVal = ChkDgv2Param(); if (reVal != "") { MessageBox.Show(wRM.GetString("wCheck") + " :: " + reVal); } else { string scode_val = dataGridView2.Rows[0].Cells["dgv2_SCODE"].Value.ToString(); string scodeNm_val = dataGridView2.Rows[0].Cells["dgv2_SCODE_NM"].Value.ToString(); string sortNo_val = "1"; if (dataGridView2.Rows[0].Cells["dgv2_SORT_NO"].Value != null) { sortNo_val = dataGridView2.Rows[0].Cells["dgv2_SORT_NO"].Value.ToString(); } string memo_val = ""; if (dataGridView2.Rows[0].Cells["dgv2_MEMO"].Value != null) { memo_val = dataGridView2.Rows[0].Cells["dgv2_MEMO"].Value.ToString(); } string pInputId = "1"; M_WsSysCodeGrp.WsSysCodeGrp wSvc = null; string reCode = ""; string reMsg = ""; string reData = ""; try { wSvc = new M_WsSysCodeGrp.WsSysCodeGrp(); wSvc.Url = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/SysCode/WsSysCodeGrp.svc"; wSvc.Timeout = 1000; int reCnt = 0; reCode = wSvc.exSysCode(scode_val, out reMsg, out reData); if (reCode == "Y" && reData != "0") { MessageBox.Show(msgRM.GetString("msgDuplicated")); } else { reCode = ""; reCode = wSvc.aSysCode(scode_val, _scodeGrp, scodeNm_val, "1", memo_val, sortNo_val, pInputId, out reMsg, out reData); if (reCode == "Y" && reData != "") { reCnt = Convert.ToInt16(reData); } if (reCnt > 0) { MessageBox.Show(wRM.GetString("wSave") + " " + wRM.GetString("wSuccess") + " : " + reCnt.ToString()); } else { MessageBox.Show(wRM.GetString("wSave") + " " + wRM.GetString("wFail")); } } SetDataBind_gridView1(_scodeGrp); SetDataBind_grideView2(); } catch (Exception ex) { logs.SaveLog("[error] (page)::FrmSysCode.cs (Function)::dataGridView2_CellClick (Detail):: " + "\r\n" + ex.ToString(), "Error"); } finally { if (wSvc != null) { wSvc.Dispose(); } } } } }
private void SetDataBind_gridView1(string pScodeGrp) { if (_scodeGrp == "") { return; } string searchTxt_val = ""; if (!string.IsNullOrEmpty(txtSearch.Text)) { searchTxt_val = txtSearch.Text; } M_WsSysCodeGrp.WsSysCodeGrp wSvc = null; string reCode = ""; string reMsg = ""; M_WsSysCodeGrp.DataSysCode[] getData = null; try { wSvc = new M_WsSysCodeGrp.WsSysCodeGrp(); // 시스템 코드 보여주기 wSvc.Url = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/SysCode/WsSysCodeGrp.svc"; wSvc.Timeout = 1000; reCode = wSvc.sSysCode(_scodeGrp, cmbUse.SelectedValue.ToString(), searchTxt_val, out getData, out reMsg); if (reCode == "Y") { if (getData != null && getData.Length > 0) { dataGridView1.Rows.Clear(); for (int i = 0; i < getData.Length; i++) { dataGridView1.Rows.Add(); dataGridView1.Rows[i].Cells["dgv1_CHK"].Value = "0"; dataGridView1.Rows[i].Cells["dgv1_SCODE"].Value = getData[i].SCODE.ToString(); dataGridView1.Rows[i].Cells["dgv1_SCODE_NM"].Value = getData[i].SCODE_NM.ToString(); dataGridView1.Rows[i].Cells["dgv1_USING_FLAG"].Value = getData[i].USING_FLAG.ToString(); dataGridView1.Rows[i].Cells["dgv1_SORT_NO"].Value = getData[i].SORT_NO.ToString(); dataGridView1.Rows[i].Cells["dgv1_MEMO"].Value = getData[i].MEMO.ToString(); } SetRowNumber(dataGridView1); } else { dataGridView1.Rows.Clear(); //MessageBox.Show("데이터가 없습니다"); } } } catch (Exception ex) { logs.SaveLog("[error] (page)::FrmSysCode.cs (Function)::SetDataBind_gridView1 (Detail)::pScodeGrp=[" + pScodeGrp + "]", "Error"); logs.SaveLog("[error] (page)::FrmSysCode.cs (Function)::SetDataBind_gridView1 (Detail)::reMsg=[" + reMsg + "]", "Error"); logs.SaveLog("[error] (page)::FrmSysCode.cs (Function)::SetDataBind_gridView1 (Detail):: " + "\r\n" + ex.ToString(), "Error"); } finally { if (wSvc != null) { wSvc.Dispose(); } } }
private void SetDataBind_treeView1() { treeView1.Nodes.Clear(); M_WsSysCodeGrp.WsSysCodeGrp wSvc = null; string reCode = ""; string reMsg = ""; M_WsSysCodeGrp.DataSysCodeGrp[] getData = null; try { wSvc = new M_WsSysCodeGrp.WsSysCodeGrp(); wSvc.Url = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/SysCode/WsSysCodeGrp.svc"; wSvc.Timeout = 1000; ImageList myimageList = new ImageList(); myimageList.Images.Add(Image.FromFile(@"Image\treeicon1.png")); treeView1.ImageList = myimageList; treeView1.ImageIndex = 0; //TreeNode root = new TreeNode(); //root.Tag = ""; //root.Text = "전체"; reCode = wSvc.sSysCodeGrp_UsingFlag("1", out getData, out reMsg); if (reCode == "Y") { if (getData != null && getData.Length > 0) { for (int i = 0; i < getData.Length; i++) { string scodeGrp_val = getData[i].SCODE_GRP.ToString(); string scodeNm_val = getData[i].SCODE_GRP_NM.ToString(); TreeNode node1 = new TreeNode(); node1.Tag = scodeGrp_val; node1.Text = scodeNm_val; treeView1.Nodes.Add(node1); } //treeView1.Nodes.Add(); if (treeView1.Nodes.Count > 0) { treeView1.SelectedNode = treeView1.GetNodeAt(0, 0); } treeView1.ExpandAll(); } } } catch (Exception ex) { logs.SaveLog("[error] (page)::FrmSysCode.cs (Function)::setDataBind_treeView1 (Detail):: " + "\r\n" + ex.ToString(), "Error"); } finally { if (wSvc != null) { wSvc.Dispose(); } } }