Exemple #1
0
 private void AddAreaToolStripMenuItem_Click(object sender, EventArgs e)
 {
     dlgSetAreaName sn = new dlgSetAreaName();
     if (sn.ShowDialog() == DialogResult.OK)
     {
         TreeNode newtn = new TreeNode();
         newtn.Tag = bi.AddNewArea(treeView1.SelectedNode.Tag.ToString(), sn.AreaName,sn.AreaNo, MainForm.thePurchaseSiteCode, MainForm.thePurchaseSiteName, MainForm.theUserName);
         newtn.Text = sn.AreaName;
         newtn.ImageIndex = 1;
         newtn.SelectedImageIndex = 2;
         this.treeView1.SelectedNode.Nodes.Add(newtn);
         treeView1.SelectedNode.Expand();
         treeView1.SelectedNode = newtn;
     }
 }
Exemple #2
0
 private void ModifytoolStripMenuItem_Click(object sender, EventArgs e)
 {
     dlgSetAreaName sn = new dlgSetAreaName(treeView1.SelectedNode.Tag.ToString());
     if (sn.ShowDialog() == DialogResult.OK)
     {
         if (bi.SaveAreaInfo(treeView1.SelectedNode.Tag.ToString(), sn.AreaName, sn.AreaNo, MainForm.theUserName))
         {
             treeView1.SelectedNode.Text = sn.AreaName;
         }
         else
         {
             MessageBox.Show("����δ֪�����޸�Ƭ����Ϣʧ�ܡ�", "��ʾ��Ϣ", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         }
     }
 }