Ejemplo n.º 1
0
 private void btnupload_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < cnt111; i++)
     {
         string st = filescpoy[i];
         st = st.Replace("\\", "\\\\");
         bool flag = new WorkBAL().Insert1107(a, i + 1, st);
     }
     MessageBox.Show("成功");
 }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int i     = dataGridView1.Rows.Count;
            int river = 0;

            for (int j = 0; j < i - 1; j++)
            {
                processfile p = new processfile();
                //      p.bh = textBoxDH.Text.Trim();
                p.bh           = this.dataGridView1.Rows[j].Cells[0].Value.ToString();
                p.filetype     = textBoxDALX.Text.Trim();
                p.gdmethod     = textBoxGDFS.Text.Trim();
                p.getId        = textBoxLQPCH.Text.Trim();
                p.lzId         = textBoxLZDH.Text.Trim();
                p.page         = textBoxYS.Text.Trim();
                p.process      = pppp;
                p.processdate  = dateTimePicker1.Value;
                p.projectunit  = textBoxXMDW.Text.Trim();
                p.responseible = textBoxZRR.Text.Trim();
                p.year         = textBoxNX.Text.Trim();
                if (nowrole == "【拆分】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    river++;

                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【著录】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    // 更改档案状态
                    river++;
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【编码】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    // 更改档案状态
                    bool flag2 = new WorkBAL().update14(p.getId, p.bh);
                    if (flag2 == true)
                    {
                        river++;
                    }
                    this.Close();
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【还原】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    // 更改档案状态
                    river++;
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【扫描】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    river++;
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【编目】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    river++;
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【图处】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    // 更改档案状态
                    bool flag2 = new WorkBAL().update16(p.getId, p.bh);
                    river++;
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【质检】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    river++;
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【挂接】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    river++;
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
                else if (nowrole == "【归还】")
                {
                    MySqlDataReader sdr = new WorkBAL().Selectinfo3(p.bh, p.getId);
                    if (sdr.Read())
                    {
                        sdr.Close();
                        bool flag11 = new WorkBAL().update4(p);
                    }
                    else
                    {
                        sdr.Close();
                        bool flag22 = new WorkBAL().Insert4(p);
                    }
                    river++;
                    raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                }
            }
            if (river == i - 1)
            {
                MessageBox.Show("提交成功");
            }
            else
            {
                MessageBox.Show("提交失败");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (ss == 0)
            {
                int i   = dataGridView1.Rows.Count;
                int cnt = 0;
                for (int j = 0; j < i - 1; j++)
                {
                    getfile g = new getfile();
                    g.dangId      = textBoxDH.Text.Trim();
                    g.filetype    = textBoxDALX.Text.Trim();
                    g.gdmethod    = textBoxGDFS.Text.Trim();
                    g.getId       = textBoxLQPCH.Text.Trim();
                    g.gettime     = dateTimePickerlLQSJ.Value;
                    g.processunit = textBoxJGDW.Text.Trim();
                    g.projectunit = textBoxXMDW.Text.Trim();
                    g.projetunit2 = textBox.Text.Trim();
                    g.swapdate    = dateTimePickerRQ1.Value;
                    g.swapdate2   = dateTimePickerRQ2.Value;
                    g.year        = textBoxNX.Text.Trim();
                    //            g.page = textBoxYS.Text.Trim();
                    getId = g.getId;
                    for (int s = 0; s < dataGridView1.ColumnCount; s++)
                    {
                        if (this.dataGridView1.Rows[j].Cells[s].Value != null)
                        {
                            string str = this.dataGridView1.Rows[j].Cells[s].Value.ToString();
                            if (s == 0)
                            {
                                g.bh = str;
                            }
                            else
                            {
                                g.question = str;
                            }
                        }
                        else
                        {
                            if (s == 0)
                            {
                                g.bh = "";
                            }
                            else
                            {
                                g.question = "";
                            }
                        }
                    }
                    bool flag = new WorkBAL().Insert2(g);
                    if (flag)
                    {
                        cnt++;

                        // 更改档案状态
                        bool flag3 = new projectBAL().insert(pId, getId, g.bh);
                        bool flag2 = new projectBAL().update(getId, g.bh);
                        raiseCallBackRefreshEvent(); //将事件抛出去,在主窗体中接收,并作相应处理
                                                     //      this.Close();
                    }
                    else
                    {
                        //                   MessageBox.Show("提交失败失败!");
                    }
                }
                if (cnt == i - 1)
                {
                    MessageBox.Show("提交成功!");
                }
                else
                {
                    MessageBox.Show("提交失败失败!");
                }
                ss++;
            }
            else
            {
                MessageBox.Show("请勿重复提交");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            int i   = dataGridView1.Rows.Count;
            int cnt = 0;

            for (int j = 0; j < i - 1; j++)
            {
                getfile g = new getfile();
                g.filetype    = textBoxDALX.Text.Trim();
                g.gdmethod    = textBoxGDFS.Text.Trim();
                g.getId       = textBoxLQPCH.Text.Trim();
                g.gettime     = dateTimePickerLQSJ.Value;
                g.processunit = textBoxJGDW.Text.Trim();
                g.projectunit = textBoxXMDW.Text.Trim();
                g.projetunit2 = textBox.Text.Trim();
                g.swapdate    = dateTimePicker3.Value;
                g.swapdate2   = dateTimePicker4.Value;
                g.year        = textBoxNX.Text.Trim();
                for (int s = 0; s < dataGridView1.ColumnCount; s++)
                {
                    if (this.dataGridView1.Rows[j].Cells[s].Value != null)
                    {
                        string str = this.dataGridView1.Rows[j].Cells[s].Value.ToString();
                        if (s == 0)
                        {
                            g.bh = str;
                        }
                        else if (s == 1)
                        {
                            g.question = str;
                        }
                        else
                        {
                            g.solve = str;
                        }
                    }
                }
                if (nowrole == "【领取】")
                {
                    bool flag = new WorkBAL().Insert3(g);
                    if (flag)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【拆分】")
                {
                    bool flag1 = new WorkBAL().Insert6(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【著录】")
                {
                    bool flag1 = new WorkBAL().Insert7(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【编码】")
                {
                    bool flag1 = new WorkBAL().Insert9(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【还原】")
                {
                    bool flag1 = new WorkBAL().Insert11(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【扫描】")
                {
                    bool flag1 = new WorkBAL().Insert13(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【编目】")
                {
                    bool flag1 = new WorkBAL().Insert15(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【图处】")
                {
                    bool flag1 = new WorkBAL().Insert17(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【质检】")
                {
                    bool flag1 = new WorkBAL().Insert21(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【挂接】")
                {
                    bool flag1 = new WorkBAL().Insert22(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
                else if (nowrole == "【归还】")
                {
                    bool flag1 = new WorkBAL().Insert22(g);
                    if (flag1)
                    {
                        cnt++;
                    }
                }
            }
            if (cnt == i - 1)
            {
                MessageBox.Show("提交成功!");
                //             Form待加工档案 f = new Form待加工档案(nowrole);
                //            f.Show();
                //           this.Hide();
            }
            else
            {
                MessageBox.Show("提交失败失败!");
            }
        }