コード例 #1
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 = "已收到。";
            }
        }
    }
コード例 #2
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.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>";
            }
        }
    }
コード例 #3
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();

            }
        }
    }
コード例 #4
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));
    }