Beispiel #1
0
        // 待签字列表的单机事件
        private void ToDoListView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //用于判断是否签单同意  用于刷新列表
            bool ifok = false;;

            if (e.RowIndex < 0)
            {
                return;
            }
            if (e.ColumnIndex == 1)
            {
                string Id = this.ToDoListView.Rows[e.RowIndex].Cells[0].Value.ToString();
                //这里也要区分模版类型
                string type = Id[1].ToString() + Id[2].ToString();
                if (type == "内例" || type == "内专")
                {
                    //显示内河的模版
                    SignConTempInside sct = new SignConTempInside(_sc, Id, 4);
                    sct.ShowDialog();
                    if (sct.DialogResult == DialogResult.OK)
                    {
                        sct.Close();
                        ifok = true;
                    }
                }

                if (type == "界例")
                {
                    //显示界河例行的模版
                    SignConTempJHLX sct = new SignConTempJHLX(_sc, Id, 4);
                    sct.ShowDialog();
                    if (sct.DialogResult == DialogResult.OK)
                    {
                        sct.Close();
                        ifok = true;
                    }
                }

                if (type == "界专")
                {
                    SignConTemp sct = new SignConTemp(_sc, Id, 4);
                    sct.ShowDialog();

                    if (sct.DialogResult == DialogResult.OK)
                    {
                        sct.Close();
                        ifok = true;
                    }
                }

                if (ifok == true)
                {
                    //刷新数据
                    ///[BUG NO.2015-07-05 17:52]
                    BindUnsignData(true);

                    // 用户签字后,待办列表数目减少1,已办列表数目增加1
                    MainWindow mw = (MainWindow)this.MdiParent;
                    foreach (TreeNode t in mw.treeView1.Nodes)
                    {
                        if (t.Text.Contains("签字管理("))
                        {
                            int count = Convert.ToInt32(t.Text.Split('(')[1].Split(')')[0]);
                            if (count - 1 == 0)
                            {
                                t.Text          = "签字管理";
                                t.Nodes[0].Text = "待办列表";
                            }
                            else
                            {
                                t.Text          = "签字管理(" + (count - 1) + ")";
                                t.Nodes[0].Text = "待办列表(" + (count - 1) + ")";
                            }
                        }
                    }
                    //BindSignedData(true);
                }
                //SignConTemp sct = new SignConTemp(_sc, Id, 4);
                //sct.ShowDialog();
            }
        }
Beispiel #2
0
        // 已办列表的单击事件
        private async void DoneListView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            if (e.ColumnIndex == 1)
            {
                string id = this.DoneListView.Rows[e.RowIndex].Cells[0].Value.ToString();
                //这里也要区分模版类型
                string type = id[1].ToString() + id[2].ToString();
                if (type == "内例" || type == "内专")
                {
                    //显示内河的模版
                    SignConTempInside sct = new SignConTempInside(_sc, id, 5);
                    sct.ShowDialog();
                }

                if (type == "界例")
                {
                    //显示界河例行的模版
                    SignConTempJHLX sct = new SignConTempJHLX(_sc, id, 5);
                    sct.ShowDialog();
                }

                if (type == "界专")
                {
                    SignConTemp sct = new SignConTemp(_sc, id, 5);
                    sct.ShowDialog();
                }
            }

            //下载
            if (e.ColumnIndex == 8)
            {
                //获取会签单编号
                string Id = this.DoneListView.Rows[e.RowIndex].Cells[0].Value.ToString();
                if (HDJContract.GetIsOnlineFromContractId(Id) == false)
                {
                    MessageBox.Show(@"该会签单是离线审批的会签单, 无法通过本系统进行下载", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                MessageBox.Show(@"温馨提示
如果您是首次下载附件,系统将为您生成会签单文件,这个过程比较费时间,希望您能耐心等待!
生成过程中我们会在磁盘上为您生成缓存文件,打开缓存可能会导致文件损毁!
为防止用户误操作造成的损毁,我们已经为您做了备份。
如果下载完成后提示您文件损坏无法打开,您只需要点击重新下载即可,系统会立即调用缓存为您重新生成(这个速度是很快的)
由此给您带来的不便,我们表示真诚的歉意", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                SaveFileDialog sfd = new SaveFileDialog();
                sfd.FileName = this.DoneListView.Rows[e.RowIndex].Cells[0].Value.ToString();
                sfd.Filter   = "*.pdf | *.*";
                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    MainWindow mw = (MainWindow)this.MdiParent;
                    cmd.ShowOpaqueLayer(this.groupBox2, 125, true, true, "正在下载中,请稍候");
                    mw.treeView1.Enabled = false;

                    string filepath = sfd.FileName.ToString() + ".pdf";
                    //下载会签单
                    await _sc.DownloadHDJContract(Id, filepath);

                    //if(cmd.)
                    //{
                    cmd.HideOpaqueLayer();
                    //}
                    MessageBox.Show("下载完成!");

                    mw.treeView1.Enabled = true;
                }
            }
        }