Esempio n. 1
0
        private void SignRefuse_CellContentClick(object sender, DataGridViewCellEventArgs e)              //已拒绝列表操作功能
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            if (e.ColumnIndex == 1)
            {
                string Id = this.SignRefuse.Rows[e.RowIndex].Cells[0].Value.ToString();
                SignConTemp sct = new SignConTemp(_sc, Id, 2);
                sct.ShowDialog();
            }
            else if (e.ColumnIndex == 4)
            {
                string Id = this.SignRefuse.Rows[e.RowIndex].Cells[0].Value.ToString();
                ReSubmitConTemp rsct = new ReSubmitConTemp(_sc, Id);
                rsct.ShowDialog();
                if (rsct.DialogResult == DialogResult.OK)
                {
                    rsct.Close();
                    ////
                    BindRefuseList(true);      // 重新提交后,强制是刷新拒绝列表
                    BindPenddingList(true);

                    MainWindow mw = (MainWindow)this.MdiParent;
                    foreach (TreeNode t in mw.treeView1.Nodes)
                    {
                        if (t.Text.Contains("提交管理("))
                        {
                            //t.Nodes[0]  -=>  提交方案
                            //t.Nodes[1]  -=>  审核中
                            //t.Nodes[2]  -=>  已拒绝
                            //t.Nodes[3]  -=>  已通过
                            int count = Convert.ToInt32(t.Text.Split('(')[1].Split(')')[0]);
                            if (count - 1 == 0)
                            {
                                t.Text = "提交管理";
                                t.Nodes[2].Text = "已拒绝";
                            }
                            else
                            {
                                t.Text = "提交管理(" + (count - 1) + ")";
                                int childcount = Convert.ToInt32(t.Nodes[2].Text.Split('(')[1].Split(')')[0]);
                                if (childcount - 1 == 0)
                                {
                                    t.Nodes[2].Text = "已拒绝";
                                }
                                else
                                {
                                    t.Nodes[2].Text = "已拒绝(" + (childcount - 1) + ")";
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private void SignRefuse_CellContentClick(object sender, DataGridViewCellEventArgs e)              //已拒绝列表操作功能
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            if (e.ColumnIndex == 1)
            {
                string Id = this.SignRefuse.Rows[e.RowIndex].Cells[0].Value.ToString();
                SignConTemp sct = new SignConTemp(_sc, Id, 2);
                sct.ShowDialog();
            }
            else if (e.ColumnIndex == 4)
            {
                string Id = this.SignRefuse.Rows[e.RowIndex].Cells[0].Value.ToString();
                ReSubmitConTemp rsct = new ReSubmitConTemp(_sc, Id);
                rsct.ShowDialog();
                if (rsct.DialogResult == DialogResult.OK)
                {
                    rsct.Close();
                    ////
                    BindRefuseList(true);      // 重新提交后,强制是刷新拒绝列表
                    BindPenddingList(true);

                    MainWindow mw = (MainWindow)this.MdiParent;
                    foreach (TreeNode t in mw.treeView1.Nodes)
                    {
                        if (t.Text.Contains("提交管理("))   //  提交管理列表的数据减1
                        {
                            //t.Nodes[0]  -=>  提交方案
                            //t.Nodes[1]  -=>  审核中
                            //t.Nodes[2]  -=>  已拒绝
                            //t.Nodes[3]  -=>  已通过
                            int count = Convert.ToInt32(t.Text.Split('(')[1].Split(')')[0]);
                            if (count - 1 == 0)
                            {
                                t.Text = "提交管理";
                                t.Nodes[2].Text = "已拒绝";
                            }
                            else
                            {
                                t.Text = "提交管理(" + (count - 1) + ")";

                                if (t.Nodes[2].Text.Contains("已拒绝("))
                                {
                                    int childcount = Convert.ToInt32(t.Nodes[2].Text.Split('(')[1].Split(')')[0]);
                                    if (childcount - 1 == 0)
                                    {
                                        t.Nodes[2].Text = "已拒绝";
                                    }
                                    else
                                    {
                                        t.Nodes[2].Text = "已拒绝(" + (childcount - 1) + ")";
                                    }
                                }
                            }
                        }
                    }
                }
            }

            else if (e.ColumnIndex == 5)
            {   // 2015-03-09 11:23  modify by gatieme for 删除已经拒绝的单子, 使编号可以被重用
                if (MessageBox.Show("确定要删除此单子?\n危险操作,请谨慎进行\n会签单是本系统中重要的数据,随意删除可能将引入很多不安全问题,请问您是否继续删除", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    string Id = this.SignRefuse.Rows[e.RowIndex].Cells[0].Value.ToString();
                    string result = _sc.DeleteHDJContract(Id);

                    if (result == Response.DELETE_HDJCONTRACT_SUCCESS.ToString())
                    {
                        MessageBox.Show("删除会签单成功!", "提示", MessageBoxButtons.OK);

                        ////
                        BindRefuseList(true);      // 重新提交后,强制是刷新拒绝列表

                    }
                    else if (result == "服务器连接中断")
                    {
                        MessageBox.Show("服务器连接中断,删除失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show("删除会签单失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }

            }
        }