public bool Insert123(getfile w)
        {
            string s = "insert into fileback(projectunit,getId,gettime,dangId,filetype,gdmethod,year,question,projectunit2,processunit,swapdate,swapdate2) values('" + w.projectunit + "','" + w.getId + "','" + w.gettime + "','" + w.dangId + "','" + w.filetype + "','" + w.gdmethod + "','" + w.year + "','" + w.question + "','" + w.projetunit2 + "','" + w.processunit + "','" + w.swapdate + "','" + w.swapdate2 + "') ";

            int rows = DBhelper.ExecuteNonQuery(s);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool Insert111(getfile w, int p)
        {
            string s = "INSERT INTO projecterror (projectunit,getId,page) VALUE ('" + w.processunit + "','" + w.getId + "','" + p + "')";

            int rows = DBhelper.ExecuteNonQuery(s);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        //添加挂接档案问题单
        public bool Insert22(getfile w)
        {
            string s = "insert into fileproblem10(bh,projectunit,getId,gettime,dangtype,gdmethod,year,problem,projectunit2,processunit,swapdate,swapdate2,solve) values('" + w.bh + "','" + w.projectunit + "','" + w.getId + "','" + w.gettime + "','" + w.filetype + "','" + w.gdmethod + "','" + w.year + "','" + w.question + "','" + w.projetunit2 + "','" + w.processunit + "','" + w.swapdate + "','" + w.swapdate2 + "','" + w.solve + "') ";

            int rows = DBhelper.ExecuteNonQuery(s);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
 //档案著录问题单
 public bool Insert7(getfile g)
 {
     return(new WorkDAL().Insert7(g));
 }
Esempio n. 5
0
 public bool Insert111(getfile g, int p)
 {
     return(new WorkDAL().Insert111(g, p));
 }
        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("提交失败失败!");
            }
        }