private void SetDataBind_gridView1()
        {
            M_WsMember.WsMember wSvc = null;
            string reCode            = "";
            string reMsg             = "";

            M_WsMember.DataSiteDB[] getData = null;
            try
            {
                wSvc         = new M_WsMember.WsMember();
                wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/MemberSite/WsMember.svc";
                wSvc.Timeout = 1000;
                string pUsing_Flag = "";

                if (cmbMember.SelectedValue != null)
                {
                    //CMB BOX SELECTED
                    reCode = wSvc.sSite(cmbMember.SelectedValue.ToString(), pUsing_Flag, 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_SITE_CD"].Value    = getData[i].SITE_CD.ToString();
                            dataGridView1.Rows[i].Cells["dgv1_MEMCO_CD"].Value   = getData[i].MEMCO_CD.ToString();
                            dataGridView1.Rows[i].Cells["dgv1_SITE_NM"].Value    = getData[i].SITE_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)::FrmSite.cs  (Function)::SetDataBind_gridView1  (Detail)::reMsg=[" + reMsg + "]", "Error");
                logs.SaveLog("[error]  (page)::FrmSite.cs  (Function)::SetDataBind_gridView1  (Detail):: " + "\r\n" + ex.ToString(), "Error");
            }
            finally
            {
                if (wSvc != null)
                {
                    wSvc.Dispose();
                }
            }
        }
Ejemplo n.º 2
0
        private void SetDataBind_gridView1(string pMemcoCD)
        {
            M_WsMember.WsMember wSvc = null;
            string reCode            = "";
            string reMsg             = "";

            M_WsMember.DataMemberDB[] getData = null;
            try
            {
                wSvc         = new M_WsMember.WsMember(); // 시스템 코드 보여주기
                wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/MemberSite/WsMember.svc";
                wSvc.Timeout = 1000;

                reCode = wSvc.sMember(pMemcoCD, 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_MEMCO_CD"].Value   = getData[i].MEMCO_CD.ToString();
                            dataGridView1.Rows[i].Cells["dgv1_MEMCO_NM"].Value   = getData[i].MEMCO_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)::FrmMember.cs  (Function)::SetDataBind_gridView1  (Detail)::pMemcoCD=[" + pMemcoCD + "]", "Error");
                logs.SaveLog("[error]  (page)::FrmMember.cs  (Function)::SetDataBind_gridView1  (Detail)::reMsg=[" + reMsg + "]", "Error");
                logs.SaveLog("[error]  (page)::FrmMember.cs  (Function)::SetDataBind_gridView1  (Detail):: " + "\r\n" + ex.ToString(), "Error");
            }
            finally
            {
                if (wSvc != null)
                {
                    wSvc.Dispose();
                }
            }
        }
        private void SetDataBind_CmbMember()
        {
            M_WsMember.WsMember wSvc = null;
            string reCode            = "";
            string reMsg             = "";

            M_WsMember.DataMemberMainDB[] getData = null;
            try
            {
                wSvc         = new M_WsMember.WsMember();
                wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/MemberSite/WsMember.svc";
                wSvc.Timeout = 1000;

                reCode = wSvc.sMemberMainDB(out getData, out reMsg);
                if (reCode == "Y")
                {
                    if (getData != null && getData.Length > 0)
                    {
                        Class.Common.ComboBoxItemSet setCmb = null;

                        setCmb = new Class.Common.ComboBoxItemSet();
                        setCmb.AddColumn();

                        for (int i = 0; i < getData.Length; i++)
                        {
                            setCmb.AddRow(getData[i].MEMCO_NM.ToString(), getData[i].MEMCO_CD.ToString());
                        }

                        setCmb.Bind(cmbMember);
                    }
                }
            }
            catch (Exception ex)
            {
                logs.SaveLog("[error]  (page)::FrmSite.cs  (Function)::SetDataBind_CmbMember  (Detail):: " + "\r\n" + ex.ToString());
            }
        }
        //추가버튼 클릭
        private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int    reCnt = 0;
            string colNm = dataGridView2.Columns[e.ColumnIndex].Name;

            if (colNm == "dgv2_BTNADD")
            {
                string reVal = ChkDgv2Param();

                if (reVal != "")
                {
                    MessageBox.Show(wRM.GetString("wCheck") + " :: " + reVal);
                }
                else
                {
                    string memcoCd_val = cmbMember.SelectedValue.ToString();
                    string siteNm_val  = dataGridView2.Rows[0].Cells["dgv2_SITE_NM"].Value.ToString();

                    string sortNo_val = "10";
                    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 = AppInfo.SsLabNo;

                    string headcoCd_val = "";
                    if (dataGridView2.Rows[0].Cells["dgv2_HEADCO_CD"].Value != null)
                    {
                        headcoCd_val = dataGridView2.Rows[0].Cells["dgv2_HEADCO_CD"].Value.ToString();
                    }



                    M_WsMember.WsMember wSvc = null;
                    string reCode            = "";
                    string reMsg             = "";
                    string reData            = "";
                    try
                    {
                        wSvc         = new M_WsMember.WsMember();
                        wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/MemberSite/WsMember.svc";
                        wSvc.Timeout = 1000;


                        string[] param = new string[6];
                        param[0] = memcoCd_val;
                        param[1] = siteNm_val;
                        param[2] = sortNo_val;
                        param[3] = memo_val;
                        param[4] = pInputId;
                        param[5] = headcoCd_val;

                        reCode = wSvc.aSite(_dbNm, param, out reMsg, out reData);



                        if (reCode == "Y" && reData != "0")
                        {
                            reCnt += Convert.ToInt16(reData);
                        }

                        if (reCnt > 0)
                        {
                            MessageBox.Show(wRM.GetString("wSave") + " " + wRM.GetString("wSuccess"));
                        }
                        else
                        {
                            MessageBox.Show(wRM.GetString("wSave") + " " + wRM.GetString("wFail"));
                        }

                        SetDataBind_gridView1();
                        SetDataBind_gridView2();
                    }

                    catch (Exception ex)
                    {
                        logs.SaveLog("[error]  (page)::FrmMember.cs  (Function)::dataGridView2_CellClick  (Detail):: " + "\r\n" + ex.ToString(), "Error");
                    }
                    finally
                    {
                        if (wSvc != null)
                        {
                            wSvc.Dispose();
                        }
                    }
                }
            }
        }
        //수정
        private void btnSave_Click(object sender, EventArgs e)
        {
            M_WsMember.WsMember wSvc = null;
            string reCode            = "";
            string reMsg             = "";
            string reData            = "0";

            try
            {
                wSvc         = new M_WsMember.WsMember();
                wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/MemberSite/WsMember.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")
                        {
                            reCnt++;
                        }
                    }
                }
                if (reCnt < 1)
                {
                    MessageBox.Show(msgRM.GetString("msgNotSelected"));
                    return;
                }

                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 siteCd_val  = dataGridView1.Rows[i].Cells["dgv1_SITE_CD"].Value.ToString();
                            string memcoCd_val = dataGridView1.Rows[i].Cells["dgv1_MEMCO_CD"].Value.ToString();
                            //string memcoNm_val = dataGridView1.Rows[i].Cells["dgv1_SITE_NM"].Value.ToString();
                            string siteNm_val    = dataGridView1.Rows[i].Cells["dgv1_SITE_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();
                            }



                            reCode = wSvc.mSite(siteCd_val, siteNm_val, usingFlag_val, sortNo_val, memo_val, out reMsg, out reData);



                            if (reCode == "Y" && reData != "0")
                            {
                                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();
            }
            catch (Exception ex)
            {
                logs.SaveLog("[error]  (page)::FrmSite.cs  (Function)::btnSave_Click  (Detail):: " + "\r\n" + ex.ToString(), "Error");
            }
            finally
            {
                if (wSvc != null)
                {
                    wSvc.Dispose();
                }
            }
        }
Ejemplo n.º 6
0
        private void SetDataBind_treeView1()
        {
            treeView1.Nodes.Clear();

            M_WsMember.WsMember wSvc = null;
            string reCode            = "";
            string reMsg             = "";

            M_WsMember.DataMemberDB[] getData = null;
            try
            {
                wSvc         = new M_WsMember.WsMember();
                wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/MemberSite/WsMember.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 = wRM.GetString("wTotal");

                reCode = wSvc.sMember_UsingFlag("", 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].MEMCO_CD.ToString();
                            string scodeNm_val  = getData[i].MEMCO_NM.ToString();

                            TreeNode node1 = new TreeNode();
                            node1.Tag  = scodeGrp_val;
                            node1.Text = scodeNm_val;

                            root.Nodes.Add(node1);
                        }

                        treeView1.Nodes.Add(root);



                        if (treeView1.Nodes.Count > 0)
                        {
                            treeView1.SelectedNode = treeView1.GetNodeAt(0, 0);
                        }

                        treeView1.ExpandAll();
                    }
                }
            }
            catch (Exception ex)
            {
                logs.SaveLog("[error]  (page)::FrmMember.cs  (Function)::setDataBind_treeView1  (Detail):: " + "\r\n" + ex.ToString(), "Error");
            }
            finally
            {
                if (wSvc != null)
                {
                    wSvc.Dispose();
                }
            }
        }
Ejemplo n.º 7
0
        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 pMemcoNm   = dataGridView2.Rows[0].Cells["dgv2_MEMCO_NM"].Value.ToString();
                    string pDb_Nm     = AppInfo.SsDbNm;
                    string sortNo_val = "10";
                    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 usingFlag_val = "1";
                    string pInputId      = AppInfo.SsLabNo;

                    M_WsMember.WsMember wSvc = null;
                    string reCode            = "";
                    string reMsg             = "";
                    string reData            = "";
                    try
                    {
                        wSvc         = new M_WsMember.WsMember();
                        wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/MemberSite/WsMember.svc";
                        wSvc.Timeout = 1000;

                        int reCnt = 0;

                        reCode = wSvc.exMember(AppInfo.SsMemcoCd, pMemcoNm, out reMsg, out reData);
                        if (reCode == "Y" && reData != "0")
                        {
                            //중복데이터 체크 후 USING FLAG 1로 업데이트
                            //본인이 소속된 SiteCd
                            reCode = wSvc.mMember(AppInfo.SsSiteCd, pMemcoNm, usingFlag_val, sortNo_val, memo_val, out reMsg, out reData);
                            MessageBox.Show(wRM.GetString("msgDuplicated") + " " + wRM.GetString("msgChangeUsingFlag"));
                        }
                        else
                        {
                            //중복 없으면 인서트
                            reCode = "";
                            reCode = wSvc.aMember(pMemcoNm, AppInfo.SsDbNm, usingFlag_val, sortNo_val, memo_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(AppInfo.SsMemcoCd);
                        SetDataBind_treeView1();
                    }
                    catch (Exception ex)
                    {
                        logs.SaveLog("[error]  (page)::FrmMember.cs  (Function)::dataGridView2_CellClick  (Detail):: " + "\r\n" + ex.ToString(), "Error");
                    }
                    finally
                    {
                        if (wSvc != null)
                        {
                            wSvc.Dispose();
                        }
                    }
                }
            }
        }