Beispiel #1
0
        //删除用户
        private void ToolStripMenuItem5_Click(object sender, EventArgs e)
        {
            treeView1.PathSeparator = "/";
            string path = treeView1.SelectedNode.FullPath.ToString();
            int count = 0;
            for (int i = 0; i < path.Length; i++)
            {
                if (path[i].CompareTo('/') == 0)
                    count++;
            }

            string userGrpName = "";
            DeleteForm deleteForm = new DeleteForm(sqlConnection);
            deleteForm.Text = "删除用户";
            deleteForm.DeleteFlag = 3;
            if (listView1.SelectedItems.Count != 0)
            {
                deleteForm.BarCode = listView1.SelectedItems[0].SubItems[1].Text;
                switch (count)
                {
                    case 1:	//第二级节点:用户属性
                        userGrpName = treeView1.SelectedNode.Text;
                        if (deleteForm.ShowDialog(this) == DialogResult.OK)
                        {
                            dataSet.Tables["UserGrpDetailsView"].Clear();
                            dataSet.Tables["UserInfoDetailsView"].Clear();
                            treeView1.Nodes.Clear();

                            //technologyLib.GetUserGrpDetailsViewData(dataSet);
                            technologyLib.GetUserInfoDetailsViewData(dataSet);

                            InitialTreeView(treeView1);
                            listView1.Clear();
                            InsertAllColumns(1);
                            AddItem_UserInfo(userGrpName);
                        }
                        break;
                    case 2: //第三级节点:单个用户属性
                        userGrpName = treeView1.SelectedNode.Parent.Text;
                        if (deleteForm.ShowDialog(this) == DialogResult.OK)
                        {
                            dataSet.Tables["UserGrpDetailsView"].Clear();
                            dataSet.Tables["UserInfoDetailsView"].Clear();
                            treeView1.Nodes.Clear();

                            //technologyLib.GetUserGrpDetailsViewData(dataSet);
                            technologyLib.GetUserInfoDetailsViewData(dataSet);

                            InitialTreeView(treeView1);
                            listView1.Clear();
                            InsertAllColumns(2);
                            AddItem_UserInfo(userGrpName);
                        }
                        break;
                }
            }
            else
            {
                MessageBox.Show("请选择要删除的用户!");
            }
        }
Beispiel #2
0
        //删除用户组
        private void ToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count != 0)
            {
                DeleteForm deleteForm = new DeleteForm(sqlConnection);
                deleteForm.Text = "删除用户组";
                deleteForm.DeleteFlag = 2;
                deleteForm.UserGrpName = listView1.SelectedItems[0].SubItems[1].Text;
                if (deleteForm.ShowDialog(this) == DialogResult.OK)
                {
                    dataSet.Tables["UserGrpDetailsView"].Clear();
                    dataSet.Tables["UserInfoDetailsView"].Clear();
                    treeView1.Nodes.Clear();

                    technologyLib.GetUserGrpDetailsViewData(dataSet);
                    technologyLib.GetUserInfoDetailsViewData(dataSet);

                    InitialTreeView(treeView1);
                    listView1.Clear();
                    InsertAllColumns(0);
                    AddItem_UserGrp();
                }
            }
            else
            {
                MessageBox.Show("请选择要删除的用户组!");
            }
        }
Beispiel #3
0
 //删除工序方案
 private void ToolStripMenuItem4_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count != 0)
     {
         DeleteForm deleteForm = new DeleteForm(sqlConnection);
         deleteForm.Text = "删除工序方案";
         deleteForm.DeleteFlag = 5;
         deleteForm.FlowProjectName = listView1.SelectedItems[0].SubItems[1].Text;
         if (deleteForm.ShowDialog(this) == DialogResult.OK)
         {
             treeView1.Nodes.Clear();
             dataSet.Tables["FlowProject"].Clear();
             dataSet.Tables["FlowProjectDetailsView"].Clear();
             technologyLib.GetFlowProjectData(dataSet);
             technologyLib.GetFlowProjectDetailsViewData(dataSet);
             InitialTreeView(treeView1);
             listView1.Items.Clear();
             AddItem_FlowProject();
         }
     }
     else
     {
         MessageBox.Show("请选择要删除的工序方案!");
     }
 }
Beispiel #4
0
 private void DeleteFlowToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count != 0)
     {
         DeleteForm deleteForm = new DeleteForm(sqlConnection);
         deleteForm.Text = "删除工序";
         deleteForm.DeleteFlag = 4;
         deleteForm.FlowName = listView1.SelectedItems[0].SubItems[1].Text;
         if (deleteForm.ShowDialog(this) == DialogResult.OK)
         {
             dataSet.Tables["FlowDetails"].Clear();
             technologyLib.GetFlowDetailsData(dataSet);
             InitialListView(listView1);
         }
     }
     else
     {
         MessageBox.Show("请选择要删除的工序!");
     }
 }
Beispiel #5
0
 /// <summary>
 /// 删除调试方案
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ToolStripMenuItem4_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count !=0)
     {
         DeleteForm deleteForm = new DeleteForm(sqlConnection);
         deleteForm.Text = "删除调试方案";
         deleteForm.DebugItemProjectName = listView1.SelectedItems[0].SubItems[1].Text;
         if(deleteForm.ShowDialog(this) == DialogResult.OK)
         {
             treeView1.Nodes.Clear();
             dataSet.Tables["DebugItemProject"].Clear();
             dataSet.Tables["DebugItemProjectDetailsView"].Clear();
             technologyLib.GetDebugItemData(dataSet);
             technologyLib.GetDebugItemDetailsViewData(dataSet);
             InitialTreeView(treeView1);
             listView1.Items.Clear();
             AddItem_DebugItemProject();
         }
     }
 }