예제 #1
0
        private void SetDataBind_CmbMenuTop()
        {
            M_WsMenuMainDB.WsMenuMainDB wSvc = null;
            string reCode = "";
            string reMsg  = "";

            M_WsMenuMainDB.DataMenuTop[] getData1 = null;
            try
            {
                wSvc         = new M_WsMenuMainDB.WsMenuMainDB();
                wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/Menu/WsMenuMainDB.svc";
                wSvc.Timeout = 1000;

                reCode = wSvc.sMenuTopTreeView(out getData1, out reMsg);

                if (reCode == "Y")
                {
                    if (getData1 != null && getData1.Length > 0)
                    {
                        Class.Common.ComboBoxItemSet setCmb = null;

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

                        for (int i = 0; i < getData1.Length; i++)
                        {
                            string tmenuCd_val = getData1[i].TOP_MENU_CD.ToString();
                            string tmenuNm_val = getData1[i].TOP_MENU_NM.ToString();
                            setCmb.AddRow(getData1[i].TOP_MENU_NM.ToString(), getData1[i].TOP_MENU_CD.ToString());
                        }

                        setCmb.Bind(cmbMenuTop);
                    }
                }
            }
            catch (Exception ex)
            {
                logs.SaveLog("[error]  (page)::FrmMenuSetAuthSite.cs  (Function)::SetDataBind_CmbMenuTop  (Detail):: " + "\r\n" + ex.ToString());
            }
        }
예제 #2
0
        private void SetDataBind_treeView1()
        {
            treeView1.Nodes.Clear();

            M_WsMenuMainDB.WsMenuMainDB wSvc = null;
            string reCode = "";
            string reMsg  = "";

            M_WsMenuMainDB.DataMenuTop[] getData1 = null;
            M_WsMenuMainDB.DataMenuSub[] getData2 = null;
            try
            {
                wSvc         = new M_WsMenuMainDB.WsMenuMainDB();
                wSvc.Url     = "http://" + AppInfo.SsWsvcServer2 + "/WebSvc/Sys/Menu/WsMenuMainDB.svc";
                wSvc.Timeout = 1000;

                ImageList myimageList = new ImageList();
                myimageList.Images.Add(Image.FromFile(@"Image\treeicon1.png"));

                treeView1.ImageList  = myimageList;
                treeView1.ImageIndex = 0;

                reCode = wSvc.sMenuTopTreeView(out getData1, out reMsg);
                if (reCode == "Y")
                {
                    if (getData1 != null && getData1.Length > 0)
                    {
                        for (int i = 0; i < getData1.Length; i++)
                        {
                            string tmenuCd_val = getData1[i].TOP_MENU_CD.ToString();
                            string tmenuNm_val = getData1[i].TOP_MENU_NM.ToString();

                            TreeNode root = new TreeNode();
                            root.Tag  = "1-" + tmenuCd_val + "-0";
                            root.Text = tmenuNm_val;

                            reCode = wSvc.sMenuSubTreeView(tmenuCd_val, out getData2, out reMsg);
                            if (reCode == "Y")
                            {
                                if (getData2 != null && getData2.Length > 0)
                                {
                                    for (int j = 0; j < getData2.Length; j++)
                                    {
                                        string smenuCd_val = getData2[j].SUB_MENU_CD.ToString();
                                        string smenuNm_val = getData2[j].SUB_MENU_NM.ToString();

                                        TreeNode node2 = new TreeNode();
                                        node2.Tag  = "2-" + tmenuCd_val + "-" + smenuCd_val;
                                        node2.Text = smenuNm_val;

                                        root.Nodes.Add(node2);
                                    }
                                }
                            }

                            treeView1.Nodes.Add(root);

                            if (treeView1.Nodes.Count > 0)
                            {
                                treeView1.SelectedNode = treeView1.GetNodeAt(0, 0);
                            }
                        }
                        treeView1.ExpandAll();
                    }
                }
            }
            catch (Exception ex)
            {
                logs.SaveLog("[error]  (page)::FrmMenuMainDB.cs  (Function)::SetDataBind_treeView1  (Detail):: " + "\r\n" + ex.ToString(), "Error");
            }
            finally
            {
                if (wSvc != null)
                {
                    wSvc.Dispose();
                }
            }
        }