private void button1_Click(object sender, EventArgs e)
        {
            int n = 0;
            int l = 0;

            for (int j = 0; j < dataGridView1.RowCount; j++)
            {
                if ((bool)dataGridView1.Rows[j].Cells[0].EditedFormattedValue == true)
                {
                    n++;
                    string a    = dataGridView1.Rows[j].Cells[1].Value.ToString();
                    bool   flag = new AABAL().update112703(a);
                    if (flag == true)
                    {
                        l++;
                    }
                }
            }
            if (n == l)
            {
                MessageBox.Show("删除成功");
            }
            DataTable dt1 = new projectBAL().Select112701(pId);

            dataGridView1.DataSource = dt1;
            dataGridView1.Refresh();
        }
        private void Form档案领取交接单_Load(object sender, EventArgs e)
        {
            textBoxDH.Text   = pId;
            textBoxDALX.Text = filetype;
            textBoxGDFS.Text = gdmethod;
            textBoxNX.Text   = year;
            textBoxXMDW.Text = projectunit;
            textBox.Text     = projectunit;
            DataTable dt = new projectBAL().Select1(pId);

            if (dt != null && dt.Rows.Count > 0)
            {
                if (dt.Rows[0][0].ToString() != "")
                {
                    string[] sArray = dt.Rows[0][0].ToString().Split('-');
                    int      i      = Convert.ToInt32(sArray[1]);
                    i = i + 1;
                    string str = i.ToString("000");
                    str = pId + "-" + str;
                    textBoxLQPCH.Text = str;
                }
                else
                {
                    string str = "001";
                    str = pId + "-" + str;
                    textBoxLQPCH.Text = str;
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            int       a     = dataGridView1.CurrentRow.Index;
            string    str   = dataGridView1.Rows[a].Cells["项目号"].Value.ToString();
            DataTable dt    = new projectBAL().Select(str);
            string    s     = "";
            string    ss    = "";
            string    sss   = "";
            string    ssss  = "";
            string    sssss = "";

            if (dt != null && dt.Rows.Count > 0)
            {
                s     = dt.Rows[0][0].ToString();
                ss    = dt.Rows[0][1].ToString();
                sss   = dt.Rows[0][2].ToString();
                ssss  = dt.Rows[0][3].ToString();
                sssss = dt.Rows[0][4].ToString();
            }
            Form档案问题确认单 form = new Form档案问题确认单(s, ss, sss, ssss, nowrole);

            // this.Hide();

            form.ShowDialog();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            int       a     = dataGridView1.CurrentRow.Index;
            string    str   = dataGridView1.Rows[a].Cells["项目号"].Value.ToString();
            DataTable dt    = new projectBAL().Select(str);
            string    s     = "";
            string    ss    = "";
            string    sss   = "";
            string    ssss  = "";
            string    sssss = "";

            if (dt != null && dt.Rows.Count > 0)
            {
                s     = dt.Rows[0][0].ToString();
                ss    = dt.Rows[0][1].ToString();
                sss   = dt.Rows[0][2].ToString();
                ssss  = dt.Rows[0][3].ToString();
                sssss = dt.Rows[0][4].ToString();
            }
            Form档案领取交接单 form = new Form档案领取交接单(s, ss, sss, ssss, sssss);

            // this.Hide();
            form.raiseCallBackRefreshEvent += new fileDelegate(childfrm_raiseCallBackRefreshEvent); //注册回调事件,也即将子窗体抛出的事件接收,然后处理
            form.ShowDialog();
        }
        public Form批次具体查看(string str1) : this()
        {
            this.pId = str1;
            DataTable dt1 = new projectBAL().Select112701(pId);

            dataGridView1.DataSource = dt1;
            AutoSizeColumn(dataGridView1);
        }
        private void Form档案领取_Load(object sender, EventArgs e)
        {
            DataSet   ds = new GetJobBAL().Select();
            DataTable dt = new projectBAL().Select1127();

            dt.Columns.Add("已领取批次数", typeof(string));
            int i = 0;

            foreach (DataRow dr in dt.Rows)
            {
                DataTable dt1 = new projectBAL().Select112701(dt.Rows[i++][0].ToString());
                dr["已领取批次数"] = dt1.Rows.Count;
            }
            dataGridView1.DataSource = dt;
        }
        private void LoadData()
        {
            int     nStartPos = 0; //当前页面开始记录行
            int     nEndPos   = 0; //当前页面结束记录行
            DataSet ds;

            ds = new projectBAL().Select(filetype, pId, gdmethod);


            DataTable dt = ds.Tables[0];

            System.Data.DataTable dtTemp = dt.Clone(); //克隆DataTable结构框架
            if (dtTemp != null || dtTemp.Rows.Count > 0)
            {
                if (pageCurrent == pageCount)
                {
                    nEndPos = nMax;
                }
                else
                {
                    nEndPos = pageSize * pageCurrent;
                }
                nStartPos           = nCurrent;
                lblPageCount.Text   = pageCount.ToString();          //在bdnInfo中添加lable记录总页数
                txtCurrentPage.Text = Convert.ToString(pageCurrent); //在bdnInfo中添加Textbox记录当前页数
                                                                     //从元数据源复制记录行
                for (int i = nStartPos; i < nEndPos; i++)
                {
                    if (i < dt.Rows.Count)
                    {
                        dtTemp.ImportRow(dt.Rows[i]);
                        nCurrent++;
                    }
                }
                bdsInfo.DataSource       = dtTemp;
                bdnInfo.BindingSource    = bdsInfo;
                dataGridView1.DataSource = bdsInfo;
            }
            else
            {
                return;
            }
        }
        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)
        {
            if (textBox1.Text == "" || textBox2.Text == "" || comboBox5.Text == "" || textBox4.Text == "" || textBox8.Text == "" || textBox3.Text == "")
            {
                MessageBox.Show("输入信息不完全");
            }
            else
            {
                if (checkBox1.Checked == true && checkBox11.Checked == true)
                {
                    string url = textBox3.Text.Trim();
                    url = url.Replace("\\", "\\\\");
                    string  hz = comboBox7.Text.Trim();
                    project p  = new project();
                    p.pId         = textBox8.Text.Trim();
                    p.projectunit = textBox1.Text.Trim();
                    p.filetype    = textBox2.Text.Trim();
                    p.gdmethod    = comboBox5.Text.Trim();
                    p.year        = textBox4.Text.Trim();

                    p.str1  = comboBox1.Text.Trim();
                    p.str2  = comboBox2.Text.Trim();
                    p.str3  = comboBox3.Text.Trim();
                    p.str4  = comboBox4.Text.Trim();
                    p.str5  = comboBox5.Text.Trim();
                    p.pgz   = comboBox8.Text.Trim();
                    p.pdf   = comboBox11.Text.Trim();
                    p.pdfgz = comboBox9.Text.Trim();
                    p.ocr   = comboBox10.Text.Trim();
                    p.url   = url;
                    p.hz    = hz;
                    bool flag = new projectBAL().Insert456(p);

                    /*     if (checkBox12.Checked == true)
                     *   {
                     *       string b = "2";
                     *       bool flag7 = new projectBAL().Insert4444(p.pId, b);
                     *   }*/
                    if (cb_xmh.Checked == true)
                    {
                        string b     = "1";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmtm.Checked == true)
                    {
                        string b     = "3";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmys.Checked == true)
                    {
                        string b     = "2";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }

                    /*   if (checkBox19.Checked == true)
                     * {
                     *     string b = "8";
                     *     bool flag7 = new projectBAL().Insert4444(p.pId, b);
                     * }*/
                    if (cb_ajh.Checked == true)
                    {
                        string b     = "11";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_ajtm.Checked == true)
                    {
                        string b     = "12";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_ajys.Checked == true)
                    {
                        string b     = "13";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_ajzrr.Checked == true)
                    {
                        string b     = "18";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjdh.Checked == true)
                    {
                        string b     = "19";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjjh.Checked == true)
                    {
                        string b     = "20";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjtm.Checked == true)
                    {
                        string b     = "21";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjys.Checked == true)
                    {
                        string b     = "22";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjyh.Checked == true)
                    {
                        string b     = "23  ";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmkssj.Checked == true)
                    {
                        string b     = "4";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmjssj.Checked == true)
                    {
                        string b     = "5";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmyzdw.Checked == true)
                    {
                        string b     = "6";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmsjdw.Checked == true)
                    {
                        string b     = "7";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmsgdw.Checked == true)
                    {
                        string b     = "8";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmjldw.Checked == true)
                    {
                        string b     = "9";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_xmflh.Checked == true)
                    {
                        string b     = "10";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_ajqzrq.Checked == true)
                    {
                        string b     = "14";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_ajbgqx.Checked == true)
                    {
                        string b     = "15";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_ajflh.Checked == true)
                    {
                        string b     = "16";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_ajmj.Checked == true)
                    {
                        string b     = "17";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjzrr.Checked == true)
                    {
                        string b     = "24";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjrq.Checked == true)
                    {
                        string b     = "25";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjnd.Checked == true)
                    {
                        string b     = "26";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjbgqx.Checked == true)
                    {
                        string b     = "27";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjflh.Checked == true)
                    {
                        string b     = "28";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }
                    if (cb_wjmj.Checked == true)
                    {
                        string b     = "29";
                        bool   flag7 = new projectBAL().Insert4444(p.pId, b);
                    }

                    //       bool flag11 = new projectBAL().Insert4444(z1,p.pId,p.projectunit);
                    //      bool flag22 = new projectBAL().Insert5555(z2, p.pId, p.projectunit);
                    //     bool flag33 = new projectBAL().Insert6666(z3, p.pId, p.projectunit);
                    int        cnt  = 0;
                    int        cnt1 = 0;
                    workstatus w    = new workstatus();
                    w.projectUnit = textBox1.Text.Trim();
                    if (checkBox1.Checked == true)
                    {
                        string    a     = "1";
                        string    b     = "领取";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 1);
                        DataTable str2  = new AABAL().Select102(p.pId, 1);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox2.Checked == true)
                    {
                        string    a     = "2";
                        string    b     = "打码";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 2);
                        DataTable str2  = new AABAL().Select102(p.pId, 2);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox3.Checked == true)
                    {
                        string    a     = "3";
                        string    b     = "拆分";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 3);
                        DataTable str2  = new AABAL().Select102(p.pId, 3);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox4.Checked == true)
                    {
                        string    a     = "4";
                        string    b     = "著录";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 4);
                        DataTable str2  = new AABAL().Select102(p.pId, 4);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox13.Checked == true)
                    {
                        string    a     = "5";
                        string    b     = "再次著录";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 5);
                        DataTable str2  = new AABAL().Select102(p.pId, 5);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox5.Checked == true)
                    {
                        string    a     = "6";
                        string    b     = "扫描";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 6);
                        DataTable str2  = new AABAL().Select102(p.pId, 6);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }

                    /* if (checkBox6.Checked == true)
                     * {
                     *   w.bm = ++cnt;
                     * }*/
                    if (checkBox7.Checked == true)
                    {
                        string    a     = "7";
                        string    b     = "图处";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 7);
                        DataTable str2  = new AABAL().Select102(p.pId, 7);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox8.Checked == true)
                    {
                        string    a     = "8";
                        string    b     = "质检";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 8);
                        DataTable str2  = new AABAL().Select102(p.pId, 8);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox9.Checked == true)
                    {
                        string    a     = "9";
                        string    b     = "挂接";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 9);
                        DataTable str2  = new AABAL().Select102(p.pId, 9);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox10.Checked == true)
                    {
                        string    a     = "10";
                        string    b     = "还原";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 10);
                        DataTable str2  = new AABAL().Select102(p.pId, 10);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                    }
                    if (checkBox11.Checked == true)
                    {
                        string    a     = "11";
                        string    b     = "归还";
                        bool      flag7 = new projectBAL().Insert(p.pId, a, b);
                        DataTable str   = new AABAL().Select101(p.pId, 11);
                        DataTable str2  = new AABAL().Select102(p.pId, 11);
                        cnt++;
                        bool flag101 = new projectBAL().Insert101(p.pId, a, b, str.Rows[0][0].ToString(), str2.Rows[0][0].ToString());
                        if (flag101 == true)
                        {
                            cnt1++;
                        }
                        if (cnt == cnt1)
                        {
                            MessageBox.Show("项目规则定义成功!");
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show("项目规则定义失败!");
                        }
                    }
                    w.flag = cnt;
                }
                else
                {
                    MessageBox.Show("第一个环节必须为领取,最后一个环节必须为归还");
                }
            }
        }