Example #1
0
        private void TreeView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            TreeNode tn = treeView1.SelectedNode;

            menuObj = getMenuListObj(tn.Text);
            displayFolderPage(tn);
        }
Example #2
0
        private void updateMedical()
        {
            TreeNode tn = treeView1.SelectedNode;

            menuObj = getMenuListObj(tn.Text);
            Menu obj = new Menu()
            {
                id      = menuObj.id,
                upId    = menuObj.upId,
                caption = textBoxX4.Text,
                sn      = textBoxX3.Text,
                note    = richTextBoxEx2.Text
            };
            string  jsonData = Tool.changeObjField2(obj, "note", "bigTxt").ToString();
            JObject urlData  = JObject.Parse(Tool.CreatePostHttpResponse("http://10.0.253.9:9999/pppp/drug/category/update", jsonData));

            if (urlData["status"].ToString() == "1")
            {
                MessageBox.Show("修改成功");
            }
            else
            {
                MessageBox.Show("修改失败");
            }
            clearText();
        }
Example #3
0
        private void displayFolderPage(TreeNode tn)
        {
            superTabControl1.SelectedTabIndex = 1;
            Menu menuObj = getMenuListObj(tn.Text);

            textBoxX3.Text      = menuObj.getCategoryNo();
            textBoxX4.Text      = menuObj.getName();
            richTextBoxEx2.Text = menuObj.getNote();
        }
Example #4
0
 private void getMenu(List <Menu> menuList)
 {
     for (int i = 0; i < menuList.Count(); i++)
     {
         Menu     menu     = menuList[i];
         TreeNode rootNode = treeView1.Nodes.Add(menu.getName());
         rootNode.ImageIndex = 0;
         if (menu.getPid() == "0")
         {
             getChildMenu(menu, menuList, rootNode);
             break;
         }
     }
 }
Example #5
0
 private void getChildMenu(Menu parentMenu, List <Menu> menuList, TreeNode node)
 {
     for (int i = 0; i < menuList.Count(); i++)
     {
         Menu menu = menuList[i];
         if (menu.getPid() == parentMenu.getId())
         {
             TreeNode childNode = new TreeNode(menu.getName());
             node.Nodes.Add(childNode);
             node.ImageIndex = 0;
             node.Tag        = "folder";
             getChildMenu(menu, menuList, childNode);
         }
     }
 }
Example #6
0
        private void deleteMedical()
        {
            TreeNode tn = treeView1.SelectedNode;

            menuObj = getMenuListObj(tn.Text);
            JObject urlData = JObject.Parse(Tool.CreatePostHttpResponse("http://10.0.253.9:9999/pppp/drug/category/delete", "{\"id\": \"" + menuObj.id + "\"}"));

            if (urlData["status"].ToString() == "1")
            {
                MessageBox.Show("删除成功");
            }
            else
            {
                MessageBox.Show("删除失败");
            }
            clearText();
        }