示例#1
0
 private void timer3_Tick(object sender, EventArgs e)
 {
     if (yonghu == "袁天坤")
     {
         string    sql1 = "select id,接单编号,机修件ERP,客户名称,部门,工件名称,加工内容,计量单位,机修件数量,接单日期,预交时间,联系人,责任人,加工单位备注,当前状态,合同号,供方名称,附件名称  from  tb_caigouliaodan where 加工单位备注='自制' and 完成='机修待审批' and 当前状态='待责任人审核' order by 接单日期";
         DataTable dt   = SQLhelp.GetDataTablexiangmuguanli(sql1, CommandType.Text);
         if (dt.Columns.Count > 0)
         {
             MessageBox.Show("有自制机修件待审批");
         }
     }
     else if (yonghu == "袁鹏")
     {
         string    sql1 = "select id,接单编号,机修件ERP,客户名称,部门,工件名称,加工内容,计量单位,机修件数量,接单日期,预交时间,联系人,责任人,加工单位备注,当前状态,合同号,供方名称,附件名称  from  tb_caigouliaodan where 加工单位备注='自制' and 完成='机修待审批' and 当前状态='机修待袁鹏审批'  order by 接单日期";
         DataTable dt   = SQLhelp.GetDataTablexiangmuguanli(sql1, CommandType.Text);
         if (dt.Rows.Count > 0)
         {
             MessageBox.Show("有自制机修件待审批");
         }
     }
     else if (yonghu == "于嘉嘉")
     {
         string    sql1 = "select id,接单编号,机修件ERP,客户名称,部门,工件名称,加工内容,计量单位,机修件数量,接单日期,预交时间,联系人,责任人,加工单位备注,当前状态,合同号,供方名称,附件名称  from  tb_caigouliaodan where 加工单位备注='外协' and 完成='机修待审批'  order by 接单日期";
         DataTable dt   = SQLhelp.GetDataTablexiangmuguanli(sql1, CommandType.Text);
         if (dt.Rows.Count > 0)
         {
             MessageBox.Show("有外协机修件待审批");
         }
     }
 }
示例#2
0
        private void FrPresentation_Load(object sender, EventArgs e)
        {
            string    sql    = "select 用户名,部门,序号 from tb_operator where 用户名='" + yonghu + "'";
            DataTable jieguo = SQLhelp.GetDataTable(sql, CommandType.Text);

            bumen   = jieguo.Rows[0]["部门"].ToString();
            bianhao = jieguo.Rows[0]["序号"].ToString();

            string    sql1 = "select 部门 from tb_bumen";
            DataTable aaaa = SQLhelp.GetDataTable(sql1, CommandType.Text);


            List <string> spaceminute = new List <string>();

            for (int i = 0; i < aaaa.Rows.Count; i++)
            {
                string n = aaaa.Rows[i]["部门"].ToString();
                spaceminute.Add(n);
            }


            foreach (string s in spaceminute)
            {
                comboBoxEx1.Items.Add(s);
            }
        }
示例#3
0
        private void dataGridViewX2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int dingwei = Convert.ToInt32(dataGridViewX2.CurrentRow.Cells["id"].Value);

            string shangchuanren = dataGridViewX2.CurrentRow.Cells["纪要上传人"].Value.ToString();

            if (shangchuanren == yonghu)
            {
                string sql1 = "update tb_xiangxi set 更新='' where id='" + dingwei + "'";
                SQLhelp.ExecuteScalar(sql1, CommandType.Text);

                Frhuifuhuiyijiyao form = new Frhuifuhuiyijiyao();
                form.yonghu  = yonghu;
                form.dingwei = dingwei;
                form.ShowDialog();
                Reload();
            }

            if (shangchuanren != yonghu)
            {
                Frhuifuhuiyijiyao form = new Frhuifuhuiyijiyao();
                form.yonghu  = yonghu;
                form.dingwei = dingwei;
                form.ShowDialog();
            }
        }
示例#4
0
 private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Left && e.Clicks == 2)
     {
         if (gridView1.RowCount <= 0)//判断是否选中要删除的行
         {
             MessageBox.Show("请选中行!");
             return;
         }
         string shijian = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "提交时间").ToString();
         if (shijian != "")
         {
             string a             = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "报告标题").ToString();
             string b             = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "员工姓名").ToString();
             string baogaoleixing = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "报告类型").ToString();
             string chaxun11      = "select 文件类型 from tb_wenjian where 员工姓名='" + b + "'and 提交时间='" + shijian + "' and 报告类型='" + baogaoleixing + "'";
             leixing = SQLhelp.ExecuteScalar(chaxun11, CommandType.Text).ToString();
             byte[] mypdffile = null;
             string sql       = "Select 文件 From tb_wenjian Where 报告标题='" + a + "' and  提交时间='" + shijian + "'and  员工姓名='" + b + "' ";
             mypdffile   = SQLhelp.duqu(sql, CommandType.Text);
             this.Cursor = Cursors.WaitCursor;
             string     aaaa   = System.Environment.CurrentDirectory;
             string     lujing = aaaa + "\\" + a + "1" + "." + leixing;
             FileStream fs     = new FileStream(lujing, FileMode.Create);
             fs.Write(mypdffile, 0, mypdffile.Length);
             fs.Flush();
             fs.Close();
             this.Cursor = Cursors.Default;
             Frchakanbaogao form1 = new Frchakanbaogao();
             form1.lujing = lujing;
             form1.Show();
         }
     }
 }
示例#5
0
        private void 查看指示项附件ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridViewX1.Rows.Count <= 0)
            {
                MessageBox.Show("请选中行!");
                return;
            }
            if (Convert.ToString(dataGridViewX1.CurrentRow.Cells["指示项附件名称"].Value) == "")
            {
                MessageBox.Show("没有附件!");
                return;
            }
            if (Convert.ToString(dataGridViewX1.CurrentRow.Cells["指示项附件名称"].Value) != "")
            {
                string zerenren = dataGridViewX1.CurrentRow.Cells["待完成指示项内容"].Value.ToString();
                string shijian  = dataGridViewX1.CurrentRow.Cells["会议时间1"].Value.ToString();
                string aa       = "Select 指示项附件类型 From tb_xiangxi Where 纪要内容='" + zerenren + "' and 会议时间='" + shijian + "'";
                string leixing  = SQLhelp.ExecuteScalar(aa, CommandType.Text).ToString();

                string mingcheng = Convert.ToString(dataGridViewX1.CurrentRow.Cells["待完成指示项内容"].Value);
                byte[] mypdffile = null;
                string sql       = "Select 指示项附件 From tb_xiangxi   Where 纪要内容='" + zerenren + "' and 会议时间='" + shijian + "'";
                mypdffile = SQLhelp.duqu(sql, CommandType.Text);
                Random ran    = new Random();
                string aaaa   = System.Environment.CurrentDirectory;
                string lujing = aaaa + "\\" + mingcheng + "." + leixing;
                dakai(mypdffile, lujing);
            }
        }
示例#6
0
        public void Reload()

        {
            string strsql = "select 用户名,权限管理,部门,序号,报告组 from tb_operator ";

            dataGridViewX2.DataSource = SQLhelp.GetDataTable(strsql, CommandType.Text);
        }
示例#7
0
        private void toolDelete_Click(object sender, EventArgs e)
        {
            if (dataGridViewX2.Rows.Count <= 0)//判断是否选中要删除的行
            {
                MessageBox.Show("请选中行");
                return;
            }
            //弹出确认删除对话框
            if (dataGridViewX2.Rows.Count > 0)
            {
                DialogResult result = MessageBox.Show("确实要删除吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    //删除选定行
                    DataGridViewRow dgvr = dataGridViewX2.CurrentRow;//获取当前选中行
                    string          code = dgvr.Cells["用户名"].Value.ToString();

                    string strSql1 = "delete from tb_operator where  用户名= '" + code + "' ";

                    string result1 = Convert.ToString(SQLhelp.ExecuteScalar(strSql1, CommandType.Text));


                    MessageBox.Show("删除成功!", "软件提示");
                }


                Reload();
            }
        }
示例#8
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            string sql1    = "select 密码 from tb_operator where 用户名='" + yonghu + "'";
            string jiumima = SQLhelp.ExecuteScalar(sql1, CommandType.Text).ToString();

            if (txtJiu.Text != jiumima)
            {
                MessageBox.Show("旧密码输入错误,请重新输入!");
                return;
            }
            else
            {
                if (txtXin.Text == txtQueren.Text)
                {
                    string sql2 = "update tb_operator set 密码='" + txtXin.Text + "' where 用户名='" + yonghu + "'";
                    SQLhelp.ExecuteScalar(sql2, CommandType.Text);
                    MessageBox.Show("密码修改成功!");
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("两次密码输入不相同,请重新输入!");
                    return;
                }
            }
        }
示例#9
0
 private void 查看附件ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (gridView1.RowCount <= 0)
     {
         MessageBox.Show("请选中行!");
         return;
     }
     if (Convert.ToString(this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "指示项附件名称")) == "")
     {
         MessageBox.Show("没有附件!");
         return;
     }
     if (Convert.ToString(this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "指示项附件名称")) != "")
     {
         string zerenren  = Convert.ToString(this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "纪要内容"));
         string shijian   = Convert.ToString(this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "会议时间"));
         string aa        = "Select 指示项附件类型 From tb_xiangxi Where 纪要内容='" + zerenren + "' and 会议时间='" + shijian + "'";
         string leixing   = SQLhelp.ExecuteScalar(aa, CommandType.Text).ToString();
         string mingcheng = Convert.ToString(this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "指示项附件名称"));
         byte[] mypdffile = null;
         string sql4      = "Select 指示项附件 From tb_xiangxi   Where 纪要内容='" + zerenren + "' and 会议时间='" + shijian + "'";
         mypdffile   = SQLhelp.duqu(sql4, CommandType.Text);
         this.Cursor = Cursors.WaitCursor;
         string     aaaa   = System.Environment.CurrentDirectory;
         string     bbbb   = mingcheng.Replace("?", "1");
         string     lujing = aaaa + "\\" + bbbb + "1" + "." + leixing;
         FileStream fs     = new FileStream(lujing, FileMode.Create);
         fs.Write(mypdffile, 0, mypdffile.Length);
         fs.Flush();
         fs.Close();
         this.Cursor = Cursors.Default;
         System.Diagnostics.Process.Start(lujing);
     }
 }
示例#10
0
        public void Reload()
        {
            string sql = "select id,会议时间,会议主题,参会人员,纪要上传人,纪要类型 from tb_xiangxi where 纪要类型='会议' ";

            DataTable dt1 = SQLhelp.GetDataTable(sql, CommandType.Text);

            DataTable table = new DataTable();

            //创建table的第一列
            DataColumn priceColumn = new DataColumn();

            //该列的数据类型
            priceColumn.DataType = System.Type.GetType("System.String");
            //该列得名称
            priceColumn.ColumnName = "会议时间";

            DataColumn taxColumn = new DataColumn();

            taxColumn.DataType   = System.Type.GetType("System.String");
            taxColumn.ColumnName = "会议主题";

            table.Columns.Add(priceColumn);
            table.Columns.Add(taxColumn);

            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                string panduan1 = dt1.Rows[i]["纪要类型"].ToString();
                if (panduan1 == "会议")
                {
                    string str = dt1.Rows[i]["参会人员"].ToString();
                    //正则表达式

                    Match m;

                    Regex r = new Regex(yonghu);

                    m = r.Match(str);
                    string panduan = m.ToString();


                    if (panduan != "")
                    {
                        DataRow dr            = table.NewRow();
                        string  huiyishijian1 = dt1.Rows[i]["会议时间"].ToString();
                        string  huiyizhuti1   = dt1.Rows[i]["会议主题"].ToString();
                        if (huiyizhuti != huiyizhuti1)
                        {
                            huiyizhuti = huiyizhuti1;
                            dr["会议时间"] = dt1.Rows[i]["会议时间"].ToString();

                            dr["会议主题"] = dt1.Rows[i]["会议主题"].ToString();

                            table.Rows.Add(dr);
                        }
                    }
                }
            }

            //个人的绑定
        }
示例#11
0
        private void 取消完成ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (gridView1.RowCount <= 0)
            {
                MessageBox.Show("请选中行!");
                return;
            }
            string zerenren     = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "完成责任人").ToString();
            string huiyishijian = textshijian.Text;
            string huiyizhuti   = textzhuti.Text;


            string chaxun = "select 纪要上传人 from tb_xiangxi  Where 完成责任人='" + zerenren + "' and 会议时间='" + huiyishijian + "'";
            string ren    = SQLhelp.ExecuteScalar(chaxun, CommandType.Text).ToString();

            if (yonghu != ren)
            {
                MessageBox.Show("无权限!");
                return;
            }

            try
            {
                string xiugai = "update tb_xiangxi set 已完成=0 Where 完成责任人='" + zerenren + "' and 会议时间='" + huiyishijian + "'";
                SQLhelp.ExecuteScalar(xiugai, CommandType.Text);
                MessageBox.Show("修改成功!");
                Reload();
            }
            catch (Exception ex)

            {
                MessageBox.Show("发生错误:" + ex.Message);
            }
        }
示例#12
0
        private void FrShangchuan_Load(object sender, EventArgs e)
        {
            string sql1 = "select 纪要内容,完成责任人 from tb_jjiyaoneirong";

            gridControl1.DataSource = SQLhelp.GetDataTable(sql1, CommandType.Text);
            string        sql8        = "select 用户名 from tb_operator  ";
            DataTable     dtttt       = SQLhelp.GetDataTable(sql8, CommandType.Text);
            List <string> spaceminute = new List <string>();

            for (int i = 0; i < dtttt.Rows.Count; i++)
            {
                string n = dtttt.Rows[i]["用户名"].ToString();
                spaceminute.Add(n);
            }

            foreach (string s in spaceminute)
            {
                repositoryItemComboBox2.Items.Add(s);
            }

            string        sql123       = "select 部门  from tb_bumen ";
            DataTable     daa          = SQLhelp.GetDataTable(sql123, CommandType.Text);
            List <string> spaceminute1 = new List <string>();

            for (int i = 0; i < daa.Rows.Count; i++)
            {
                string n = daa.Rows[i]["部门"].ToString();
                spaceminute1.Add(n);
            }

            foreach (string s in spaceminute1)
            {
                comboBoxEdit1.Properties.Items.Add(s);
            }
        }
示例#13
0
        public void Reload()
        {
            string strsql1 = "select id,会议时间,会议主题,纪要内容,落实措施,完成时间,落实情况,已完成,完成时间节点,批复,指示项附件名称,纪要上传人,纪要类型,关联责任人,考核绩效点 from tb_xiangxi  where 完成责任人='" + yonghu + "'and 已完成=0";

            gridControl1.DataSource            = SQLhelp.GetDataTable(strsql1, CommandType.Text);
            gridView1.Columns["会议时间"].Caption  = "创建时间";
            gridView1.Columns["会议主题"].Caption  = "来源";
            gridView1.Columns["纪要上传人"].Visible = false;
            gridView1.Columns["纪要类型"].Visible  = false;
            gridView1.Columns["id"].Visible    = false;
            string strsql2 = "select id,会议时间,会议主题,纪要内容,落实措施,完成时间,落实情况,已完成,完成时间节点,批复,指示项附件名称,考核绩效点,纪要类型,完成责任人,纪要上传人 from tb_xiangxi  where 完成责任人='" + yonghu + "'and 已完成=1";

            gridControl2.DataSource            = SQLhelp.GetDataTable(strsql2, CommandType.Text);
            gridView2.Columns["会议时间"].Caption  = "创建时间";
            gridView2.Columns["会议主题"].Caption  = "来源";
            gridView2.Columns["纪要上传人"].Visible = false;
            gridView2.Columns["纪要类型"].Visible  = false;
            gridView2.Columns["id"].Visible    = false;
            gridView2.Columns["完成责任人"].Visible = false;
            string strsql3 = "select id,会议时间,会议主题,纪要内容,落实措施,落实情况,完成时间,已完成,完成时间节点,批复,指示项附件名称,纪要上传人,纪要类型,关联责任人,完成责任人,更新,考核绩效点 from tb_xiangxi  where 关联责任人='" + yonghu + "'";

            gridControl3.DataSource            = SQLhelp.GetDataTable(strsql3, CommandType.Text);
            gridView3.Columns["会议时间"].Caption  = "创建时间";
            gridView3.Columns["会议主题"].Caption  = "来源";
            gridView3.Columns["纪要上传人"].Visible = false;
            gridView3.Columns["纪要类型"].Visible  = false;
            gridView3.Columns["id"].Visible    = false;
        }
示例#14
0
        private void 确认完成ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (gridView3.RowCount <= 0)
            {
                MessageBox.Show("请选中行!");
                return;
            }
            string id = Convert.ToString(this.gridView3.GetRowCellValue(this.gridView3.FocusedRowHandle, "id"));

            try
            {
                string   wanchengshijian = DateTime.Now.ToString();
                DateTime zuizhong        = DateTime.Now;
                string   jiedian         = Convert.ToString(this.gridView3.GetRowCellValue(this.gridView3.FocusedRowHandle, "完成时间节点"));
                if (jiedian == "")
                {
                    MessageBox.Show("请先让责任人输入完成时间节点,再确认完成");
                    return;
                }
                if (MessageBox.Show("确认完成吗?", "软件提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    string xiugai = "update tb_xiangxi set 已完成=1,完成时间='" + wanchengshijian + "' Where id='" + id + "'";
                    SQLhelp.ExecuteScalar(xiugai, CommandType.Text);
                    MessageBox.Show("修改成功!");
                    Reload();
                }
            }
            catch (Exception ex)

            {
                MessageBox.Show("发生错误:" + ex.Message);
            }
        }
示例#15
0
        public static bool judgedepartment(string yonghu)
        {
            bool      flag    = false;
            version   version = new version();
            string    sql     = "select * from tb_update";
            DataTable dt      = SQLhelp.GetDataTable(sql, CommandType.Text);
            string    sql1    = "select * from tb_operator where 用户名 = '" + yonghu + "'";
            DataTable dt1     = SQLhelp.GetDataTable(sql1, CommandType.Text);
            string    务器版本号   = version.getversion("zttogffice");
            string    版本号     = dt.Rows[0]["版本号"].ToString();
            string    部门      = dt.Rows[0]["部门"].ToString();
            string    人员      = dt.Rows[0]["人员"].ToString();

            if (务器版本号.Equals(版本号))
            {
                if (部门.Contains(dt1.Rows[0]["部门"].ToString()))
                {
                    flag = true;
                }
                if (人员.Contains(yonghu))
                {
                    flag = true;
                }
            }
            if (部门.Equals("全员"))
            {
                flag = true;
            }
            return(flag);
        }
示例#16
0
        private void 查看ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int dingwei = Convert.ToInt32(this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "id"));

            string shangchuanren = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "纪要上传人").ToString();

            if (shangchuanren == yonghu)
            {
                string sql1 = "update tb_xiangxi set 更新='' where id='" + dingwei + "'";
                SQLhelp.ExecuteScalar(sql1, CommandType.Text);

                Frhuifuhuiyijiyao form = new Frhuifuhuiyijiyao();
                form.yonghu  = yonghu;
                form.dingwei = dingwei;
                form.ShowDialog();
                Reload();
            }

            if (shangchuanren != yonghu)
            {
                Frhuifuhuiyijiyao form = new Frhuifuhuiyijiyao();
                form.yonghu  = yonghu;
                form.dingwei = dingwei;
                form.ShowDialog();
            }
        }
示例#17
0
        private void 保存时间ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string zerenren           = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "完成责任人").ToString();
            string neirong            = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "纪要内容").ToString();
            string shijian            = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "会议时间").ToString();
            string jiyaoshangchuanren = gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, "纪要上传人").ToString();

            if (yonghu != jiyaoshangchuanren)
            {
                MessageBox.Show("无权限!");
                return;
            }
            try
            {
                for (int i = 0; i < gridView1.RowCount; i++)
                {
                    string id             = gridView1.GetRowCellValue(i, "id").ToString();
                    string shiijandianjie = gridView1.GetRowCellValue(i, "完成时间节点").ToString();
                    if (shiijandianjie != "")
                    {
                        string sql2 = "update tb_xiangxi  set 完成时间节点= '" + Convert.ToDateTime(shiijandianjie) + "' where id= '" + id + "'";

                        SQLhelp.ExecuteScalar(sql2, CommandType.Text);
                    }
                }
                MessageBox.Show("修改成功!");
                Reload();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#18
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            string aaa = "Select 附件名称 From tb_xiangxi Where 完成责任人='" + zerenren + "' and 会议时间='" + shijian + "'";

            mingcheng = SQLhelp.ExecuteScalar(aaa, CommandType.Text).ToString();
            byte[] mypdffile = null;

            string sql = "Select 附件 From tb_xiangxi  Where 完成责任人='" + zerenren + "' and 会议时间='" + shijian + "'";

            mypdffile = SQLhelp.duqu(sql, CommandType.Text);
            try
            {
                Random ran = new Random();

                string aaaa = System.Environment.CurrentDirectory;
                lujing = aaaa + "\\" + mingcheng + "." + leixing;
                FileStream fs = new FileStream(lujing, FileMode.Create);
                fs.Write(mypdffile, 0, mypdffile.Length);
                fs.Flush();
                fs.Close();
            }
            catch { }

            System.Diagnostics.Process.Start(lujing);
        }
示例#19
0
        private void 批复ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridViewX1.Rows.Count <= 0)//判断是否选中要删除的行
            {
                MessageBox.Show("请选中行");
                return;
            }

            string zerenren = dataGridViewX1.CurrentRow.Cells["完成责任人"].Value.ToString();
            string neirong  = dataGridViewX1.CurrentRow.Cells["待完成指示项内容"].Value.ToString();
            string shijian  = dataGridViewX1.CurrentRow.Cells["会议时间1"].Value.ToString();


            string sql           = "select 纪要上传人 from tb_xiangxi  where   会议时间='" + shijian + "' and 完成责任人='" + zerenren + "' and 纪要类型='指示项'";
            string shangchuanren = SQLhelp.ExecuteScalar(sql, CommandType.Text).ToString();


            if (yonghu != shangchuanren)
            {
                MessageBox.Show("非指示项发起人无权限批复!");
                return;
            }

            FrZhishixiangpifu form = new FrZhishixiangpifu();

            form.zerenren = zerenren;
            form.shijian  = shijian;
            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                reload1();
            }
        }
示例#20
0
        private void 保存时间ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string zerenren           = dataGridViewX2.CurrentRow.Cells["完成责任人"].Value.ToString();
            string neirong            = dataGridViewX2.CurrentRow.Cells["纪要内容"].Value.ToString();
            string shijian            = dataGridViewX2.CurrentRow.Cells["会议时间"].Value.ToString();
            string jiyaoshangchuanren = dataGridViewX2.CurrentRow.Cells["纪要上传人"].Value.ToString();

            if (yonghu != jiyaoshangchuanren)
            {
                MessageBox.Show("无权限!");
                return;
            }
            try
            {
                for (int i = 0; i < dataGridViewX2.Rows.Count; i++)
                {
                    string id             = dataGridViewX2.Rows[i].Cells["id"].Value.ToString();
                    string shiijandianjie = dataGridViewX2.Rows[i].Cells["完成时间节点"].Value.ToString();
                    if (shiijandianjie != "")
                    {
                        string sql2 = "update tb_xiangxi  set 完成时间节点= '" + Convert.ToDateTime(shiijandianjie) + "' where id= '" + id + "'";

                        SQLhelp.ExecuteScalar(sql2, CommandType.Text);
                    }
                }
                MessageBox.Show("修改成功!");
                Reload();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#21
0
        private void 查看附件ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridViewX1.Rows.Count <= 0)
            {
                MessageBox.Show("请选中行!");
                return;
            }
            string zerenren = dataGridViewX1.CurrentRow.Cells["完成责任人"].Value.ToString();
            string neirong  = dataGridViewX1.CurrentRow.Cells["纪要内容"].Value.ToString();
            string shijian  = dataGridViewX1.CurrentRow.Cells["会议时间1"].Value.ToString();
            string aa       = "Select 附件格式 From tb_xiangxi Where 完成责任人='" + zerenren + "' and 纪要内容='" + neirong + "' and 会议时间='" + shijian + "'";
            string leixing  = SQLhelp.ExecuteScalar(aa, CommandType.Text).ToString();
            string panduan  = SQLhelp.ExecuteScalar(aa, CommandType.Text).ToString();

            if (panduan == "")
            {
                MessageBox.Show("没有附件!");
                return;
            }


            string aaa       = "Select 附件名称 From tb_xiangxi Where 完成责任人='" + zerenren + "' and 纪要内容='" + neirong + "' and 会议时间='" + shijian + "'";
            string mingcheng = SQLhelp.ExecuteScalar(aaa, CommandType.Text).ToString();

            byte[] mypdffile = null;
            string ConStr    = "Data Source=10.15.1.252;Initial Catalog=db_office;user id=sa;password=zttZTT123";

            SqlConnection con = new SqlConnection(ConStr);
            SqlCommand    cmd = new SqlCommand("", con);

            cmd.CommandText = "Select 附件 From tb_xiangxi  Where 完成责任人='" + zerenren + "'  and 纪要内容='" + neirong + "' and 会议时间='" + shijian + "'";
            con.Open();

            SqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                mypdffile = (byte[])dr.GetValue(0);
            }
            con.Close();
            this.Cursor = Cursors.WaitCursor;

            try
            {
                Random ran = new Random();

                string aaaa = System.Environment.CurrentDirectory;
                lujing = aaaa + "\\" + mingcheng + "." + leixing;
                FileStream fs = new FileStream(lujing, FileMode.Create);
                fs.Write(mypdffile, 0, mypdffile.Length);
                fs.Flush();
                fs.Close();
            }
            catch { }
            this.Cursor = Cursors.Default;

            System.Diagnostics.Process.Start(lujing);
        }
示例#22
0
        private void Form1_Load(object sender, EventArgs e)
        {
            String versionlocal = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            label3.Text = versionlocal;
            version version = new version();
            getData getData = new getData();

            getData.getiprouter();
            //if (version.judgeversion(versionlocal) == true)
            //{
            //    this.Close();
            //    downloadexe downloadexe = new downloadexe();
            //    downloadexe.Show();
            //}
            //else
            //{
            System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName("ztoffice"); //获取指定的进程名
            if (myProcesses.Length > 1)                                                                           //如果可以获取到知道的进程名则说明已经启动
            {
                MessageBox.Show("程序已启动!");
                Application.Exit();              //关闭系统
            }

            this.txtZerenren1.Text = Properties.Settings.Default.name;
            bool flag = Properties.Settings.Default.isrem;

            if (flag)
            {
                string sql_pass = "******" + txtZerenren1.Text.Trim() + "'";
                String password = Convert.ToString(SQLhelp.ExecuteScalar(sql_pass, CommandType.Text));
                this.checkbox1.Checked = true;
                this.txtPwd.Text       = password;
            }

            string    sql  = "select 用户名 from tb_operator";
            DataTable aaaa = SQLhelp.GetDataTable(sql, CommandType.Text);


            List <string> spaceminute = new List <string>();

            for (int i = 0; i < aaaa.Rows.Count; i++)
            {
                string n = aaaa.Rows[i]["用户名"].ToString();
                spaceminute.Add(n);
            }


            foreach (string s in spaceminute)
            {
                //comboBox1.Items.Add(s);
            }
            //}
        }
示例#23
0
        private void Formzhujiemian_Load(object sender, EventArgs e)
        {
            //labelX2.Text = "欢迎你!" + yonghu;

            string sql = "select 权限管理 from tb_operator where 用户名='" + yonghu + "'";

            if (Convert.ToInt32(SQLhelp.ExecuteScalar(sql, CommandType.Text)) == 0)
            {
                appViewTile.Visible = false;
                Formchaxunxiangxi f = new Formchaxunxiangxi();
            }
        }
示例#24
0
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            string strSql11 = "select 接收人分组 from tb_operator  where  用户名='" + yonghu + "' ";
            string fenzu    = SQLhelp.ExecuteScalar(strSql11, CommandType.Text).ToString();

            if (fenzu == "")
            {
                MessageBox.Show("请先设置接收人分组!");
                return;
            }

            textBox1.Text = fenzu;
        }
示例#25
0
        private void 查看详情ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridViewX1.Rows.Count <= 0)//判断是否选中要删除的行
            {
                MessageBox.Show("请选中行!");
                return;
            }

            string a = dataGridViewX1.CurrentRow.Cells["公告标题"].Value.ToString();

            string aa = "Select 公告附件类型 From tb_gonggao Where 公告标题='" + a + "'";

            leixing = SQLhelp.ExecuteScalar(aa, CommandType.Text).ToString();
            string panduan = SQLhelp.ExecuteScalar(aa, CommandType.Text).ToString();

            if (panduan == "")
            {
                MessageBox.Show("该公告没有附件!");
                return;
            }

            string sqll = "Select 公告附件类型 From tb_gonggao Where 公告标题='" + a + "'";

            leixing = SQLhelp.ExecuteScalar(sqll, CommandType.Text).ToString();



            byte[] mypdffile = null;

            string sql = "Select 公告附件 From tb_gonggao Where 公告标题='" + a + "' and  公告类型='公告'";

            mypdffile = SQLhelp.duqu(sql, CommandType.Text);

            try
            {
                Random ran = new Random();
                //int RandKey = ran.Next(0, 999999999);
                //string suijishu = RandKey.ToString();
                string aaaa = System.Environment.CurrentDirectory;
                lujing = aaaa + "\\" + a + "." + leixing;
                FileStream fs = new FileStream(lujing, FileMode.Create);
                fs.Write(mypdffile, 0, mypdffile.Length);
                fs.Flush();
                fs.Close();
            }
            catch { }
            this.Cursor = Cursors.Default;

            System.Diagnostics.Process.Start(lujing);
        }
示例#26
0
        private void 确认完成ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridViewX1.Rows.Count <= 0)
            {
                MessageBox.Show("请选中行!");
                return;
            }
            string zerenren = dataGridViewX1.CurrentRow.Cells["完成责任人"].Value.ToString();
            string neirong  = dataGridViewX1.CurrentRow.Cells["待完成指示项内容"].Value.ToString();
            string shijian  = dataGridViewX1.CurrentRow.Cells["会议时间1"].Value.ToString();


            string chaxun = "select 纪要上传人 from tb_xiangxi  Where 完成责任人='" + zerenren + "' and 会议时间='" + shijian + "' and 纪要内容='" + neirong + "'";
            string ren    = SQLhelp.ExecuteScalar(chaxun, CommandType.Text).ToString();

            if (yonghu != ren)
            {
                MessageBox.Show("无权限!");
                return;
            }

            try
            {
                string   wanchengshijian = DateTime.Now.ToString();
                DateTime zuizhong        = DateTime.Now;
                string   jiedian         = dataGridViewX1.CurrentRow.Cells["完成时间节点2"].Value.ToString();
                if (jiedian == "")
                {
                    MessageBox.Show("请先让责任人输入完成时间节点,再确认完成");
                    return;
                }
                if (MessageBox.Show("确认完成吗?", "软件提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    string xiugai = "update tb_xiangxi set 已完成=1,完成时间='" + wanchengshijian + "' Where 完成责任人='" + zerenren + "' and 会议时间='" + shijian + "' and 纪要内容='" + neirong + "'";
                    SQLhelp.ExecuteScalar(xiugai, CommandType.Text);
                    MessageBox.Show("修改成功!");
                    reload1();
                    Reload();
                    reload2();
                }
            }

            catch (Exception ex)

            {
                MessageBox.Show("发生错误:" + ex.Message);
            }
        }
示例#27
0
        private void  载toolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (gridView2.RowCount <= 0)//判断是否选中要删除的行
            {
                MessageBox.Show("请选中行!");
                return;
            }
            FolderBrowserDialog lujingg = new FolderBrowserDialog();

            if (lujingg.ShowDialog() == DialogResult.OK)

            {
                string xuanzelujing  = lujingg.SelectedPath;
                string yonghu        = gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "员工姓名").ToString();
                string baogaoleixing = gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "报告类型").ToString();
                string shijian       = gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "提交时间").ToString();
                string jingque       = shijian.Substring(0, 10);
                try
                {
                    byte[] mypdffile = null;
                    string ConStr    = "Select 文件,员工姓名,日期 From tb_wenjian Where 员工姓名='" + yonghu + "'and 提交时间='" + shijian + "' and 报告类型='" + baogaoleixing + "'";



                    mypdffile = SQLhelp.duqu(ConStr, CommandType.Text);
                    string dt1       = "Select 员工姓名 From tb_wenjian Where 员工姓名='" + yonghu + "'and 提交时间='" + shijian + "' and 报告类型='" + baogaoleixing + "'";
                    string mingcheng = SQLhelp.ExecuteScalar(dt1, CommandType.Text).ToString();

                    string dt2      = "Select 日期 From tb_wenjian Where 员工姓名='" + yonghu + "'and 提交时间='" + shijian + "' and 报告类型='" + baogaoleixing + "'";
                    string shijian1 = SQLhelp.ExecuteScalar(dt2, CommandType.Text).ToString();

                    string     lujing = xuanzelujing + "\\" + mingcheng + shijian1 + baogaoleixing + ".doc";
                    FileStream fs     = new FileStream(lujing, FileMode.Create);
                    fs.Write(mypdffile, 0, mypdffile.Length);
                    fs.Flush();
                    fs.Close();


                    MessageBox.Show("下载成功");//显示异常信息
                }


                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);//显示异常信息
                }
            }
        }
示例#28
0
        private void buttonX2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认提交吗?", "软件提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                string    quorysql      = "select * from tb_xiangxi where id='" + id + "'";
                DataTable dt1           = SQLhelp.GetDataTable(quorysql, CommandType.Text);
                string    纪要内容          = dt1.Rows[0]["纪要内容"].ToString();
                string    纪要类型          = dt1.Rows[0]["纪要类型"].ToString();
                string    shangchuanren = dt1.Rows[0]["纪要上传人"].ToString();
                //string message = 纪要类型+"纪要内容:" + 纪要内容 + ","+yonghu+"已回复,请查看";
                //NetWork3J NetWork3J = new NetWork3J(yonghu, "http://" + MyGlobal.ip + ":81/");
                //NetWork3J.sendmessageById(shangchuanren, message);
                try
                {
                    if (txtName.Text != "")
                    {
                        DateTime shijian = DateTime.Now;
                        string   sql1    = "insert into tb_huiyi (落实措施,落实情况,定位,创建人,创建时间,附件格式,附件名称,附件) values('" + txtluoshicuoshi.Text + "','" + txtluoshiqingkuang.Text + "','" + id + "','" + yonghu + "','" + shijian + "','" + fileType + "','" + fileName + "',@pic)";
                        SQLhelp.ExecuteNonquery(sql1, CommandType.Text, files);

                        string sql2 = "Select id from tb_huiyi where 落实措施='" + txtluoshicuoshi.Text + "' and 落实情况='" + txtluoshiqingkuang.Text + "' and 创建人='" + yonghu + "' and 创建时间='" + shijian + "'";
                        SQLhelp.ExecuteScalar(sql2, CommandType.Text);

                        string sql = "update tb_xiangxi set 落实措施='" + txtluoshicuoshi.Text + "',落实情况='" + txtluoshiqingkuang.Text + "',更新='有更新!'    where id='" + id + "'";
                        SQLhelp.ExecuteScalar(sql, CommandType.Text);
                        MessageBox.Show("提交成功!", "软件提示");
                        DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    if (txtName.Text == "")
                    {
                        DateTime shijian = DateTime.Now;
                        string   sql1    = "insert into tb_huiyi (落实措施,落实情况,定位,创建人,创建时间) values('" + txtluoshicuoshi.Text + "','" + txtluoshiqingkuang.Text + "','" + id + "','" + yonghu + "','" + shijian + "')";
                        SQLhelp.ExecuteScalar(sql1, CommandType.Text);
                        string sql = "update tb_xiangxi set 落实措施='" + txtluoshicuoshi.Text + "',落实情况='" + txtluoshiqingkuang.Text + "',更新='有更新!'    where id='" + id + "'";
                        SQLhelp.ExecuteScalar(sql, CommandType.Text);
                        MessageBox.Show("提交成功!", "软件提示");
                        DialogResult = DialogResult.OK;
                        this.Close();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("提交 " + fileName + " 时候发生了  " + ex.Message);
                }
            }
        }
示例#29
0
        private void FrShangchuan_Load(object sender, EventArgs e)
        {
            string    sql  = "select 部门 from tb_bumen";
            DataTable aaaa = SQLhelp.GetDataTable(sql, CommandType.Text);


            List <string> spaceminute = new List <string>();

            for (int i = 0; i < aaaa.Rows.Count; i++)
            {
                string n = aaaa.Rows[i]["部门"].ToString();
                spaceminute.Add(n);
            }

            foreach (string s in spaceminute)
            {
                comboBox1.Items.Add(s);
            }

            DataGridViewComboBoxExColumn column = new DataGridViewComboBoxExColumn();

            column.Name             = "完成责任人";
            column.DataPropertyName = "用户名";
            column.HeaderText       = "完成责任人";
            column.DropDownStyle    = ComboBoxStyle.DropDownList;

            this.dataGridViewX1.Columns.Add(column);
            string    sql1  = "select 用户名 from tb_operator";
            DataTable aaaaa = SQLhelp.GetDataTable(sql1, CommandType.Text);

            List <string> spaceminute1 = new List <string>();

            for (int i = 0; i < aaaaa.Rows.Count; i++)
            {
                string n = aaaaa.Rows[i]["用户名"].ToString();
                spaceminute1.Add(n);
            }

            foreach (string s in spaceminute1)
            {
                column.Items.Add(s);
            }
        }
示例#30
0
        private void 一键下载toolStripMenuItem_Click(object sender, EventArgs e)
        {
            string sql = "select 权限管理 from tb_operator where 用户名='" + yonghu + "'";

            if (Convert.ToInt32(SQLhelp.ExecuteScalar(sql, CommandType.Text)) == 0)
            {
                MessageBox.Show("无权限!");
                return;
            }
            if (gridView2.RowCount <= 0)
            {
                MessageBox.Show("请选中行!");
                return;
            }
            FrDetails form1 = new FrDetails();

            form1.yonghu = yonghu;
            form1.ShowDialog();
        }