Esempio n. 1
0
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        String[] v_uids = this.txtuids.Value.Split(',');
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                Hyoa_wjcd.ID = v_uids[i];
                Hyoa_wjcd.Delete();

                //生成删除日志 start
                string ls_oppcontent = "工作联系单(收到的);文档ID:" + v_uids[i] + "被删除。";
                HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
                Hyoa_log.ID = System.Guid.NewGuid().ToString();
                Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];
                }
                Hyoa_log.hy_oppip = userip;
                Hyoa_log.hy_opptype = "删除";
                Hyoa_log.hy_oppcontent = ls_oppcontent;
                Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
                Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
                Hyoa_log.Insert();
                //生成删除日志end
            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
     String[] v_uids = this.txtuids.Value.Split(',');
     for (var i = 0; i < v_uids.Length; i++)
     {
         if (v_uids[i] != "")
         {
             Hyoa_wjcd.ID = v_uids[i];
             Hyoa_wjcd.Delete();
         }
     }
     this.txtuids.Value = "";
     //DataPlay(1);
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
Esempio n. 3
0
    private void DataPlay()
    {
        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();
        }
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        DataTable dt = Hyoa_wjcd.Getdoc(this.txtid.Value);
        if (dt.Rows.Count > 0)
        {
            this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
            this.txtid.Value = dt.Rows[0]["ID"].ToString();

            this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.txtfsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.txtfrsname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
            this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
            this.lblhy_title.Text = dt.Rows[0]["hy_title"].ToString();
            this.ddlhy_foldername.Text = dt.Rows[0]["hy_foldername"].ToString();

            if (dt.Rows[0]["hy_jzsj"] == System.DBNull.Value)
            {
                this.jzsj.Text = "";
            }
            else
            {
                if (System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString() == "1900-1-1")
                {
                    this.jzsj.Text = "";
                }
                else
                {
                    this.jzsj.Text = System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString();
                }
            }
            //附件
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
            if (dt_fileatt.Rows.Count > 0)
            {
                string ls_temp = "";
                for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                {
                    ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                }
                this.lblhy_field2.Text = ls_temp;
            }

            //回复附件
            DataTable dt_fileatt2 = Hyoa_fileatt.GetfileattByFatherid(this.txtid.Value);
            if (dt_fileatt2.Rows.Count > 0)
            {
                string ls_temp = "";
                for (var j = 0; j < dt_fileatt2.Rows.Count; j++)
                {
                    ls_temp += (j + 1).ToString() + "、<a href='/" + dt_fileatt2.Rows[j]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt2.Rows[j]["hy_filename"].ToString() + "</a><br />";
                }
                this.lblhy_field3.Text = ls_temp;
            }
            this.lblhy_content1.Text = dt.Rows[0]["hy_body"].ToString();

            //判断是否已回复
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string lshfsql = "select * from hyp_gzlxdhf where hy_jsrdocid='" + this.txtid.Value + "' ";
            DataTable dt_hf = Hyoa_global.GetDataTable(lshfsql);
            if (dt_hf.Rows.Count > 0)
            {
                this.txthfnr.Text = dt_hf.Rows[0]["hy_body"].ToString();
                this.btn_submit.Visible = false;
            }
            else
            {
                this.txthfnr.Text = "已收到。";
            }
        }
    }
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        String[] v_uids = this.txtuids.Value.Split(',');
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {

                HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                string ls_fssql = "select * from hyp_wjcd where hy_type='发件' and ID='" + v_uids[i] + "' ";
                DataTable dt_fs = Hyoa_global.GetDataTable(ls_fssql);
                if (dt_fs.Rows.Count > 0)
                {
                    //得到属于此发件的所有收件
                    string ls_sjsql = "select * from hyp_wjcd where hy_type='收件' and DOCID='" + dt_fs.Rows[0]["DOCID"].ToString() + "' ";
                    DataTable dt_sj = Hyoa_global.GetDataTable(ls_sjsql);
                    if (dt_sj.Rows.Count > 0)
                    {
                        for (var j = 0; j < dt_sj.Rows.Count; j++)
                        {
                            //删除文档时将收件人的待办事宜删除start
                            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                            Hyoa_dbsy.DOCID = dt_sj.Rows[j]["ID"].ToString();
                            Hyoa_dbsy.Deletebydocid(dt_sj.Rows[j]["ID"].ToString());
                            //删除文档时将收件人的待办事宜删除end
                            //删除文档时将收件删除start
                            string ls_sjdel = "delete from hyp_wjcd where ID='" + dt_sj.Rows[j]["ID"].ToString() + "' ";
                            Hyoa_global.ExcuteSQL(ls_sjdel);
                            //删除文档时将收件删除end
                        }
                    }

                }

                Hyoa_wjcd.ID = v_uids[i];
                Hyoa_wjcd.Delete();

                //生成删除日志 start
                string ls_oppcontent = "工作联系单(已发送的);文档ID:" + v_uids[i] + "被删除。同时该工作联系单的所有收件已删除。";
                HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
                Hyoa_log.ID = System.Guid.NewGuid().ToString();
                Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];
                }
                Hyoa_log.hy_oppip = userip;
                Hyoa_log.hy_opptype = "删除";
                Hyoa_log.hy_oppcontent = ls_oppcontent;
                Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
                Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
                Hyoa_log.Insert();
                //生成删除日志end
            }

        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
    private void DataPlay(int PageNo)
    {
        string ls_sql = "";
        if (hy_datetime_s.Value != "")
            ls_sql += " and left(CONVERT(varchar, hy_datetime, 120 ) ,10) >= '" + hy_datetime_s.Value + "'";

        if (hy_datetime_e.Value != "")
            ls_sql += " and left(CONVERT(varchar, hy_datetime, 120 ) ,10) <= '" + hy_datetime_e.Value + "'";

        //if (ddlhy_foldername.SelectedValue != "")
        //    ls_sql += " and hy_foldername = '" + ddlhy_foldername.SelectedValue + "'";

        if (hy_title.Value != "")
            ls_sql += " and hy_title like '%" + hy_title.Value + "%'";

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();

        DataTable dt;
        dt = Hyoa_wjcd.Getdocs_fs_all(Session["hyuid"].ToString(), "发件", "已发送", ls_sql);

        DataTable tempTable = dt.Clone();
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }

        int TotalRecord = dt.Rows.Count;
        this.sumts.Text = TotalRecord.ToString();
        this.sumts2.Text = TotalRecord.ToString();
        this.ShowTotalRecord.Text = TotalRecord.ToString();
        //计算及显示总页数
        int TotalPage;
        if (TotalRecord < System.Int32.Parse(PageSize.Text))
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0)
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1;

            }
            else
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text);

            }
        }
        this.ShowTotalPage.Text = TotalPage.ToString();
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }
Esempio n. 6
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "发送成功!";

        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string ls_insert = "";
        string ls_update = "";
        //取提醒方式
        string ls_txfs = "";
        CheckBoxList txfs = (CheckBoxList)this.FindControl("txfs");
        foreach (ListItem li in txfs.Items)
        {
            if (li.Selected)
            {
                if (li.Selected) ls_txfs += li.Value + ",";
            }
        }
        ls_txfs = ls_txfs.TrimEnd(',');

        //发送
        if (this.txtwhichoperation.Value == "1")
        {
            string[] lv_jsrid = this.txthy_jsrid.Text.Split('+');
            string[] lv_jsrname = this.txthy_jsrname.Value.Split('+');
            for (var i = 0; i < lv_jsrid.Length; i++)
            {
                if (lv_jsrid[i] != "")
                {
                    string ls_id = Hyoa_global.GetRandom();
                    ls_insert = "insert into hyp_wjcd (ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_jsrname";
                    ls_insert += ",hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_status,hy_jzsj";
                    ls_insert += ",hy_txfs,hy_ifyhf,hy_txstatus) values ('" + ls_id + "','" + this.txtdocid.Value + "','收件','" + this.ddlhy_foldername.Text + "'";
                    ls_insert += ",'" + this.lblhy_fsrid.Text + "','" + this.lblhy_fsrname.Text + "','" + lv_jsrid[i].ToString() + "'";
                    ls_insert += ",'" + lv_jsrname[i].ToString() + "','" + this.txthy_title.Text + "','" + this.hy_content1.Value + "'";
                    ls_insert += ",'" + System.DateTime.Now.ToString() + "','','','','','','已发送','" + this.jzsj.Value + "','" + ls_txfs + "','0','0')";
                    Hyoa_global.ExcuteSQL(ls_insert);
                    //发送待办事宜提醒
                    HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                    Hyoa_global.Senddbsy_global(ls_id, lv_jsrid[i].ToString(), lv_jsrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "wjcd/main_read.aspx?id=" + ls_id + "&pop=1", "待阅", "Mudelwjcd", "待办箱", "一般", this.txthy_title.Text, "请阅读", 0, "", "", "");
                    //发送即时通讯提醒
                    Hyoa_global.Sendjstx_global(ls_id, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_jsrid[i].ToString(), lv_jsrname[i].ToString(), "Mudelwjcd", this.txthy_title.Text, 0, "");
                }
            }
            //发送的同时,则保存一份
            if (this.txtop.Value == "add")
            {
                ls_insert = "insert into hyp_wjcd (ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_jsrname";
                ls_insert += ",hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_status,hy_jzsj";
                ls_insert += ",hy_txfs,hy_ifyhf,hy_txstatus) values ('" + Hyoa_global.GetRandom() + "','" + this.txtdocid.Value + "','发件','" + this.ddlhy_foldername.Text + "'";
                ls_insert += ",'" + this.lblhy_fsrid.Text + "','" + this.lblhy_fsrname.Text + "','" + this.txthy_jsrid.Text + "'";
                ls_insert += ",'" + this.txthy_jsrname.Value + "','" + this.txthy_title.Text + "','" + this.hy_content1.Value + "'";
                ls_insert += ",'" + System.DateTime.Now.ToString() + "','" + this.ddlifsavetofjx.SelectedValue + "','','','',''";
                ls_insert += ",'已发送','" + this.jzsj.Value + "','" + ls_txfs + "','0','0')";
                Hyoa_global.ExcuteSQL(ls_insert);
            }
            else
            {
                string ls_id = this.txtid.Value;
                Hyoa_wjcd.ID = ls_id;
                this.txtid.Value = ls_id;

                ls_update = "update hyp_wjcd set DOCID='" + this.txtdocid.Value + "',hy_type='发件',hy_foldername='" + this.ddlhy_foldername.Text + "'";
                ls_update += ",hy_fsrid='" + this.lblhy_fsrid.Text + "',hy_fsrname='" + this.lblhy_fsrname.Text + "',hy_jsrid='" + this.txthy_jsrid.Text + "'";
                ls_update += ",hy_jsrname='" + this.txthy_jsrname.Value + "',hy_title='" + this.txthy_title.Text + "',hy_body='" + this.hy_content1.Value + "'";
                ls_update += ",hy_datetime='" + System.DateTime.Now.ToString() + "',hy_ifsavetofjx='" + this.ddlifsavetofjx.SelectedValue + "',hy_status='已发送'";
                ls_update += ",hy_jzsj='" + this.jzsj.Value + "',hy_txfs='" + ls_txfs + "' where ID= '" + ls_id + "' ";
                Hyoa_global.ExcuteSQL(ls_update);
                ls_tip = "保存成功!";
            }

            this.txturl.Value = "list_wjcd_yfs.aspx?mid=" + this.txtmudelid.Value + "&tableid=";     //返回URL
        }

        //保存
        if (this.txtwhichoperation.Value == "2")
        {
            if (this.txtop.Value == "add")
            {
                string ls_id = this.txtdocid.Value;
                Hyoa_wjcd.ID = ls_id;
                this.txtid.Value = ls_id;
                Hyoa_wjcd.DOCID = this.txtdocid.Value;
                Hyoa_wjcd.hy_type = "发件";
                Hyoa_wjcd.hy_foldername = this.ddlhy_foldername.Text;
                Hyoa_wjcd.hy_fsrid = this.lblhy_fsrid.Text;
                Hyoa_wjcd.hy_fsrname = this.lblhy_fsrname.Text;
                Hyoa_wjcd.hy_jsrid = this.txthy_jsrid.Text;
                Hyoa_wjcd.hy_jsrname = this.txthy_jsrname.Value;
                Hyoa_wjcd.hy_title = this.txthy_title.Text;
                Hyoa_wjcd.hy_body = this.hy_content1.Value;
                Hyoa_wjcd.hy_datetime = System.DateTime.Now.ToString();
                Hyoa_wjcd.hy_ifsavetofjx = this.ddlifsavetofjx.SelectedValue;
                Hyoa_wjcd.hy_yxj = "";
                Hyoa_wjcd.hy_yjbg = "";
                Hyoa_wjcd.hy_zycd = "";
                Hyoa_wjcd.hy_hz = "";
                Hyoa_wjcd.hy_status = "未发送";
                Hyoa_wjcd.Insert();
                ls_tip = "保存成功!";
            }
            else
            {
                string ls_id = this.txtid.Value;
                Hyoa_wjcd.ID = ls_id;
                this.txtid.Value = ls_id;
                Hyoa_wjcd.DOCID = this.txtdocid.Value;
                Hyoa_wjcd.hy_type = "发件";
                Hyoa_wjcd.hy_foldername = this.ddlhy_foldername.Text;
                Hyoa_wjcd.hy_fsrid = this.lblhy_fsrid.Text;
                Hyoa_wjcd.hy_fsrname = this.lblhy_fsrname.Text;
                Hyoa_wjcd.hy_jsrid = this.txthy_jsrid.Text;
                Hyoa_wjcd.hy_jsrname = this.txthy_jsrname.Value;
                Hyoa_wjcd.hy_title = this.txthy_title.Text;
                Hyoa_wjcd.hy_body = this.hy_content1.Value;
                Hyoa_wjcd.hy_datetime = System.DateTime.Now.ToString();
                Hyoa_wjcd.hy_ifsavetofjx = this.ddlifsavetofjx.SelectedValue;
                Hyoa_wjcd.hy_yxj = "";
                Hyoa_wjcd.hy_yjbg = "";
                Hyoa_wjcd.hy_zycd = "";
                Hyoa_wjcd.hy_hz = "";
                Hyoa_wjcd.hy_status = "未发送";
                Hyoa_wjcd.Update();
                ls_tip = "保存成功!";
            }
            this.txturl.Value = "list_wjcd_wfs.aspx?mid=" + this.txtmudelid.Value + "&tableid=";     //返回URL
        }

        //处理完成后的提示及跳转(增加刷新附件功能)
        if (this.txtifsxfj.Text == "1")
        {
            Response.Write("<script>window.location='main_wjcd.aspx?op=modify&mid=" + this.txtmudelid.Value + "&id=" + this.txtid.Value + "&url=" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
    }
Esempio n. 7
0
    private void DataPlay()
    {
        //加载文件分类
        HyoaClass.Hyoa_wjcd_class Hyoa_wjcd_class = new HyoaClass.Hyoa_wjcd_class();
        DataTable dt_class = Hyoa_wjcd_class.Getdocs();
        ddlhy_foldername.DataTextField = "ClassName";
        ddlhy_foldername.DataSource = dt_class;
        ddlhy_foldername.DataBind();
        this.ddlhy_foldername.Items.Insert(0, new ListItem("--请选择--", ""));

        //新文档
        if (this.txtop.Value == "add")
        {
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            this.txtdocid.Value = Hyoa_global.GetRandom();
            this.lblhy_fsrid.Text = Session["hyuid"].ToString();
            this.lblhy_fsrname.Text = Session["hyuname"].ToString();
            this.lblhy_datetime.Text = System.DateTime.Now.ToString();
            //如果是回复
            if (this.Request.QueryString["fhid"] != null)
            {
                HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
                DataTable dt = Hyoa_wjcd.Getdoc(this.Request.QueryString["fhid"].ToString());
                if (dt.Rows.Count > 0)
                {
                    this.txthy_jsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                    this.txthy_jsrname.Value = dt.Rows[0]["hy_fsrname"].ToString();
                    this.txthy_title.Text = "回复:"+dt.Rows[0]["hy_title"].ToString();
                }
            }
            //如果是转发
            if (this.Request.QueryString["zfid"] != null)
            {
                HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
                DataTable dt = Hyoa_wjcd.Getdoc(this.Request.QueryString["zfid"].ToString());
                if (dt.Rows.Count > 0)
                {
                    this.txthy_title.Text = "转发:" + dt.Rows[0]["hy_title"].ToString();
                    this.hy_content1.Value = dt.Rows[0]["hy_body"].ToString();
                    this.txtdocid.Value = dt.Rows[0]["docid"].ToString();

                    //附件
                    HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                    DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[0]["DOCID"].ToString());
                    if (dt_fileatt.Rows.Count > 0)
                    {
                        string ls_temp = "";
                        for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                        {
                            ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                        }
                        this.lblhy_field2.Text = ls_temp;

                    }
                }
                this.uploadhy_field2.Visible = false;

                this.jzsjtxfs.Visible = false;
            }
        }
        else
        {
            if (this.Request.QueryString["id"] != null)
            {
                this.txtid.Value = this.Request.QueryString["id"].ToString();
            }
            HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
            DataTable dt = Hyoa_wjcd.Getdoc(this.txtid.Value);
            if (dt.Rows.Count > 0)
            {
                this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
                this.txtid.Value = dt.Rows[0]["ID"].ToString();

                this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
                this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
                this.txthy_jsrname.Value = dt.Rows[0]["hy_jsrname"].ToString();
                this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
                this.txthy_title.Text = dt.Rows[0]["hy_title"].ToString();

                //附件
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
                if (dt_fileatt.Rows.Count > 0)
                {
                    string ls_temp = "";
                    for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                    {
                        ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                    }
                    this.lblhy_field2.Text = ls_temp;
                }

                this.hy_content1.Value = dt.Rows[0]["hy_body"].ToString();
                this.ddlifsavetofjx.SelectedValue = dt.Rows[0]["hy_ifsavetofjx"].ToString();
                this.ddlhy_foldername.SelectedValue = dt.Rows[0]["hy_foldername"].ToString();

            }
        }
    }
    private void DataPlay()
    {
        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();
        }
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        DataTable dt = Hyoa_wjcd.Getdoc(this.txtid.Value);
        if (dt.Rows.Count > 0)
        {
            this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
            this.txtid.Value = dt.Rows[0]["ID"].ToString();

            this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
            this.txthy_jsrname.Text = dt.Rows[0]["hy_jsrname"].ToString();
            this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
            this.txthy_title.Text = dt.Rows[0]["hy_title"].ToString();
            this.ddlhy_foldername.Text = dt.Rows[0]["hy_foldername"].ToString();
            if (dt.Rows[0]["hy_jzsj"] == System.DBNull.Value)
            {
                this.jzsj.Text = "";
            }
            else
            {
                if (System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString() == "1900-1-1")
                {
                    this.jzsj.Text = "";
                }
                else
                {
                    this.jzsj.Text = System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString();
                }
            }
            if (dt.Rows[0]["hy_txfs"] == System.DBNull.Value)
            {
                this.txfs.Text = "";
            }
            else
            {
                this.txfs.Text = dt.Rows[0]["hy_txfs"].ToString();
            }
            //附件
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
            if (dt_fileatt.Rows.Count > 0)
            {
                string ls_temp = "";
                for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                {
                    string ls_path = dt_fileatt.Rows[i]["hy_filepath"].ToString();
                    ls_path = ls_path.Replace("+","%2B");
                    ls_temp += (i + 1).ToString() + "、<a href='/" + ls_path + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                }
                this.lblhy_field2.Text = ls_temp;
            }

            this.hy_content1.Text = dt.Rows[0]["hy_body"].ToString();

            //显示回复列表
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            //string ls_hfsql = "select * from hyp_gzlxdhf where hy_fsrdocid='" + this.txtdocid.Value + "' ";
            string ls_jsrsql = "select * from hyp_wjcd where hy_type='收件' and DOCID='" + this.txtdocid.Value + "' order by  hy_jsrid asc";
            DataTable dt_jsr = Hyoa_global.GetDataTable(ls_jsrsql);
            if (dt_jsr.Rows.Count > 0)
            {
                //输出回复记录
                this.lblhf.Text = "";
                this.lblhf.Text = "<table width=\"95%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" class=\"tb1-main\">";
                this.lblhf.Text += "<tr><td colspan='7' class='Tdcellright'>回复情况:共" + dt_jsr.Rows.Count + "人</td></tr>";
                this.lblhf.Text += "<tr>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>序号</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>部门名称</td>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>回复人</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>回复时间</td>";
                this.lblhf.Text += "<td class='Tdcellleft' align='center'>回复内容</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>附件</td>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>上报情况</td>";
                this.lblhf.Text += "</tr>";
                for (var i = 0; i < dt_jsr.Rows.Count; i++)
                {
                    string ls_bmmc = "";
                    string ls_hfr = "";
                    string ls_hfsj = "";
                    string ls_hfnr = "";
                    string ls_fj = "";
                    string ls_sbqk = "";

                    if (dt_jsr.Rows[i]["hy_ifyhf"].ToString() == "1")
                    {
                        string ls_hfsql = "select * from hyp_gzlxdhf where hy_fsrdocid='" + this.txtdocid.Value + "' and hy_jsrdocid='" + dt_jsr.Rows[i]["ID"].ToString() + "' ";
                        DataTable dt_hf = Hyoa_global.GetDataTable(ls_hfsql);
                        if (dt_hf.Rows.Count > 0)
                        {
                            ls_bmmc = dt_hf.Rows[0]["hy_deptname"].ToString();
                            ls_hfr = dt_hf.Rows[0]["hy_username"].ToString();
                            ls_hfsj = dt_hf.Rows[0]["hy_time"].ToString();
                            ls_hfnr = dt_hf.Rows[0]["hy_body"].ToString();
                            //附件
                            DataTable dt_fileatt2 = Hyoa_fileatt.GetfileattByFatherid(dt_hf.Rows[0]["hy_jsrdocid"].ToString());
                            if (dt_fileatt2.Rows.Count > 0)
                            {
                                for (var j = 0; j < dt_fileatt2.Rows.Count; j++)
                                {
                                    if (ls_fj != "")
                                    {
                                        ls_fj += "<br />";
                                    }
                                    ls_fj += (j + 1).ToString() + "、<a href='/" + dt_fileatt2.Rows[j]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt2.Rows[j]["hy_filename"].ToString() + "</a>";
                                }
                            }
                            //上报情况
                            System.TimeSpan ts = System.DateTime.Parse(dt_hf.Rows[0]["hy_time"].ToString()) - System.DateTime.Parse(dt_jsr.Rows[0]["hy_jzsj"].ToString());
                            int days = ts.Days;
                            if (days > 0)
                            {
                                ls_sbqk = "逾期上报";
                            }
                            else
                            {
                                ls_sbqk = "按期上报";
                            }
                        }
                    }
                    else
                    {
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        DataTable dt_user = Hyoa_user.Getuserallinfo(dt_jsr.Rows[i]["hy_jsrid"].ToString());
                        if (dt_user.Rows.Count > 0)
                        {
                            HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
                            DataTable dt_dept = Hyoa_dept.Getdept(dt_user.Rows[0]["hy_deptid"].ToString());
                            if (dt_dept.Rows.Count > 0)
                            {
                                ls_bmmc = dt_dept.Rows[0]["hy_deptname"].ToString();
                            }
                        }
                        ls_hfr = dt_jsr.Rows[i]["hy_jsrname"].ToString();
                        //附件
                        DataTable dt_fileatt2 = Hyoa_fileatt.GetfileattByFatherid(dt_jsr.Rows[i]["ID"].ToString());
                        if (dt_fileatt.Rows.Count > 0)
                        {
                            for (var j = 0; j < dt_fileatt2.Rows.Count; j++)
                            {
                                ls_fj += (j + 1).ToString() + "、<a href='/" + dt_fileatt2.Rows[j]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt2.Rows[j]["hy_filename"].ToString() + "</a><br />";
                            }
                        }
                        //上报情况
                        ls_sbqk = "未上报";
                    }

                    this.lblhf.Text += "<tr>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + (i + 1).ToString() + "</td>";
                    this.lblhf.Text += "<td width='15%' class='Tdcellright' align='center'>" + ls_bmmc + "</td>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + ls_hfr + "</td>";
                    this.lblhf.Text += "<td width='15%' class='Tdcellright' align='center'>" + ls_hfsj + "&nbsp;</td>";
                    this.lblhf.Text += "<td class='Tdcellright' align='center'>" + ls_hfnr + "&nbsp;</td>";
                    this.lblhf.Text += "<td width='20%' class='Tdcellright' align='center'>" + ls_fj + "&nbsp;</td>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + ls_sbqk + "</td>";
                    this.lblhf.Text += "</tr>";
                }
                this.lblhf.Text += "</table>";
            }
        }
    }
Esempio n. 9
0
    private void DataPlay(int PageNo)
    {
        string ls_sql = "";
        if (hy_datetime_s.Value != "")
            ls_sql += " and left(CONVERT(varchar, hy_datetime, 120 ) ,10) >= '" + hy_datetime_s.Value + "'";

        if (hy_datetime_e.Value != "")
            ls_sql += " and left(CONVERT(varchar, hy_datetime, 120 ) ,10) <= '" + hy_datetime_e.Value + "'";

        //if (ddlhy_foldername.SelectedValue != "")
        //    ls_sql += " and hy_foldername = '" + ddlhy_foldername.SelectedValue + "'";

        if (hy_title.Value != "")
            ls_sql += " and hy_title like '%" + hy_title.Value + "%'";

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();

        DataTable dt;
        dt = Hyoa_wjcd.Getdocs_sd_all(Session["hyuid"].ToString(), "收件", "已发送", ls_sql);

        DataTable tempTable = dt.Clone();

        DataColumn col1 = new DataColumn("ifywc",typeof(String));   //是否已完成
        DataColumn col2 = new DataColumn("yqqk", typeof(String));  //逾期情况

        tempTable.Columns.Add(col1);
        tempTable.Columns.Add(col2);
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }

            //判断是否已完成
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string lshfsql = "select * from hyp_wjcd where ID='" + dt.Rows[i]["ID"].ToString() + "' and hy_ifyhf='1' ";
            DataTable dt_hf = Hyoa_global.GetDataTable(lshfsql);
            if (dt_hf.Rows.Count > 0)
            {
                dr["ifywc"] = "完成";
                dr["yqqk"] = "";
            }
            else
            {
                if (dt.Rows[i]["hy_jzsj"] == System.DBNull.Value)
                {
                    dr["ifywc"] = "未完成";
                    dr["yqqk"] = "";
                }
                else
                {
                    if (System.DateTime.Parse(dt.Rows[i]["hy_jzsj"].ToString()).ToShortDateString() == "1900-1-1")
                    {
                        dr["ifywc"] = "未完成";
                        dr["yqqk"] = "";
                    }
                    else
                    {
                        //判断是否逾期
                        string lsyqsql = "select * from hyp_wjcd where hy_jzsj<'" + System.DateTime.Now.ToString() + "' and ID='" + dt.Rows[i]["ID"].ToString() + "' ";
                        DataTable dt_yq = Hyoa_global.GetDataTable(lsyqsql);
                        if (dt_yq.Rows.Count > 0)
                        {
                            dr["ifywc"] = "未完成";
                            dr["yqqk"] = "red";
                        }
                        else
                        {
                            dr["ifywc"] = "未完成";
                            dr["yqqk"] = "";
                        }
                    }
                }
            }

            tempTable.Rows.Add(dr);
        }

        int TotalRecord = dt.Rows.Count;
        this.sumts.Text = TotalRecord.ToString();
        this.sumts2.Text = TotalRecord.ToString();
        this.ShowTotalRecord.Text = TotalRecord.ToString();
        //计算及显示总页数
        int TotalPage;
        if (TotalRecord < System.Int32.Parse(PageSize.Text))
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0)
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1;

            }
            else
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text);

            }
        }
        this.ShowTotalPage.Text = TotalPage.ToString();
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }
Esempio n. 10
0
    protected void btnsendinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        String[] v_uids = this.txtuids.Value.Split(',');
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                DataTable dt = Hyoa_wjcd.Getdoc(v_uids[i]);
                if (dt.Rows.Count > 0)
                {
                    //考虑多人情况
                    String[] v_jsrids = dt.Rows[0]["hy_jsrid"].ToString().Split('+');
                    String[] v_jsrnames = dt.Rows[0]["hy_jsrname"].ToString().Split('+');
                    for (var j = 0; j < v_jsrids.Length; j++)
                    {
                        if (v_jsrids[j] != "")
                        {
                            //发送
                            Hyoa_wjcd.ID = Hyoa_global.GetRandom();
                            Hyoa_wjcd.DOCID = dt.Rows[0]["ID"].ToString();
                            Hyoa_wjcd.hy_type = "收件";
                            Hyoa_wjcd.hy_foldername = dt.Rows[0]["hy_foldername"].ToString();
                            Hyoa_wjcd.hy_fsrid = Session["hyuid"].ToString();
                            Hyoa_wjcd.hy_fsrname = Session["hyuname"].ToString();
                            Hyoa_wjcd.hy_jsrid = v_jsrids[j];
                            Hyoa_wjcd.hy_jsrname = v_jsrnames[j];
                            Hyoa_wjcd.hy_title = dt.Rows[0]["hy_title"].ToString();
                            Hyoa_wjcd.hy_body = dt.Rows[0]["hy_body"].ToString();
                            Hyoa_wjcd.hy_datetime = System.DateTime.Now.ToString();
                            Hyoa_wjcd.hy_ifsavetofjx = "";
                            Hyoa_wjcd.hy_yxj = "";
                            Hyoa_wjcd.hy_yjbg = "";
                            Hyoa_wjcd.hy_zycd = "";
                            Hyoa_wjcd.hy_hz = "";
                            Hyoa_wjcd.hy_status = "已发送";
                            Hyoa_wjcd.Insert();
                        }
                    }
                }
                //置为已发送
                Hyoa_wjcd.ID = v_uids[i];
                Hyoa_wjcd.hy_status = "已发送";
                Hyoa_wjcd.Updatestatus();

            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        Response.Write("<script>alert('发送成功!');</script>");
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }