コード例 #1
0
ファイル: jstx_cy_dbsy.aspx.cs プロジェクト: wjszxli/Webapp
    public void hy_dbsy()
    {
        string ls_uid = "";
        if (this.Request.QueryString["uid"] != null)
            ls_uid = this.Request.QueryString["uid"].ToString();

        string ls_pwd = "";
        if (this.Request.QueryString["pwd"] != null)
            ls_pwd = this.Request.QueryString["pwd"].ToString();

        if (ls_uid != "")
        {
            //得到待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            DataTable dt;
            dt = Hyoa_dbsy.Getdbsys_dbanddy(ls_uid);
            int i, j;
            string lstitle;
            i = 20;//显示条数
            if (dt.Rows.Count < i)
                i = dt.Rows.Count;

            for (j = 0; j < i; j++)
            {
                lstitle = dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString();
                if (lstitle.Length > 18)
                    lstitle = lstitle.Substring(0, 18) + "...";
                this.lbdbsy.Text += "·<a href='/ggdy/cy_login.aspx?uid=" + ls_uid + "&pwd=" + ls_pwd + "&redirectto=/ggdy/Hy_DbToYb.aspx?id=" + dt.Rows[j]["ID"].ToString() + "' title='" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString() + "' target='_blank'>" + lstitle + "</a>&nbsp;&nbsp;[" + System.DateTime.Parse(dt.Rows[j]["hy_createtime"].ToString()).ToString("MM-dd") + "]<br />";
            }
            if (this.lbdbsy.Text == "")
                this.lbdbsy.Text = "·暂无记录!";
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        if (!this.IsPostBack)
        {
            if (this.Request.QueryString["id"] != null)
            {
                string ls_id = Request.QueryString["id"].ToString();
                HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                DataTable dt = Hyoa_dbsy.Getdbsy(ls_id);
                if (dt.Rows.Count > 0)
                {
                    string ls_url = dt.Rows[0]["hy_url"].ToString() + "&rnd=" + System.Guid.NewGuid().ToString();
                    //如果是阅读性的待办事宜,将自动转已办
                    if (dt.Rows[0]["hy_property"].ToString() != "待办")
                        Hyoa_dbsy.Dbsytoybbyid(ls_id);

                    //跳转到具体文档
                    if (ls_url == "")
                        Response.Write("<script>window.opener.location.reload();window.close();</script>");
                    else
                        Response.Redirect("../"+ls_url);
                }
            }
        }
    }
コード例 #3
0
 //待办事宜声音提醒
 public void DbsyMusic()
 {
     HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
     DataTable dt = Hyoa_dbsy.Getdbsys_dbanddy(this.Session["hyuid"].ToString());
     if (dt.Rows.Count > 0)
     {
         if (Session["dbsymusic"].ToString() == "")
         {
             lbldbsy_music.Text = "<bgsound src=\"hyhtml/images/dbsy.mp3\" loop=\"True\"></bgsound>";
             Session["dbsymusic"] = dt.Rows[0]["hy_createtime"].ToString();
         }
         else
         {
             DateTime t1 = DateTime.Parse(Session["dbsymusic"].ToString());
             DateTime t2 = DateTime.Parse(dt.Rows[0]["hy_createtime"].ToString());
             System.TimeSpan ts = t2 - t1;
             double days = ts.TotalSeconds;
             if (days > 0)
             {
                 lbldbsy_music.Text = "<bgsound src=\"hyhtml/images/dbsy.mp3\" loop=\"True\"></bgsound>";
                 Session["dbsymusic"] = dt.Rows[0]["hy_createtime"].ToString();
             }
         }
     }
 }
コード例 #4
0
ファイル: index_right.aspx.cs プロジェクト: wjszxli/Webapp
    public void hy_dbsy()
    {
        //得到待办事宜
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        DataTable dt;
        dt = Hyoa_dbsy.Getdbsys_dbanddy(this.Session["hyuid"].ToString());
        int i, j;
        string lstitle;
        i = 8;//显示条数
        if (dt.Rows.Count < i)
            i = dt.Rows.Count;

        for (j = 0; j < i; j++)
        {
            string ls_mudelid = dt.Rows[j]["hy_mudelid"].ToString();
            string ls_mudelname = "";
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_getmudel = Hyoa_mudel.Getmudel(ls_mudelid);
            if (dt_getmudel.Rows.Count > 0)
                ls_mudelname = dt_getmudel.Rows[0]["hy_mudelname"].ToString();

            lstitle = "[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString();
            if (ls_mudelid == "yzgl")
            {
                lstitle = lstitle + "用印申请";
            }
            if (lstitle.Length > 35)
                lstitle = lstitle.Substring(0, 35) + "...";
            this.lbdbsy.Text += "<tr height='18px'><td valign='top'>·<a href='ggdy/Hy_DbToYb.aspx?id=" + dt.Rows[j]["ID"].ToString() + "' title='[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString() + "' target='_blank'>" + lstitle + "</a>&nbsp;&nbsp;[" + System.DateTime.Parse(dt.Rows[j]["hy_createtime"].ToString()).ToShortDateString().ToString() + "]</td></tr>";
        }
        if (this.lbdbsy.Text == "")
            this.lbdbsy.Text = "·暂无记录!";
    }
コード例 #5
0
ファイル: Hy_TopFrame.aspx.cs プロジェクト: wjszxli/Webapp
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        if (!this.IsPostBack)
        {
            this.lbluserinfo.Text = "您好," + Session["hyuname"].ToString() + "[" + Session["hydeptname"].ToString() + "]";
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            DataTable dt = Hyoa_dbsy.Getdbsys_dbanddy(Session["hyuid"].ToString());
            this.lbldbsynum.Text = dt.Rows.Count.ToString();
        }
    }
コード例 #6
0
ファイル: sendam.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    public void hyjstx()
    {
        HyoaClass.Hyoa_jstx Hyoa_jstx = new HyoaClass.Hyoa_jstx();
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();

        try
        {
            DataTable dt = Hyoa_jstx.Getjstxs_wf();
            if (dt.Rows.Count > 0)
            {
                string ls_content = "";
                string ls_mudelname = "消息提醒";
                string ls_url = "";
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    //得到模块名称
                    DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_from"].ToString());
                    if (dt_mudel.Rows.Count > 0)
                        ls_mudelname = dt_mudel.Rows[0]["hy_mudelname"].ToString();

                    //如果没找到该文档对应的待办事宜,则不发送消息
                    DataTable dt_dbsy = Hyoa_dbsy.Getdbsybydocid(dt.Rows[i]["DOCID"].ToString());
                    if (dt_dbsy.Rows.Count > 0)
                    {
                        ls_url = dt_dbsy.Rows[0]["hy_url"].ToString();
                        ls_content = "[" + ls_mudelname + "]-<a href='" + amtooa_ym + "/jstx_login.aspx?uid=" + dt.Rows[i]["hy_jsrid"].ToString() + "&key=cd04fa144ec48507&redirectto=" + ls_url + "' target=_blank>" + dt.Rows[i]["hy_content"].ToString() + "</a>";
                        int li_value = SendMessage("消息提醒", ls_content, dt.Rows[i]["hy_jsrid"].ToString());
                        if (li_value == 1)
                        {
                            Hyoa_jstx.ID = dt.Rows[i]["ID"].ToString();
                            Hyoa_jstx.hy_state = 1;
                            Hyoa_jstx.Update();
                        }
                        else
                        {
                            Hyoa_jstx.ID = dt.Rows[i]["ID"].ToString();
                            Hyoa_jstx.hy_state = 2;
                            Hyoa_jstx.Update();
                        }
                    }
                }
            }
        }
        catch
        {
        }
        finally
        {
        }
    }
コード例 #7
0
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
         String[] v_uids = this.txtuids.Value.Split(',');
         for(var i=0;i<v_uids.Length;i++)
         {
             if (v_uids[i] != "")
             {
                 Hyoa_dbsy.ID = v_uids[i];
                 Hyoa_dbsy.Delete();
             }
         }
         this.txtuids.Value = "";
         //DataPlay(1);
         DataPlay(System.Int32.Parse(this.curpage.Text));
 }
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //得到待办事宜数
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        DataTable dt = Hyoa_dbsy.Getdbsys_dbanddy(Session["hyuid"].ToString());
        this.Response.Write(dt.Rows.Count.ToString());

        this.Response.Write("|");

        //得到未读站内消息
        HyoaClass.Hyoa_jstx_info Hyoa_jstx_info = new HyoaClass.Hyoa_jstx_info();
        DataTable dt2 = Hyoa_jstx_info.GetDocByReceiveuserid_wd(Session["hyuid"].ToString());
        this.Response.Write(dt2.Rows.Count.ToString());

        this.Response.Write("|");

        //在线用户(得到人数前先更新一下数据)
        //更新当前用户的在线时间
        HyoaClass.Hyoa_jstx_zxry Hyoa_jstx_zxry = new HyoaClass.Hyoa_jstx_zxry();
        DataTable dt3 = Hyoa_jstx_zxry.GetDocByUserid(this.Session["hyuid"].ToString());
        if (dt3.Rows.Count > 0)
        {
            Hyoa_jstx_zxry.ID = dt3.Rows[0]["ID"].ToString();
            Hyoa_jstx_zxry.hy_userid = dt3.Rows[0]["hy_userid"].ToString();
            Hyoa_jstx_zxry.hy_username = dt3.Rows[0]["hy_username"].ToString();
            Hyoa_jstx_zxry.hy_datetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            Hyoa_jstx_zxry.Update();
        }
        else
        {
            Hyoa_jstx_zxry.ID = System.Guid.NewGuid().ToString();
            Hyoa_jstx_zxry.hy_userid = this.Session["hyuid"].ToString();
            Hyoa_jstx_zxry.hy_username = this.Session["hyuname"].ToString();
            Hyoa_jstx_zxry.hy_datetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            Hyoa_jstx_zxry.Insert();
        }
        //删除已经过期的在线用户数据(时间距离当前时间已有15分钟)
        Hyoa_jstx_zxry.Delete_offline(15);
        DataTable dt_zxry = Hyoa_jstx_zxry.GetDocs();
        this.Response.Write(dt_zxry.Rows.Count.ToString());

        //return ;
    }
コード例 #9
0
ファイル: Default.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    //待办事宜
    private void hy_dbsy()
    {
        string ls_html = "";
        int i, j;
        string ls_title = "";
        string ls_title2 = "";
        string ls_url = "";
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        DataTable dt = Hyoa_dbsy.Getdbsys_db(this.Session["hyuid"].ToString());
        i = 7; //显示条数
        if (dt.Rows.Count < i)
            i = dt.Rows.Count;
        for (j = 0; j < i; j++)
        {
            string ls_mudelid = dt.Rows[j]["hy_mudelid"].ToString();
            string ls_mudelname = "";
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_getmudel = Hyoa_mudel.Getmudel(ls_mudelid);
            if (dt_getmudel.Rows.Count > 0)
                ls_mudelname = dt_getmudel.Rows[0]["hy_mudelname"].ToString();

            ls_title = "[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString();
            if (ls_title.Length > 35)
                ls_title2 = ls_title.Substring(0, 35) + "...";
            else
                ls_title2 = ls_title;

            ls_url = "ggdy/Hy_DbToYb.aspx?id=" + dt.Rows[j]["ID"].ToString() + "&pop=1&rnd=" + System.Guid.NewGuid().ToString();
            ls_html += "<tr>";
            ls_html += "<td width=\"10\" align=\"center\">·</td>";
            ls_html += "<td height=\"26\"><a title=\"" + ls_title + "\" onclick=\"window.open('" + ls_url + "')\" href=\"javascript:\"><b>" + ls_title2 + "</b></a></td>";
            ls_html += "<td width=\"70\" align=\"center\"><font color='#2D2D2D' >" + System.DateTime.Parse(dt.Rows[j]["hy_createtime"].ToString()).ToString("yyyy-MM-dd") + "</font></td>";
            ls_html += "</tr>";

        }
        if (ls_html == "")
        {
            ls_html = "<tr><td>· 暂无待办事宜!</td></tr>";
        }
        this.lbldbsy.Text = ls_html;
    }
コード例 #10
0
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
        String[] v_uids = this.txtuids.Value.Split(',');
        string ls_filepath = "";
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                Hyoa_flowmain.DOCID = v_uids[i];
                Hyoa_flowmain.Delete();

                //删除文档时将待办事宜删除start
                HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy.DOCID = v_uids[i];
                Hyoa_dbsy.Deletebydocid(v_uids[i]);
                //删除文档时将待办事宜删除end

                //删的时候将附件也删除start
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
                if (dtfileatt.Rows.Count > 0)
                {
                    for (int k = 0; k < dtfileatt.Rows.Count; k++)
                    {
                        ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                        if (File.Exists(ls_filepath))
                        {
                            System.IO.File.Delete(ls_filepath);
                        }
                        Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                        Hyoa_fileatt.Delete();
                    }
                }
                //删的时候将附件也删除end
            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
コード例 #11
0
 private void DataPlay()
 {
     //hy_json = "{\"success\":true,\"total\":\"60\",\"rows\":[{\"hy_mudelid\":\"111\",\"hy_mudelname\":\"1111\",\"hy_roleid\":\"111111\",\"hy_qqroleid\":\"111111\",\"hy_isenabled\":\"111111\"}]}";
     string hy_json = "";
     string ls_success = "true";    //调用方法成功
     string ls_flag = "0";  //待办事宜条数
     string username = "";
     if (this.Request.QueryString["txt_username"] == null)
     {
         ls_flag = "-1"; //参数不对
     }
     else
     {
         username = this.Request.QueryString["txt_username"].ToString().ToLower();
         HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
         DataTable dt = Hyoa_dbsy.Getdbsys_dbanddy(username);
         ls_flag = dt.Rows.Count.ToString();
     }
     hy_json = "{\"success\":" + ls_success + ",\"flag\":\"" + ls_flag + "\"}";
     Response.Write(hy_json);
 }
コード例 #12
0
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
     if (txtmid.Text == "dbsy" || txtmid.Text == "dysy" || txtmid.Text == "ybsy" || txtmid.Text == "yysy")
     {
         HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
         Hyoa_dbsy.ID = this.txtuids.Value;
         Hyoa_dbsy.Delete();
     }
     if (this.Request.QueryString["mid"] == "mail")
     {
         HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail();
         Hyoa_mail.ID = this.txtuids.Value;
         Hyoa_mail.Delete();
     }
     if (this.Request.QueryString["mid"] == "Mudelrcap")
     {
         string sql = "delete from hyc_Tablercap where DOCID='" + this.txtuids.Value + "'";
         Hyoa_global.ExcuteSQL(sql);
         //删除文档时将待办事宜删除start
         HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
         Hyoa_dbsy.DOCID = this.txtuids.Value;
         Hyoa_dbsy.Deletebydocid(this.txtuids.Value);
         //删除文档时将待办事宜删除end
     }
     if (this.Request.QueryString["mid"] == "Mudelgrtxl" || this.Request.QueryString["mid"] == "Mudelgrtxllb" || this.Request.QueryString["mid"] == "Mudeltzgg" || this.Request.QueryString["mid"] == "Mudelgzrz" || this.Request.QueryString["mid"] == "Mudelqjsq")
     {
         string sql = "delete from hyc_" + this.Request.QueryString["tableid"] + " where DOCID='" + this.txtuids.Value + "'";
         Hyoa_global.ExcuteSQL(sql);
     }
     if (this.Request.QueryString["mid"] == "gwk")
     {
         string sql = "delete from hyp_gwk where ID='" + this.txtuids.Value + "'";
         Hyoa_global.ExcuteSQL(sql);
     }
     this.txtuids.Value = "";
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
コード例 #13
0
ファイル: list_bh.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     //HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
     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] != "")
         {
             //Hyoa_flowmain.DOCID = v_uids[i];
             //Hyoa_flowmain.Delete();
             string lssqldel = "delete hyc_" + this.txttableid.Value + " where DOCID='" + v_uids[i] + "'";
             Hyoa_global.ExcuteSQL(lssqldel);
             //删除文档时将待办事宜删除start
             HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
             Hyoa_dbsy.DOCID = v_uids[i];
             Hyoa_dbsy.Deletebydocid(v_uids[i]);
             //删除文档时将待办事宜删除end
         }
     }
     this.txtuids.Value = "";
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
コード例 #14
0
ファイル: list_yk.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    protected void btndelinfo_my_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        String[] v_uids = this.txtuids.Value.Split(',');
        string ls_filepath = "";
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                //判断是否是当前用户的文档
                string sql = "select * from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'";
                DataTable dt_judge = Hyoa_global.GetDataTable(sql);
                if (dt_judge.Rows.Count > 0)
                {
                    if (dt_judge.Rows[0]["hy_djrid"].ToString() == Session["hyuid"].ToString())
                    {
                        sql = "delete from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'";
                        Hyoa_global.ExcuteSQL(sql);

                        //删除文档时将待办事宜删除start
                        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                        Hyoa_dbsy.DOCID = v_uids[i];
                        Hyoa_dbsy.Deletebydocid(v_uids[i]);
                        //删除文档时将待办事宜删除end

                        //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start   add by xf 20121016
                        HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
                        Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i];
                        Hyoa_flowhistoryinfo_cl.DeleteByDOCID();
                        HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                        Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i];
                        Hyoa_flowhistoryinfo_cy.DeleteByDOCID();
                        //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end

                        //删的时候将附件也删除start
                        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                        DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
                        if (dtfileatt.Rows.Count > 0)
                        {
                            for (int k = 0; k < dtfileatt.Rows.Count; k++)
                            {
                                ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                                if (File.Exists(ls_filepath))
                                {
                                    System.IO.File.Delete(ls_filepath);
                                }
                                Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                                Hyoa_fileatt.Delete();
                            }
                        }
                        //删的时候将附件也删除end
                    }
                }
            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
コード例 #15
0
ファイル: main.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("login.aspx");

        string ls_tip = "保存成功!";

        #region 新建时先进行一次保存
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string sql = "";
        if (this.txtop.Value == "add")
        {
            //处理特殊字符
            this.hy_bt.Text = ReplaceString_Tszf(this.hy_bt.Text);
            if (Session["conntype"].ToString() == "SQL")
            {
                //edited by xf 20140625
                sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values (";
                sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'";
                sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'";
                sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "','" + this.hy_djsj.Text + "','" + this.hy_bt.Text + "'";
                sql += ",'','','," + Session["hyuid"].ToString() + ",',',') ";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                //edited by xf 20140625
                sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values (";
                sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'";
                sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'";
                sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "',to_date('" + this.hy_djsj.Text + "','YYYY-MM-DD HH24:MI:SS'),'" + this.hy_bt.Text + "'";
                sql += ",'','','," + Session["hyuid"].ToString() + ",',',') ";
            }
            Hyoa_global.ExcuteSQL(sql);

            //插入历史处理表
            Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.hy_curtacheid.Text, this.hy_curtachename.Text, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "", "", "", this.hy_djsj.Text, "");
        }
        #endregion

        //更新内容
        sql = "update hyc_" + this.hy_tableid.Text + " set hy_tableid='" + hy_tableid.Text + "',hy_bt='" + hy_bt.Text + "' ";

        #region 根据“需要保存的字段”来进行保存
        if (txtsavefields.Text != "")
        {
            string[] lv_savefields = txtsavefields.Text.Split(',');
            string[] lv_savefields_sx = txtsavefields_sx.Text.Split(',');
            string fielddocvalue = "";
            for (int i = 0; i < lv_savefields.Length; i++)
            {
                if (lv_savefields_sx[i].ToString() == "0")  //文本
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "1")  //日期
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        if (Session["conntype"].ToString() == "SQL")
                        {
                            if (fielddocvalue == "")
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=null";
                            else
                                sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                        }
                        if (Session["conntype"].ToString() == "ORACLE")
                        {
                            if (fielddocvalue == "")
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=null";
                            else
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=to_date('" + fielddocvalue + "','YYYY-MM-DD HH24:MI:SS')";
                        }
                    }
                }
                if (lv_savefields_sx[i].ToString() == "3")  //数值
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        if (fielddocvalue == "")
                            sql += ",hyc_" + lv_savefields[i].ToString() + "=0";
                        else
                            sql += ",hyc_" + lv_savefields[i].ToString() + "=" + fielddocvalue;
                    }
                }
                if (lv_savefields_sx[i].ToString() == "5")  //口令
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "6")  //编辑器
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "7")  //复选框
                {
                    string s = "";
                    CheckBoxList txfs = (CheckBoxList)this.FindControl(lv_savefields[i].ToString());
                    foreach (ListItem li in txfs.Items)
                    {
                        if (li.Selected)
                        {
                            if (li.Selected) s += li.Value + ",";
                        }
                    }
                    s = s.TrimEnd(',');
                    s = ReplaceString_Tszf(s);
                    sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'";
                }
                if (lv_savefields_sx[i].ToString() == "8")  //单选框
                {
                    string s = "";
                    RadioButtonList txfs = (RadioButtonList)this.FindControl(lv_savefields[i].ToString());
                    foreach (ListItem li in txfs.Items)
                    {
                        if (li.Selected)
                        {
                            if (li.Selected) s += li.Value + ",";
                        }
                    }
                    s = s.TrimEnd(',');
                    s = ReplaceString_Tszf(s);
                    sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'";
                }
                if (lv_savefields_sx[i].ToString() == "9")  //意见
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        if (fielddocvalue != "")
                        {
                            HyoaClass.Hyoa_yj Hyoa_yj = new HyoaClass.Hyoa_yj();
                            Hyoa_yj.yjid = Hyoa_global.GetRandom();
                            Hyoa_yj.hy_tableid = this.hy_tableid.Text;
                            Hyoa_yj.hy_fatherid = this.txtdocid.Value;
                            Hyoa_yj.hy_fieldid = lv_savefields[i].ToString();
                            Hyoa_yj.hy_yjuserid = Session["hyuid"].ToString();
                            Hyoa_yj.hy_yjusername = Session["hyuname"].ToString();
                            Hyoa_yj.hy_yjdeptid = Session["hydeptid"].ToString();
                            Hyoa_yj.hy_yjdeptname = Session["hydeptname"].ToString();
                            Hyoa_yj.hy_yjtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            Hyoa_yj.hy_yjbody = fielddocvalue;
                            Hyoa_yj.hy_yjip = HttpContext.Current.Request.UserHostAddress;
                            Hyoa_yj.hy_yjifshow = "";
                            Hyoa_yj.Insert();
                        }
                    }
                }
            }
        }
        #endregion

        #region 保存
        if (this.txtwhichoperation.Value == "1")
        {
            sql += hylcbctscl();  //特殊处理
        }
        #endregion

        #region 提交
        if (this.txtwhichoperation.Value == "2")
        {
            //更新主文档
            sql += ",hy_curtacheid='" + this.txtnexttacheid.Value + "'";
            sql += ",hy_curtachename='" + this.txtnexttachename.Value + "'";
            sql += ",hy_curclrid='" + this.txtnextclrid.Value + "'";
            sql += ",hy_curclrname='" + this.txtnextclrname.Value + "'";

            //---- 添加当前环节的处理时间 ---- start
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocidtacheid(this.txtdocid.Value, this.hy_curtacheid.Text);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
                else
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //---- 添加当前环节的处理时间 ---- end

            ////////////////////如果后续环节选择了“结束”,则不需要发待办事宜和短消息 start//////////////////////
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            if (this.txtnexttacheid.Value != "**")
            {
                //---  创建后续处理的处理记录+建立处理人待办事宜 ---- start
                Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", this.txtnextcyrid.Value, this.txtnextcyrname.Value, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");

                //待办事宜、短信、即时消息
                string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' });
                string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' });
                for (var i = 0; i < lv_dbrid.Length; i++)
                {
                    if (lv_dbrid[i].ToString() != "")
                    {
                        //得到当前用户手机号
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                        //得到后续处理人手机号
                        string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());

                        //给后续处理人发送一个新的待办事宜(提醒)
                        Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                        //给后续处理人发送即时消息(提醒)
                        if (this.txtisSendjstx_clr.Value == "1")
                        {
                            Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text);
                        }
                        //给后续处理人发送短信(提醒)
                        if (this.txtisSendsms_clr.Value == "1")
                        {
                            Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text);
                        }
                    }

                }
                //--- 创建后续处理的处理记录+建立处理人待办事宜 ---- end

                //--- 创建后续传阅记录+建立待办事宜 ---- start
                string[] lv_cyrid = this.txtnextcyrid.Value.Split(new Char[] { ',' });
                string[] lv_cyrname = this.txtnextcyrname.Value.Split(new Char[] { ',' });
                for (var i = 0; i < lv_cyrid.Length; i++)
                {
                    if (lv_cyrid[i].ToString() != "")
                    {
                        //建立传阅数据
                        Hyoa_global.Saveflowhistoryinfo_cy_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), "", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                        //待办事宜、短信、即时消息
                        //得到当前用户手机号
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                        //得到后续传阅人手机号
                        string cb_cyrsjh = Hyoa_user.GetMobilebyuserid(lv_cyrid[i].ToString());

                        //给后续处理人发送一个新的待办事宜(提醒)
                        Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待阅", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请阅读", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                        //给后续处理人发送即时消息(提醒)
                        if (this.txtisSendjstx_cyr.Value == "1")
                        {
                            Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text);
                        }
                        //给后续处理人发送短信(提醒)
                        if (this.txtisSendsms_cyr.Value == "1")
                        {
                            Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), cb_cyrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text);
                        }

                    }
                }
                //--- 创建后续传阅记录+建立待办事宜 ---- end
            }
            ////////////////////如果后续环节选择了“结束”,则不需要发待办事宜和短消息 start//////////////////////

            //--- 当前处理人的待办事宜转已办 ---- start
            Hyoa_dbsy.Dbsytoybbydocidtacheiduserid(this.txtdocid.Value, this.hy_curtacheid.Text, this.Session["hyuid"].ToString());
            //--- 当前处理人的待办事宜转已办 ---- end
            ls_tip = "文档已成功发送到[" + this.txtnexttachename.Value + "]环节";
            sql += hylcclcylist();  //更新hy_clrylist hy_cyrylist edited by xf 20140625
            sql += hylctjtscl();//特殊处理

            //调用添加客户名称的方法
            if (this.hy_mudelid.Text == "MudelVODfwxy" && this.hy_tableid.Text == "TableVODfwxy" || this.hy_mudelid.Text == "Mudelffpdfwht" && this.hy_tableid.Text == "Tableffpdfwht"
             || this.hy_mudelid.Text == "Mudeljdhazfwht" && this.hy_tableid.Text == "Tablejdhazfwht" || this.hy_mudelid.Text == "Mudelsyyhfwxy" && this.hy_tableid.Text == "Tablesyyhfwxy"
             || this.hy_mudelid.Text == "MudelDVBazfwdght" && this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_mudelid.Text == "MudelDVBazfwdght" && this.hy_tableid.Text == "TableDVBazfwdght"
             || this.hy_mudelid.Text == "Mudeljwdsjsxy" && this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_mudelid.Text == "Mudeljwdscsxy" && this.hy_tableid.Text == "Tablejwdscsxy"
             || this.hy_mudelid.Text == "Mudelkdjrht" && this.hy_tableid.Text == "Tablekdjrht" || this.hy_mudelid.Text == "Mudelsjcsfwht" && this.hy_tableid.Text == "Tablesjcsfwht"
             || this.hy_mudelid.Text == "Mudelsjgdcsfwht" && this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_mudelid.Text == "Mudelsjtxyyhzxy" && this.hy_tableid.Text == "Tablesjtxyyhzxy"
             || this.hy_mudelid.Text == "Mudelzdyht" && this.hy_tableid.Text == "Tablezdyht")
            {
                if (this.txtop.Value == "add")
                {
                    Khdaxx();
                }
            }
        }
        #endregion

        #region 收回
        if (this.txtwhichoperation.Value == "3")
        {
            //得到上个环节处理人
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 1)
            {
                //删除当前处理人员的待办事宜
                HyoaClass.Hyoa_dbsy Hyoa_dbsy_sh = new HyoaClass.Hyoa_dbsy();
                //edited by xf 20140625
                string[] lv_temp = dt_clinfo.Rows[0]["hy_clrid"].ToString().Split(',');
                for (int xf = 0; xf < lv_temp.Length; xf++)
                {
                    Hyoa_dbsy_sh.DeleteByDocid_flowid_tacheid_userid(this.txtdocid.Value, dt_clinfo.Rows[0]["hy_flowid"].ToString(), dt_clinfo.Rows[0]["hy_tacheid"].ToString(), lv_temp[xf]);
                }

                string ls_lastclrid = dt_clinfo.Rows[1]["hy_clrid"].ToString();         //上个环节处理人ID
                string ls_lastclrname = dt_clinfo.Rows[1]["hy_clrname"].ToString();     //上个环节处理人中文名
                string ls_lastcldoc = dt_clinfo.Rows[1]["ID"].ToString();               //上个环节处理的记录ID
                string ls_lasttacheid = dt_clinfo.Rows[1]["hy_tacheid"].ToString();     //上个环节处理环节ID
                string ls_lasttachename = dt_clinfo.Rows[1]["hy_tachename"].ToString(); //上个环节处理环节名称
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                dt_clinfo.Clear();

                //删除当前处理的记录
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.Delete();
                //清空上个环节处理时间,更新创建时间
                Hyoa_flowhistoryinfo_cl.ID = ls_lastcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = "";
                Hyoa_flowhistoryinfo_cl.hy_createtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                Hyoa_flowhistoryinfo_cl.Update_sh();
                //更新主文档中的当前环节ID、当前环节名称、当前处理人ID和中文名
                sql += ",hy_curtacheid='" + ls_lasttacheid + "'";
                sql += ",hy_curtachename='" + ls_lasttachename + "'";
                sql += ",hy_curclrid='" + ls_lastclrid + "'";
                sql += ",hy_curclrname='" + ls_lastclrname + "'";
                ls_tip = "文档已成功收回到[" + ls_lasttachename + "]环节";
                sql += hylcclcylist();  //更新hy_clrylist hy_cyrylist edited by xf 20140625
                sql += hylcshtscl();//特殊处理
            }
        }
        #endregion

        #region 退回
        if (this.txtwhichoperation.Value == "4")
        {
            //更新主文档
            sql += ",hy_curtacheid='" + this.txtnexttacheid.Value + "'";
            sql += ",hy_curtachename='" + this.txtnexttachename.Value + "'";
            sql += ",hy_curclrid='" + this.txtnextclrid.Value + "'";
            sql += ",hy_curclrname='" + this.txtnextclrname.Value + "'";

            //处理历史处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //新建一条处理记录
            Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", "", "", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "是");

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());

            //(考虑多人的情况)
            string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' });
            string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' });

            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到接收人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());
                    HyoaClass.Hyoa_global Hyoa_global2 = new HyoaClass.Hyoa_global();

                    //给退回到的处理人发送一个新的待办事宜(提醒)
                    Hyoa_global2.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                    //给退回到的处理人发送即时消息(提醒)
                    if (this.txtisSendjstx.Value == "1")
                    {
                        Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text);
                    }
                    //给退回到的处理人发送短信(提醒)
                    if (this.txtisSendsms.Value == "1")
                    {
                        Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text);
                    }
                }
            }
            ls_tip = "已成功退回到[" + this.txtnexttachename.Value + "]环节";
            sql += hylcthtscl();//特殊处理
        }
        #endregion

        #region 多人处理
        if (this.txtwhichoperation.Value == "5")
        {
            //更新主文档
            string ls_newclrid = Hyoa_global.MoveOneString_dh(this.hy_curclrid.Text, this.Session["hyuid"].ToString());
            string ls_newclrname = Hyoa_global.MoveOneString_dh(this.hy_curclrname.Text, this.Session["hyuname"].ToString());
            sql += ",hy_curclrid='" + ls_newclrid + "'";
            sql += ",hy_curclrname='" + ls_newclrname + "'";
            //处理当前记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = new DataTable();
            dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
            ls_tip = "提交成功,当前环节还需要[" + ls_newclrname + "]进行办理";
            sql += hylcdrcltscl();//特殊处理
        }
        #endregion

        #region 催办
        if (this.txtwhichoperation.Value == "6")
        {
            string cb_docid = this.txtdocid.Value;
            string cb_dbrid = this.hy_curclrid.Text;
            string cb_dbrname = this.hy_curclrname.Text;
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1";
            string cb_property = "催办";
            string cb_mudelid = this.hy_mudelid.Text;
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = this.txtcbideas.Value + "-" + this.hy_bt.Text;
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = this.hy_flowid.Text;
            string cb_tacheid = this.hy_curtacheid.Text;
            string cb_from = this.hy_mudelid.Text;

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(cb_fsrid);
            //得到接收人手机号
            string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(cb_dbrid);

            //给当前处理人发送一个新的待办事宜(提醒)
            Hyoa_global.Senddbsy_global(cb_docid, cb_dbrid, cb_dbrname, cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, cb_ifyb, cb_flowid, cb_tacheid, this.hy_tableid.Text);
            //给当前处理人发送即时消息(提醒)
            if (this.txtisSendjstx.Value == "1")
            {
                Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, cb_dbrid, cb_dbrname, cb_from, cb_bt, 0, this.hy_tableid.Text);
            }
            //给当前处理人发送短信(提醒)
            if (this.txtisSendsms.Value == "1")
            {
                Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, cb_dbrid, cb_dbrname, cb_jsrsjh, cb_from, cb_bt, 1, "", "", 0, this.hy_tableid.Text);
            }

            ls_tip = "催办成功!";
            sql += hylccbtscl();//特殊处理
        }
        #endregion

        #region 流程结束时的提交
        if (this.txtwhichoperation.Value == "7")
        {
            //更新主文档
            sql += ",hy_curtacheid='**'";
            sql += ",hy_curtachename='结束'";
            sql += ",hy_curclrid=''";
            sql += ",hy_curclrname=''";
            //更新处理表
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();

                //开票流程中开票在流程结束时付款处理。
                if (this.hy_tableid.Text == "Tablefpbd")
                {
                    htfk();
                }
            }
            ////流程结束时删除所有该文档对应的待办事宜
            //HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            //Hyoa_dbsy.Deletebydocid(this.txtdocid.Value);

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            ls_tip = "流程结束!";
            sql += hylcjstscl();//特殊处理
        }

        #endregion

        #region 收文阅件分发
        if (this.txtwhichoperation.Value == "8")
        {
            string cb_docid = this.txtdocid.Value;
            string cb_dbrid = this.hy_curclrid.Text;
            string cb_dbrname = this.hy_curclrname.Text;
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1";
            string cb_property = "待阅";
            string cb_mudelid = this.hy_mudelid.Text;
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = this.hy_bt.Text;
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = this.hy_flowid.Text;
            string cb_tacheid = this.hy_curtacheid.Text;
            string cb_from = this.hy_mudelid.Text;

            string[] lv_dbrid = this.txtswly_dbsy_userids.Text.Split(new Char[] { '+' });
            string[] lv_dbrname = this.txtswly_dbsy_usernames.Text.Split(new Char[] { '+' });
            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到当前用户手机号
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                    //得到后续处理人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());

                    //给后续处理人发送一个新的待办事宜(提醒)
                    Hyoa_global.Senddbsy_global(cb_docid, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, 0, cb_flowid, cb_tacheid, this.hy_tableid.Text);
                    //给后续处理人发送即时消息(提醒)
                    Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_mudelid, cb_bt, 0, this.hy_tableid.Text);
                    //给后续处理人发送短信(提醒)
                    Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, cb_mudelid, cb_bt, 1, "", "", 0, this.hy_tableid.Text);

                    //在hyp_flowhistoryinfo_cy中添加传阅信息
                    string sql_cy = "select * from hyp_flowhistoryinfo_cy where DOCID='" + this.txtdocid.Value + "' and hy_cyrid='" + lv_dbrid[i] + "' order by hy_createtime DESC ";
                    DataTable dt_cy = Hyoa_global.GetDataTable(sql_cy);
                    if (dt_cy.Rows.Count > 0)
                    {
                    }
                    else
                    {
                        HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                        Hyoa_flowhistoryinfo_cy.ID = Hyoa_global.GetRandom();
                        Hyoa_flowhistoryinfo_cy.DOCID = this.txtdocid.Value;
                        Hyoa_flowhistoryinfo_cy.hy_flowid = this.hy_flowid.Text;
                        Hyoa_flowhistoryinfo_cy.hy_flowname = this.hy_flowname.Text;
                        Hyoa_flowhistoryinfo_cy.hy_tacheid = this.hy_curtacheid.Text;
                        Hyoa_flowhistoryinfo_cy.hy_tachename = this.hy_curtachename.Text;
                        Hyoa_flowhistoryinfo_cy.hy_cyrid = lv_dbrid[i];
                        Hyoa_flowhistoryinfo_cy.hy_cyrname = lv_dbrname[i];
                        Hyoa_flowhistoryinfo_cy.hy_ydsj = "";
                        Hyoa_flowhistoryinfo_cy.hy_createtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        Hyoa_flowhistoryinfo_cy.Insert();
                    }
                }
            }
            //在当前环节处理的记录中添加传阅信息,主要用于列表的显示控制
            string sql_cl = "select * from hyp_flowhistoryinfo_cl where DOCID='" + this.txtdocid.Value + "' order by hy_createtime DESC ";
            DataTable dt_cl = Hyoa_global.GetDataTable(sql_cl);
            if (dt_cl.Rows.Count > 0)
            {
                if (dt_cl.Rows[0]["hy_cyrid"].ToString() == "")
                {
                    sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid='" + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "',hy_cyrname='" + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + "' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    Hyoa_global.ExcuteSQL(sql_cl);
                }
                else
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid=hy_cyrid+'," + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "',hy_cyrname=hy_cyrname+'," + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + "' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid=CONCAT(hy_cyrid,'," + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "'),hy_cyrname=CONCAT(hy_cyrname,'," + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + ")' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    }
                    Hyoa_global.ExcuteSQL(sql_cl);
                }
            }
            ls_tip = "阅件分发成功!";
            sql += hylcclcylist();  //更新hy_clrylist hy_cyrylist edited by xf 20140625
        }
        #endregion

        //20140809 hjadd start
        #region 收发文分发
        if (this.txtwhichoperation.Value == "11")
        {
            string cb_docid = this.txtdocid.Value;
            string cb_dbrid = this.hy_curclrid.Text;
            string cb_dbrname = this.hy_curclrname.Text;
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1";
            string cb_property = "待阅";
            string cb_mudelid = this.hy_mudelid.Text;
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = this.hy_bt.Text;
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = this.hy_flowid.Text;
            string cb_tacheid = this.hy_curtacheid.Text;
            string cb_from = this.hy_mudelid.Text;

            string[] lv_dbrid = this.txtffly_dbsy_userids.Text.Split(new Char[] { '+' });
            string[] lv_dbrname = this.txtffly_dbsy_usernames.Text.Split(new Char[] { '+' });
            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到当前用户手机号
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                    //得到后续处理人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());

                    //给后续处理人发送一个新的待办事宜(提醒)
                    Hyoa_global.Senddbsy_global(cb_docid, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, 0, cb_flowid, cb_tacheid, this.hy_tableid.Text);
                    //给后续处理人发送即时消息(提醒)
                    Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_mudelid, cb_bt, 0, this.hy_tableid.Text);
                    //给后续处理人发送短信(提醒)
                    Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, cb_mudelid, cb_bt, 1, "", "", 0, this.hy_tableid.Text);

                    //在hyp_flowhistoryinfo_cy中添加传阅信息
                    string sql_cy = "select * from hyp_flowhistoryinfo_cy where DOCID='" + this.txtdocid.Value + "' and hy_cyrid='" + lv_dbrid[i] + "' order by hy_createtime DESC ";
                    DataTable dt_cy = Hyoa_global.GetDataTable(sql_cy);
                    if (dt_cy.Rows.Count > 0)
                    {
                    }
                    else
                    {
                        HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                        Hyoa_flowhistoryinfo_cy.ID = Hyoa_global.GetRandom();
                        Hyoa_flowhistoryinfo_cy.DOCID = this.txtdocid.Value;
                        Hyoa_flowhistoryinfo_cy.hy_flowid = this.hy_flowid.Text;
                        Hyoa_flowhistoryinfo_cy.hy_flowname = this.hy_flowname.Text;
                        Hyoa_flowhistoryinfo_cy.hy_tacheid = this.hy_curtacheid.Text;
                        Hyoa_flowhistoryinfo_cy.hy_tachename = this.hy_curtachename.Text;
                        Hyoa_flowhistoryinfo_cy.hy_cyrid = lv_dbrid[i];
                        Hyoa_flowhistoryinfo_cy.hy_cyrname = lv_dbrname[i];
                        Hyoa_flowhistoryinfo_cy.hy_ydsj = "";
                        Hyoa_flowhistoryinfo_cy.hy_createtime = System.DateTime.Now.ToString();
                        Hyoa_flowhistoryinfo_cy.Insert();
                    }
                }
            }

            ls_tip = "分发成功!";
        }
        #endregion
        //20140809 hj add end

        #region 在主表单内嵌列表的功能中,保存、提交和确认子表单时,需要将父文档的DOCID保存到当前记录的hy_motherid中
        //ADD BY XF 2011-11-17
        if (this.txtwhichoperation.Value == "1" || this.txtwhichoperation.Value == "2" || this.txtwhichoperation.Value == "111")
        {
            if (Request.QueryString["op"] != null)
            {
                if (Request.QueryString["op"].ToString() != "")
                {
                    if (Request.QueryString["motherid"] != null)
                    {
                        if (Request.QueryString["motherid"].ToString() != "")
                        {
                            sql += ",hy_motherid='" + Request.QueryString["motherid"].ToString() + "'";
                        }
                    }
                }
            }
        }
        #endregion

        sql += " where DOCID='" + this.txtdocid.Value + "'";
        Hyoa_global.ExcuteSQL(sql);

        #region 处理完成后的提示及跳转(增加刷新附件功能)
        if (this.txtifsxfj.Text == "1")
        {
            Response.Write("<script>window.location='main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>");
        }
        else
        {

            if (this.txturl.Value == "2")
            {

                Response.Write("<script>alert('" + ls_tip + "');try{window.opener.location.reload();}catch(err){}self.close();parent.location.reload();</script>");
            }
            else
                if (this.txtifpop.Value == "")
            {
                if (this.hy_tableid.Text == "Tablefpbd")
                {
                    Response.Write("<script>alert('" + ls_tip + "');window.location='list_myadd.aspx?mid=Mudelfp&tableid=Tablefpbd&listid=6b07b57d-2906-4f5b-bc47-a8c7754ea5bf&rnd=afc25663-de8a-43ba-bc48-db224b3e5c92'</script>");
                }
                else
                {
                    Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('" + ls_tip + "');try{window.opener.location.reload();}catch(err){}self.close();</script>");
            }
        }
        #endregion
    }
コード例 #16
0
ファイル: list_ybsy_yb.aspx.cs プロジェクト: wjszxli/Webapp
    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
        //{
        //    this.tddeldoc.Visible = true; //删除
        //}
        //else
        //{
        //    this.tddeldoc.Visible = false; //删除
        //}

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

        //DataTable dt;
        //dt = Hyoa_dbsy.Getdbsys_yb(Session["hyuid"].ToString());
        DataTable dt;
        string lssql22 = "Select * from hyt_dbsy where hy_ifyb=1 and hy_property='待办' and hy_dbrid='" + Session["hyuid"].ToString() + "' ";
        if (this.txtbt.Text != "")
        {
            lssql22 += " and hy_bt like '%" + this.txtbt.Text + "%'";
        }

        lssql22 += " order by hy_createtime desc";
        HyoaClass.DAO db = new HyoaClass.DAO();
        dt = db.GetDataTable(lssql22);

        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("mudelname", typeof(String));
        tempTable.Columns.Add(col);

        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];
            }
            //根据模块ID得到模块名称
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_mudelid"].ToString());
            if(dt_mudel.Rows.Count>0)
                dr["mudelname"] = dt_mudel.Rows[0]["hy_mudelname"].ToString();

            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();
    }
コード例 #17
0
    private void DataPlay(int PageNo)
    {
        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string sql = "";

        DataTable dt = new DataTable();
        if (txtmid.Text == "dbsy")
        {
            dt = Hyoa_dbsy.Getdbsys_db(Session["hyuid"].ToString());
        }
        if (txtmid.Text == "dysy")
        {
            dt = Hyoa_dbsy.Getdbsys_dy(Session["hyuid"].ToString());
        }
        if (txtmid.Text == "ybsy")
        {
            dt = Hyoa_dbsy.Getdbsys_yb(Session["hyuid"].ToString());
        }
        if (txtmid.Text == "yysy")
        {
            dt = Hyoa_dbsy.Getdbsys_yy(Session["hyuid"].ToString());
        }
        //电子邮件
        if (this.Request.QueryString["mid"] == "mail")
        {
            //收件箱
            if (this.Request.QueryString["tableid"].ToString() == "sjx")
            {
                sql = "select * from hyt_mail where hy_jsrid='" + Session["hyuid"].ToString() + "' and hy_type='收件' ";
                if (txtname.Value != "")
                {
                    sql += " and hy_title like '%" + txtname.Value + "%' ";
                }
                sql += " order by hy_datetime desc ";
                dt = Hyoa_global.GetDataTable(sql);
            }
            //发件箱
            if (this.Request.QueryString["tableid"].ToString() == "fjx")
            {
                sql = "select * from hyt_mail where hy_fsrid='" + Session["hyuid"].ToString() + "' and hy_type='发件' ";
                if (txtname.Value != "")
                {
                    sql += " and hy_title like '%" + txtname.Value + "%' ";
                }
                sql += " order by hy_datetime desc ";
                dt = Hyoa_global.GetDataTable(sql);
            }
        }
        //日程安排
        if (this.Request.QueryString["mid"] == "Mudelrcap")
        {
            sql = "select * from hyc_Tablercap where hy_djrid='" + Session["hyuid"].ToString() + "' ";
            if (txtname.Value != "")
            {
                sql += " and hyc_zt like '%" + txtname.Value + "%' ";
            }
            sql += " order by hyc_qssj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //个人通讯录
        if (this.Request.QueryString["mid"] == "Mudelgrtxl")
        {
            sql = "select * from hyc_Tablegrtxl where hy_djrid='" + Session["hyuid"].ToString() + "' ";
            if (txtname.Value != "")
            {
                sql += " and hyc_xm like '%" + txtname.Value + "%' ";
            }
            sql += " order by hyc_xm ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //个人通讯录类别
        if (this.Request.QueryString["mid"] == "Mudelgrtxllb")
        {
            sql = "select * from hyc_Tablegrtxllb where hy_djrid='" + Session["hyuid"].ToString() + "' ";
            sql += " order by hyc_pxh ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //通知公告
        if (this.Request.QueryString["mid"] == "Mudeltzgg")
        {
            sql = "select * from hyc_Tabletzgg where 1=1 ";
            if (txtname.Value != "")
            {
                sql += " and hyc_bt like '%" + txtname.Value + "%' ";
            }
            sql += " order by hyc_djsj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //最新公文
        if (this.Request.QueryString["mid"] == "gwk")
        {
            sql = "select * from hyp_gwk where 1=1 ";
            if (txtname.Value != "")
            {
                sql += " and hy_bt like '%" + txtname.Value + "%' ";
            }
            sql += " order by hy_djsj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //工作日志
        if (this.Request.QueryString["mid"] == "Mudelgzrz")
        {
            sql = "select * from hyc_Tablegzrz where 1=1 ";
            if (txtname.Value != "")
            {
                sql += " and hyc_zt like '%" + txtname.Value + "%' ";
            }
            if (this.Request.QueryString["type"].ToString() == "dept")
            {
                sql += " and hy_djrbmid = '" + Session["hydeptid"].ToString() + "' ";
            }
            else
            {
                sql += " and hy_djrid = '" + Session["hyuid"].ToString() + "' ";
            }
            sql += " order by hy_djsj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }
        //请假管理
        if (this.Request.QueryString["mid"] == "Mudelqjsq")
        {
            sql = "select distinct a.* from hyc_Tableqjsq a,hyp_flowhistoryinfo_cl b where a.DOCID=b.DOCID and (','+b.hy_clrid+',' like '%," + Session["hyuid"].ToString() + ",%' or ','+b.hy_cyrid+',' like '%," + Session["hyuid"].ToString() + ",%') and b.hy_ifth!='是'   ";
            if (txtname.Value != "")
            {
                sql += " and hyc_qjsy like '%" + txtname.Value + "%' ";
            }
            sql += " order by a.hy_djsj desc ";
            dt = Hyoa_global.GetDataTable(sql);
        }

        DataTable tempTable = dt.Clone();
        //模块名称
        DataColumn col1 = new DataColumn("show_mudelname", typeof(String));
        tempTable.Columns.Add(col1);
        //显示的标题
        DataColumn col2 = new DataColumn("show_bt", typeof(String));
        tempTable.Columns.Add(col2);
        //显示的时间
        DataColumn col3 = new DataColumn("show_sj", typeof(String));
        tempTable.Columns.Add(col3);
        //显示的连接
        DataColumn col4 = new DataColumn("show_lj", typeof(String));
        tempTable.Columns.Add(col4);
        //删除按钮
        DataColumn col5 = new DataColumn("show_delinfo", typeof(String));
        tempTable.Columns.Add(col5);

        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];
            }

            dr["show_mudelname"] = this.lblmudelname.Text;

            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_mudel = Hyoa_mudel.Getmudel(txtmid.Text);
            string ls_role = "Role9999";
            if (dt_mudel.Rows.Count > 0)
            {
                ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();
            }

            if (txtmid.Text == "dbsy" || txtmid.Text == "dysy" || txtmid.Text == "ybsy" || txtmid.Text == "yysy")
            {
                dr["show_bt"] = dt.Rows[i]["hy_subbt"].ToString() + "-" + dt.Rows[i]["hy_bt"].ToString();
                dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hy_createtime"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = dt.Rows[i]["hy_url"].ToString().Replace("main.aspx", "wap_main.aspx");
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>";
            }
            //电子邮件
            if (this.Request.QueryString["mid"] == "mail")
            {
                dr["show_bt"] = dt.Rows[i]["hy_title"].ToString();
                dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hy_datetime"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main_mailread.aspx?op=modify&mid=mail&tableid=sjx&docid=" + dt.Rows[i]["ID"].ToString() + "&url=wap_list.aspx?mid=mail&tableid=sjx&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>";
            }
            //日程安排
            if (this.Request.QueryString["mid"] == "Mudelrcap")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_zt"].ToString();
                dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_qssj"].ToString()).ToString("yyyy-MM-dd") + "至" + System.DateTime.Parse(dt.Rows[i]["hyc_jssj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelrcap&tableid=Tablercap&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelrcap&tableid=Tablercap&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除]</a>";
            }
            //个人通信录
            if (this.Request.QueryString["mid"] == "Mudelgrtxl")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_xm"].ToString();
                dr["show_sj"] = "手机:" + dt.Rows[i]["hyc_sj"].ToString();
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgrtxl&tableid=Tablegrtxl&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgrtxl&tableid=Tablegrtxl&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
            }
            //个人通信录类别
            if (this.Request.QueryString["mid"] == "Mudelgrtxllb")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_lb"].ToString();
                dr["show_sj"] = "序号:" + dt.Rows[i]["hyc_pxh"].ToString();
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgrtxl&tableid=Tablegrtxllb&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgrtxl&tableid=Tablegrtxllb&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
            }
            //通知公告
            if (this.Request.QueryString["mid"] == "Mudeltzgg")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_bt"].ToString();
                dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_djsj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudeltzgg&tableid=Tabletzgg&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudeltzgg&tableid=Tabletzgg&page=" + this.curpage.Text;
                //判断权限
                if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
                {
                    dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
                }
            }
            //公文库
            if (this.Request.QueryString["mid"] == "gwk")
            {
                dr["show_bt"] = dt.Rows[i]["hy_bt"].ToString();
                dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hy_djsj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main_gwk.aspx?op=modify&mid=gwk&tableid=gwk&docid=" + dt.Rows[i]["ID"].ToString() + "&url=wap_list.aspx?mid=gwk&tableid=gwk&page=" + this.curpage.Text;
                //判断权限
                if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
                {
                    dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>";
                }
            }
            //工作日志
            if (this.Request.QueryString["mid"] == "Mudelgzrz")
            {
                dr["show_bt"] = "[" + dt.Rows[i]["hy_djrname"].ToString() + "]" + dt.Rows[i]["hyc_zt"].ToString();
                dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_djsj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgzrz&tableid=Tablegzrz&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgzrz&tableid=Tablegzrz&type=" + this.Request.QueryString["type"].ToString() + "&page=" + this.curpage.Text;
                dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
            }
            //请假管理
            if (this.Request.QueryString["mid"] == "Mudelqjsq")
            {
                dr["show_bt"] = dt.Rows[i]["hyc_qjr"].ToString() + "[" + dt.Rows[i]["hy_curtachename"].ToString() + "]";
                dr["show_sj"] = "请假时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_qjsj"].ToString()).ToString("yyyy-MM-dd");
                dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelqjsq&tableid=Tableqjsq&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelqjsq&tableid=Tableqjsq&page=" + this.curpage.Text;
                //判断权限
                if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
                {
                    dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>";
                }
            }
            tempTable.Rows.Add(dr);
        }

        int TotalRecord = dt.Rows.Count;
        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();
    }
コード例 #18
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_global Hyoa_global = new HyoaClass.Hyoa_global();
        string sql = "";
        if (this.txtop.Value == "add")
        {
            if (Session["conntype"].ToString() == "SQL")
            {
                sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist) values (";
                sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'";
                sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'";
                sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "','" + this.hy_djsj.Text + "','" + this.hy_bt.Text + "'";
                sql += ",'','') ";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist) values (";
                sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'";
                sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'";
                sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "',to_date('" + this.hy_djsj.Text + "','YYYY-MM-DD HH24:MI:SS'),'" + this.hy_bt.Text + "'";
                sql += ",'','') ";
            }
            Hyoa_global.ExcuteSQL(sql);

            //插入历史处理表(如果是流程文档)
            if (txtifhaveflow.Value == "是")
            {
                Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.hy_curtacheid.Text, this.hy_curtachename.Text, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "", "", "", this.hy_djsj.Text, "");
            }
        }

        //更新内容
        sql = "update hyc_" + this.hy_tableid.Text + " set hy_tableid='" + hy_tableid.Text + "' ";
        //根据“需要保存的字段”来进行保存
        if (txtsavefields.Text != "")
        {
            string[] lv_savefields = txtsavefields.Text.Split(',');
            string[] lv_savefields_sx = txtsavefields_sx.Text.Split(',');
            string fielddocvalue = "";
            for (int i = 0; i < lv_savefields.Length; i++)
            {
                if (lv_savefields_sx[i].ToString() == "0")  //文本
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "1")  //日期
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        if (Session["conntype"].ToString() == "SQL")
                        {
                            if (fielddocvalue == "")
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=null";
                            else
                                sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                        }
                        if (Session["conntype"].ToString() == "ORACLE")
                        {
                            if (fielddocvalue == "")
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=null";
                            else
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=to_date('" + fielddocvalue + "','YYYY-MM-DD HH24:MI:SS')";
                        }
                    }
                }
                if (lv_savefields_sx[i].ToString() == "3")  //数值
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        if (fielddocvalue == "")
                            sql += ",hyc_" + lv_savefields[i].ToString() + "=0";
                        else
                            sql += ",hyc_" + lv_savefields[i].ToString() + "=" + fielddocvalue;
                    }
                }
                if (lv_savefields_sx[i].ToString() == "5")  //口令
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "6")  //编辑器
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "7")  //复选框
                {
                    string s = "";
                    CheckBoxList txfs = (CheckBoxList)this.FindControl(lv_savefields[i].ToString());
                    foreach (ListItem li in txfs.Items)
                    {
                        if (li.Selected)
                        {
                            if (li.Selected) s += li.Value + ",";
                        }
                    }
                    s = s.TrimEnd(',');
                    sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'";
                }
                if (lv_savefields_sx[i].ToString() == "8")  //单选框
                {
                    string s = "";
                    RadioButtonList txfs = (RadioButtonList)this.FindControl(lv_savefields[i].ToString());
                    foreach (ListItem li in txfs.Items)
                    {
                        if (li.Selected)
                        {
                            if (li.Selected) s += li.Value + ",";
                        }
                    }
                    s = s.TrimEnd(',');
                    sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'";
                }
            }
        }

        //保存
        if (this.txtwhichoperation.Value == "1")
        {
            hylcbctscl(sql);  //特殊处理
        }

        //确认
        if (this.txtwhichoperation.Value == "111")
        {
            sql += ",hy_ifconfirm='1'";
        }

        //取消确认
        if (this.txtwhichoperation.Value == "112")
        {
            sql += ",hy_ifconfirm='0'";
        }

        //提交
        if (this.txtwhichoperation.Value == "2")
        {
            //更新主文档
            sql += ",hy_curtacheid='" + this.txtnexttacheid.Value + "'";
            sql += ",hy_curtachename='" + this.txtnexttachename.Value + "'";
            sql += ",hy_curclrid='" + this.txtnextclrid.Value + "'";
            sql += ",hy_curclrname='" + this.txtnextclrname.Value + "'";

            //---- 添加当前环节的处理时间 ---- start
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocidtacheid(this.txtdocid.Value, this.hy_curtacheid.Text);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = System.DateTime.Now.ToString();
                }
                else
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();
                }
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //---- 添加当前环节的处理时间 ---- end

            ////////////////////如果后续环节选择了“结束”,则不需要发待办事宜和短消息 start//////////////////////
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            if (this.txtnexttacheid.Value != "**")
            {
                //---  创建后续处理的处理记录+建立处理人待办事宜 ---- start
                Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", this.txtnextcyrid.Value, this.txtnextcyrname.Value, System.DateTime.Now.ToString(), "");

                //待办事宜、短信、即时消息
                string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' });
                string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' });
                for (var i = 0; i < lv_dbrid.Length; i++)
                {
                    if (lv_dbrid[i].ToString() != "")
                    {
                        //得到当前用户手机号
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                        //得到后续处理人手机号
                        string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());

                        //给后续处理人发送一个新的待办事宜(提醒)
                        Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                        //给后续处理人发送即时消息(提醒)
                        if (this.txtisSendjstx_clr.Value == "1")
                        {
                            Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text);
                        }
                        //给后续处理人发送短信(提醒)
                        if (this.txtisSendsms_clr.Value == "1")
                        {
                            Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text);
                        }
                    }
                }
                //--- 创建后续处理的处理记录+建立处理人待办事宜 ---- end

                //--- 创建后续传阅记录+建立待办事宜 ---- start
                string[] lv_cyrid = this.txtnextcyrid.Value.Split(new Char[] { ',' });
                string[] lv_cyrname = this.txtnextcyrname.Value.Split(new Char[] { ',' });
                for (var i = 0; i < lv_cyrid.Length; i++)
                {
                    if (lv_cyrid[i].ToString() != "")
                    {
                        //建立传阅数据
                        Hyoa_global.Saveflowhistoryinfo_cy_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), "", System.DateTime.Now.ToString());

                        //待办事宜、短信、即时消息
                        //得到当前用户手机号
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                        //得到后续传阅人手机号
                        string cb_cyrsjh = Hyoa_user.GetMobilebyuserid(lv_cyrid[i].ToString());

                        //给后续处理人发送一个新的待办事宜(提醒)
                        Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待阅", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请阅读", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                        //给后续处理人发送即时消息(提醒)
                        if (this.txtisSendjstx_cyr.Value == "1")
                        {
                            Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text);
                        }
                        //给后续处理人发送短信(提醒)
                        if (this.txtisSendsms_cyr.Value == "1")
                        {
                            Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), cb_cyrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text);
                        }

                    }
                }
                //--- 创建后续传阅记录+建立待办事宜 ---- end
            }
            ////////////////////如果后续环节选择了“结束”,则不需要发待办事宜和短消息 start//////////////////////

            //--- 当前处理人的待办事宜转已办 ---- start
            Hyoa_dbsy.Dbsytoybbydocidtacheiduserid(this.txtdocid.Value, this.hy_curtacheid.Text, this.Session["hyuid"].ToString());
            //--- 当前处理人的待办事宜转已办 ---- end
            ls_tip = "文档已成功发送到[" + this.txtnexttachename.Value + "]环节";
            hylctjtscl(sql);//特殊处理
        }

        //收回
        if (this.txtwhichoperation.Value == "3")
        {
            //得到上个环节处理人
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 1)
            {
                //删除当前处理人员的待办事宜
                HyoaClass.Hyoa_dbsy Hyoa_dbsy_sh = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy_sh.DeleteByDocid_flowid_tacheid_userid(this.txtdocid.Value, dt_clinfo.Rows[0]["hy_flowid"].ToString(), dt_clinfo.Rows[0]["hy_tacheid"].ToString(), dt_clinfo.Rows[0]["hy_clrid"].ToString());

                string ls_lastclrid = dt_clinfo.Rows[1]["hy_clrid"].ToString();         //上个环节处理人ID
                string ls_lastclrname = dt_clinfo.Rows[1]["hy_clrname"].ToString();     //上个环节处理人中文名
                string ls_lastcldoc = dt_clinfo.Rows[1]["ID"].ToString();               //上个环节处理的记录ID
                string ls_lasttacheid = dt_clinfo.Rows[1]["hy_tacheid"].ToString();     //上个环节处理环节ID
                string ls_lasttachename = dt_clinfo.Rows[1]["hy_tachename"].ToString(); //上个环节处理环节名称
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                dt_clinfo.Clear();

                //删除当前处理的记录
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.Delete();
                //清空上个环节处理时间,更新创建时间
                Hyoa_flowhistoryinfo_cl.ID = ls_lastcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = "";
                Hyoa_flowhistoryinfo_cl.hy_createtime = System.DateTime.Now.ToString();
                Hyoa_flowhistoryinfo_cl.Update_sh();
                //更新主文档中的当前环节ID、当前环节名称、当前处理人ID和中文名
                sql += ",hy_curtacheid='" + ls_lasttacheid + "'";
                sql += ",hy_curtachename='" + ls_lasttachename + "'";
                sql += ",hy_curclrid='" + ls_lastclrid + "'";
                sql += ",hy_curclrname='" + ls_lastclrname + "'";
                ls_tip = "文档已成功收回到[" + ls_lasttachename + "]环节";
                hylcshtscl(sql);//特殊处理
            }
        }

        //退回
        if (this.txtwhichoperation.Value == "4")
        {
            //更新主文档
            sql += ",hy_curtacheid='" + this.txtnexttacheid.Value + "'";
            sql += ",hy_curtachename='" + this.txtnexttachename.Value + "'";
            sql += ",hy_curclrid='" + this.txtnextclrid.Value + "'";
            sql += ",hy_curclrname='" + this.txtnextclrname.Value + "'";

            //处理历史处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //新建一条处理记录
            Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", "", "", System.DateTime.Now.ToString(), "是");

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());

            //(考虑多人的情况)
            string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' });
            string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' });

            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到接收人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());
                    HyoaClass.Hyoa_global Hyoa_global2 = new HyoaClass.Hyoa_global();

                    //给退回到的处理人发送一个新的待办事宜(提醒)
                    Hyoa_global2.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                    //给退回到的处理人发送即时消息(提醒)
                    if (this.txtisSendjstx.Value == "1")
                    {
                        Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text);
                    }
                    //给退回到的处理人发送短信(提醒)
                    if (this.txtisSendsms.Value == "1")
                    {
                        Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text);
                    }
                }
            }
            ls_tip = "已成功退回到[" + this.txtnexttachename.Value + "]环节";
            hylcthtscl(sql);//特殊处理
        }

        //多人处理
        if (this.txtwhichoperation.Value == "5")
        {
            //更新主文档
            string ls_newclrid = Hyoa_global.MoveOneString_dh(this.hy_curclrid.Text, this.Session["hyuid"].ToString());
            string ls_newclrname = Hyoa_global.MoveOneString_dh(this.hy_curclrname.Text, this.Session["hyuname"].ToString());
            sql += ",hy_curclrid='" + ls_newclrid + "'";
            sql += ",hy_curclrname='" + ls_newclrname + "'";
            //处理处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            ls_tip = "提交成功,当前环节还需要[" + ls_newclrname + "]进行办理";
            hylcdrcltscl(sql);//特殊处理
        }

        //催办
        if (this.txtwhichoperation.Value == "6")
        {
            string cb_docid = this.txtdocid.Value;
            string cb_dbrid = this.hy_curclrid.Text;
            string cb_dbrname = this.hy_curclrname.Text;
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1";
            string cb_property = "催办";
            string cb_mudelid = this.hy_mudelid.Text;
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = this.txtcbideas.Value + "-" + this.hy_bt.Text;
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = this.hy_flowid.Text;
            string cb_tacheid = this.hy_curtacheid.Text;
            string cb_from = this.hy_mudelid.Text;

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(cb_fsrid);
            //得到接收人手机号
            string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(cb_dbrid);

            //给当前处理人发送一个新的待办事宜(提醒)
            Hyoa_global.Senddbsy_global(cb_docid, cb_dbrid, cb_dbrname, cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, cb_ifyb, cb_flowid, cb_tacheid, this.hy_tableid.Text);
            //给当前处理人发送即时消息(提醒)
            if (this.txtisSendjstx.Value == "1")
            {
                Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, cb_dbrid, cb_dbrname, cb_from, cb_bt, 0, this.hy_tableid.Text);
            }
            //给当前处理人发送短信(提醒)
            if (this.txtisSendsms.Value == "1")
            {
                Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, cb_dbrid, cb_dbrname, cb_jsrsjh, cb_from, cb_bt, 1, "", "", 0, this.hy_tableid.Text);
            }

            ls_tip = "催办成功!";
            hylccbtscl(sql);//特殊处理
        }

        //流程结束时的提交
        if (this.txtwhichoperation.Value == "7")
        {
            //更新主文档
            sql += ",hy_curtacheid='**'";
            sql += ",hy_curtachename='结束'";
            sql += ",hy_curclrid=''";
            sql += ",hy_curclrname=''";
            //更新处理表
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            ////流程结束时删除所有该文档对应的待办事宜
            //HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            //Hyoa_dbsy.Deletebydocid(this.txtdocid.Value);

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            ls_tip = "流程结束!";
            hylcjstscl(sql);//特殊处理
        }

        //收文阅件分发
        if (this.txtwhichoperation.Value == "8")
        {
            string cb_docid = this.txtdocid.Value;
            string cb_dbrid = this.hy_curclrid.Text;
            string cb_dbrname = this.hy_curclrname.Text;
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1";
            string cb_property = "待阅";
            string cb_mudelid = this.hy_mudelid.Text;
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = this.hy_bt.Text;
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = this.hy_flowid.Text;
            string cb_tacheid = this.hy_curtacheid.Text;
            string cb_from = this.hy_mudelid.Text;

            string[] lv_dbrid = this.txtswly_dbsy_userids.Text.Split(new Char[] { '+' });
            string[] lv_dbrname = this.txtswly_dbsy_usernames.Text.Split(new Char[] { '+' });
            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到当前用户手机号
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                    //得到后续处理人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());

                    //给后续处理人发送一个新的待办事宜(提醒)
                    Hyoa_global.Senddbsy_global(cb_docid, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, 0, cb_flowid, cb_tacheid, this.hy_tableid.Text);
                    //给后续处理人发送即时消息(提醒)
                    Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_mudelid, cb_bt, 0, this.hy_tableid.Text);
                    //给后续处理人发送短信(提醒)
                    Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, cb_mudelid, cb_bt, 1, "", "", 0, this.hy_tableid.Text);

                    //在hyp_flowhistoryinfo_cy中添加传阅信息
                    string sql_cy = "select * from hyp_flowhistoryinfo_cy where DOCID='" + this.txtdocid.Value + "' and hy_cyrid='" + lv_dbrid[i] + "' order by hy_createtime DESC ";
                    DataTable dt_cy = Hyoa_global.GetDataTable(sql_cy);
                    if (dt_cy.Rows.Count > 0)
                    {
                    }
                    else
                    {
                        HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                        Hyoa_flowhistoryinfo_cy.ID = Hyoa_global.GetRandom();
                        Hyoa_flowhistoryinfo_cy.DOCID = this.txtdocid.Value;
                        Hyoa_flowhistoryinfo_cy.hy_flowid = this.hy_flowid.Text;
                        Hyoa_flowhistoryinfo_cy.hy_flowname = this.hy_flowname.Text;
                        Hyoa_flowhistoryinfo_cy.hy_tacheid = this.hy_curtacheid.Text;
                        Hyoa_flowhistoryinfo_cy.hy_tachename = this.hy_curtachename.Text;
                        Hyoa_flowhistoryinfo_cy.hy_cyrid = lv_dbrid[i];
                        Hyoa_flowhistoryinfo_cy.hy_cyrname = lv_dbrname[i];
                        Hyoa_flowhistoryinfo_cy.hy_ydsj = "";
                        Hyoa_flowhistoryinfo_cy.hy_createtime = System.DateTime.Now.ToString();
                        Hyoa_flowhistoryinfo_cy.Insert();
                    }
                }
            }
            //在当前环节处理的记录中添加传阅信息,主要用于列表的显示控制
            string sql_cl = "select * from hyp_flowhistoryinfo_cl where DOCID='" + this.txtdocid.Value + "' order by hy_createtime DESC ";
            DataTable dt_cl = Hyoa_global.GetDataTable(sql_cl);
            if (dt_cl.Rows.Count > 0)
            {
                if (dt_cl.Rows[0]["hy_cyrid"].ToString() == "")
                {
                    sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid='" + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "',hy_cyrname='" + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + "' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    Hyoa_global.ExcuteSQL(sql_cl);
                }
                else
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid=hy_cyrid+'," + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "',hy_cyrname=hy_cyrname+'," + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + "' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid=CONCAT(hy_cyrid,'," + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "'),hy_cyrname=CONCAT(hy_cyrname,'," + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + ")' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    }
                    Hyoa_global.ExcuteSQL(sql_cl);
                }
            }
            ls_tip = "阅件分发成功!";
        }

        //在主表单内嵌列表的功能中,保存、提交和确认子表单时,需要将父文档的DOCID保存到当前记录的hy_motherid中
        //ADD BY XF 2011-11-17
        if (this.txtwhichoperation.Value == "1" || this.txtwhichoperation.Value == "2" || this.txtwhichoperation.Value == "111")
        {
            if (Request.QueryString["op"] != null)
            {
                if (Request.QueryString["op"].ToString() != "")
                {
                    if (Request.QueryString["motherid"] != null)
                    {
                        if (Request.QueryString["motherid"].ToString() != "")
                        {
                            sql += ",hy_motherid='" + Request.QueryString["motherid"].ToString() + "'";
                        }
                    }
                }
            }
        }

        sql += " where DOCID='" + this.txtdocid.Value + "'";
        Hyoa_global.ExcuteSQL(sql);

        //处理完成后的提示及跳转(增加刷新附件功能)
        if (this.txtifsxfj.Text == "1")
        {
            Response.Write("<script>window.location='wap_main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>");
        }
        else
        {
            if (this.txtifpop.Value == "")
            {
                Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
            }
            else
            {
                Response.Write("<script>alert('" + ls_tip + "');window.location='wap_list.aspx?mid=dbsy'</script>");
            }
        }
    }
コード例 #19
0
    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
        //{
        //    this.tddeldoc.Visible = true; //删除
        //}
        //else
        //{
        //    this.tddeldoc.Visible = false; //删除
        //}

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

        DataTable dt;
        dt = Hyoa_dbsy.Getdbsys_dy(Session["hyuid"].ToString());

        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("mudelname", typeof(String));
        tempTable.Columns.Add(col);

        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];
            }
            //根据模块ID得到模块名称
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_mudelid"].ToString());
            if(dt_mudel.Rows.Count>0)
                dr["mudelname"] = dt_mudel.Rows[0]["hy_mudelname"].ToString();

            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();
    }
コード例 #20
0
ファイル: main.aspx.cs プロジェクト: wjszxli/Webapp
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        //新建时先进行一次保存
        HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
        if (this.txtop.Value == "add")
        {
            #region 字段信息
            Hyoa_flowmain.DOCID = this.txtdocid.Value;
            Hyoa_flowmain.hy_mudelid = this.hy_mudelid.Text;
            Hyoa_flowmain.hy_tableid = this.hy_tableid.Text;
            Hyoa_flowmain.hy_flowid = this.hy_flowid.Text;
            Hyoa_flowmain.hy_flowname = this.hy_flowname.Text;
            Hyoa_flowmain.hy_curtacheid = this.hy_curtacheid.Text;
            Hyoa_flowmain.hy_curtachename = this.hy_curtachename.Text;
            Hyoa_flowmain.hy_curclrid = this.hy_curclrid.Text;
            Hyoa_flowmain.hy_curclrname = this.hy_curclrname.Text;
            Hyoa_flowmain.hy_djrid = this.hy_djrid.Text;
            Hyoa_flowmain.hy_djrname = this.hy_djrname.Text;
            Hyoa_flowmain.hy_djrbmid = this.hy_djrbmid.Text;
            Hyoa_flowmain.hy_djrbmname = this.hy_djrbmname.Text;
            Hyoa_flowmain.hy_djsj = this.hy_djsj.Text;

            Hyoa_flowmain.hy_bt = this.hy_bt.Text;

            Hyoa_flowmain.hy_content1 = this.hy_content1.Text;
            Hyoa_flowmain.hy_content2 = this.hy_content2.Text;
            Hyoa_flowmain.hy_content3 = this.hy_content3.Text;
            Hyoa_flowmain.hy_content4 = this.hy_content4.Text;
            Hyoa_flowmain.hy_content5 = this.hy_content5.Text;
            Hyoa_flowmain.hy_content6 = this.hy_content6.Text;
            Hyoa_flowmain.hy_content7 = this.hy_content7.Text;
            Hyoa_flowmain.hy_content8 = this.hy_content8.Text;
            Hyoa_flowmain.hy_content9 = this.hy_content9.Text;
            Hyoa_flowmain.hy_content10 = this.hy_content10.Text;
            Hyoa_flowmain.hy_content11 = this.hy_content11.Text;
            Hyoa_flowmain.hy_content12 = this.hy_content12.Text;
            Hyoa_flowmain.hy_content13 = this.hy_content13.Text;
            Hyoa_flowmain.hy_content14 = this.hy_content14.Text;
            Hyoa_flowmain.hy_content15 = this.hy_content15.Text;

            Hyoa_flowmain.hy_field1 = this.hy_field1.Text;
            Hyoa_flowmain.hy_field2 = this.hy_field2.Text;
            Hyoa_flowmain.hy_field3 = this.hy_field3.Text;
            Hyoa_flowmain.hy_field4 = this.hy_field4.Text;
            Hyoa_flowmain.hy_field5 = this.hy_field5.Text;
            Hyoa_flowmain.hy_field6 = this.hy_field6.Text;
            Hyoa_flowmain.hy_field7 = this.hy_field7.Text;
            Hyoa_flowmain.hy_field8 = this.hy_field8.Text;
            Hyoa_flowmain.hy_field9 = this.hy_field9.Text;
            Hyoa_flowmain.hy_field10 = this.hy_field10.Text;
            Hyoa_flowmain.hy_field11 = this.hy_field11.Text;
            Hyoa_flowmain.hy_field12 = this.hy_field12.Text;
            Hyoa_flowmain.hy_field13 = this.hy_field13.Text;
            Hyoa_flowmain.hy_field14 = this.hy_field14.Text;
            Hyoa_flowmain.hy_field15 = this.hy_field15.Text;
            Hyoa_flowmain.hy_field16 = this.hy_field16.Text;
            Hyoa_flowmain.hy_field17 = this.hy_field17.Text;
            Hyoa_flowmain.hy_field18 = this.hy_field18.Text;
            Hyoa_flowmain.hy_field19 = this.hy_field19.Text;
            Hyoa_flowmain.hy_field20 = this.hy_field20.Text;
            Hyoa_flowmain.hy_field21 = this.hy_field21.Text;
            Hyoa_flowmain.hy_field22 = this.hy_field22.Text;
            Hyoa_flowmain.hy_field23 = this.hy_field23.Text;
            Hyoa_flowmain.hy_field24 = this.hy_field24.Text;
            Hyoa_flowmain.hy_field25 = this.hy_field25.Text;
            Hyoa_flowmain.hy_field26 = this.hy_field26.Text;
            Hyoa_flowmain.hy_field27 = this.hy_field27.Text;
            Hyoa_flowmain.hy_field28 = this.hy_field28.Text;
            Hyoa_flowmain.hy_field29 = this.hy_field29.Text;
            Hyoa_flowmain.hy_field30 = this.hy_field30.Text;
            Hyoa_flowmain.hy_field31 = this.hy_field31.Text;
            Hyoa_flowmain.hy_field32 = this.hy_field32.Text;
            Hyoa_flowmain.hy_field33 = this.hy_field33.Text;
            Hyoa_flowmain.hy_field34 = this.hy_field34.Text;
            Hyoa_flowmain.hy_field35 = this.hy_field35.Text;

            if (this.hy_field36.Text == "")
                Hyoa_flowmain.hy_field36 = 0;
            else
                Hyoa_flowmain.hy_field36 = float.Parse(this.hy_field36.Text);

            if (this.hy_field37.Text == "")
                Hyoa_flowmain.hy_field37 = 0;
            else
                Hyoa_flowmain.hy_field37 = float.Parse(this.hy_field37.Text);

            if (this.hy_field38.Text == "")
                Hyoa_flowmain.hy_field38 = 0;
            else
                Hyoa_flowmain.hy_field38 = float.Parse(this.hy_field38.Text);

            if (this.hy_field39.Text == "")
                Hyoa_flowmain.hy_field39 = 0;
            else
                Hyoa_flowmain.hy_field39 = float.Parse(this.hy_field39.Text);

            if (this.hy_field40.Text == "")
                Hyoa_flowmain.hy_field40 = 0;
            else
                Hyoa_flowmain.hy_field40 = float.Parse(this.hy_field40.Text);

            Hyoa_flowmain.hy_field41 = this.hy_field41.Text;
            Hyoa_flowmain.hy_field42 = this.hy_field42.Text;
            Hyoa_flowmain.hy_field43 = this.hy_field43.Text;
            Hyoa_flowmain.hy_field44 = this.hy_field44.Text;
            Hyoa_flowmain.hy_field45 = this.hy_field45.Text;
            Hyoa_flowmain.hy_field46 = this.hy_field46.Text;
            Hyoa_flowmain.hy_field47 = this.hy_field47.Text;
            Hyoa_flowmain.hy_field48 = this.hy_field48.Text;
            Hyoa_flowmain.hy_field49 = this.hy_field49.Text;
            Hyoa_flowmain.hy_field50 = this.hy_field50.Text;
            Hyoa_flowmain.hy_field51 = this.hy_field51.Text;
            Hyoa_flowmain.hy_field52 = this.hy_field52.Text;
            Hyoa_flowmain.hy_field53 = this.hy_field53.Text;
            Hyoa_flowmain.hy_field54 = this.hy_field54.Text;
            Hyoa_flowmain.hy_field55 = this.hy_field55.Text;
            Hyoa_flowmain.hy_field56 = this.hy_field56.Text;
            Hyoa_flowmain.hy_field57 = this.hy_field57.Text;
            Hyoa_flowmain.hy_field58 = this.hy_field58.Text;
            Hyoa_flowmain.hy_field59 = this.hy_field59.Text;
            Hyoa_flowmain.hy_field60 = this.hy_field60.Text;

            Hyoa_flowmain.hy_field61 = this.hy_field61.Text;
            Hyoa_flowmain.hy_field62 = this.hy_field62.Text;
            Hyoa_flowmain.hy_field63 = this.hy_field63.Text;
            Hyoa_flowmain.hy_field64 = this.hy_field64.Text;
            Hyoa_flowmain.hy_field65 = this.hy_field65.Text;
            Hyoa_flowmain.hy_field66 = this.hy_field66.Text;
            Hyoa_flowmain.hy_field67 = this.hy_field67.Text;
            Hyoa_flowmain.hy_field68 = this.hy_field68.Text;
            Hyoa_flowmain.hy_field69 = this.hy_field69.Text;
            Hyoa_flowmain.hy_field70 = this.hy_field70.Text;

            if (this.hy_field71.Text == "")
                Hyoa_flowmain.hy_field71 = 0;
            else
                Hyoa_flowmain.hy_field71 = float.Parse(this.hy_field71.Text);

            if (this.hy_field72.Text == "")
                Hyoa_flowmain.hy_field72 = 0;
            else
                Hyoa_flowmain.hy_field72 = float.Parse(this.hy_field72.Text);

            if (this.hy_field73.Text == "")
                Hyoa_flowmain.hy_field73 = 0;
            else
                Hyoa_flowmain.hy_field73 = float.Parse(this.hy_field73.Text);

            if (this.hy_field74.Text == "")
                Hyoa_flowmain.hy_field74 = 0;
            else
                Hyoa_flowmain.hy_field74 = float.Parse(this.hy_field74.Text);

            if (this.hy_field75.Text == "")
                Hyoa_flowmain.hy_field75 = 0;
            else
                Hyoa_flowmain.hy_field75 = float.Parse(this.hy_field75.Text);

            if (this.hy_field76.Text == "")
                Hyoa_flowmain.hy_field76 = 0;
            else
                Hyoa_flowmain.hy_field76 = float.Parse(this.hy_field76.Text);

            if (this.hy_field77.Text == "")
                Hyoa_flowmain.hy_field77 = 0;
            else
                Hyoa_flowmain.hy_field77 = float.Parse(this.hy_field77.Text);

            if (this.hy_field78.Text == "")
                Hyoa_flowmain.hy_field78 = 0;
            else
                Hyoa_flowmain.hy_field78 = float.Parse(this.hy_field78.Text);

            if (this.hy_field79.Text == "")
                Hyoa_flowmain.hy_field79 = 0;
            else
                Hyoa_flowmain.hy_field79 = float.Parse(this.hy_field79.Text);

            if (this.hy_field80.Text == "")
                Hyoa_flowmain.hy_field80 = 0;
            else
                Hyoa_flowmain.hy_field80 = float.Parse(this.hy_field80.Text);

            if (this.hy_field81.Text == "")
                Hyoa_flowmain.hy_field81 = 0;
            else
                Hyoa_flowmain.hy_field81 = float.Parse(this.hy_field81.Text);

            if (this.hy_field82.Text == "")
                Hyoa_flowmain.hy_field82 = 0;
            else
                Hyoa_flowmain.hy_field82 = float.Parse(this.hy_field82.Text);

            if (this.hy_field83.Text == "")
                Hyoa_flowmain.hy_field83 = 0;
            else
                Hyoa_flowmain.hy_field83 = float.Parse(this.hy_field83.Text);

            if (this.hy_field84.Text == "")
                Hyoa_flowmain.hy_field84 = 0;
            else
                Hyoa_flowmain.hy_field84 = float.Parse(this.hy_field84.Text);

            if (this.hy_field85.Text == "")
                Hyoa_flowmain.hy_field85 = 0;
            else
                Hyoa_flowmain.hy_field85 = float.Parse(this.hy_field85.Text);

            if (this.hy_field86.Text == "")
                Hyoa_flowmain.hy_field86 = 0;
            else
                Hyoa_flowmain.hy_field86 = float.Parse(this.hy_field86.Text);

            if (this.hy_field87.Text == "")
                Hyoa_flowmain.hy_field87 = 0;
            else
                Hyoa_flowmain.hy_field87 = float.Parse(this.hy_field87.Text);

            if (this.hy_field88.Text == "")
                Hyoa_flowmain.hy_field88 = 0;
            else
                Hyoa_flowmain.hy_field88 = float.Parse(this.hy_field88.Text);

            if (this.hy_field89.Text == "")
                Hyoa_flowmain.hy_field89 = 0;
            else
                Hyoa_flowmain.hy_field89 = float.Parse(this.hy_field89.Text);

            if (this.hy_field90.Text == "")
                Hyoa_flowmain.hy_field90 = 0;
            else
                Hyoa_flowmain.hy_field90 = float.Parse(this.hy_field90.Text);

            if (this.hy_field91.Text == "")
                Hyoa_flowmain.hy_field91 = 0;
            else
                Hyoa_flowmain.hy_field91 = float.Parse(this.hy_field91.Text);

            if (this.hy_field92.Text == "")
                Hyoa_flowmain.hy_field92 = 0;
            else
                Hyoa_flowmain.hy_field92 = float.Parse(this.hy_field92.Text);

            if (this.hy_field93.Text == "")
                Hyoa_flowmain.hy_field93 = 0;
            else
                Hyoa_flowmain.hy_field93 = float.Parse(this.hy_field93.Text);

            if (this.hy_field94.Text == "")
                Hyoa_flowmain.hy_field94 = 0;
            else
                Hyoa_flowmain.hy_field94 = float.Parse(this.hy_field94.Text);

            if (this.hy_field95.Text == "")
                Hyoa_flowmain.hy_field95 = 0;
            else
                Hyoa_flowmain.hy_field95 = float.Parse(this.hy_field95.Text);

            if (this.hy_field96.Text == "")
                Hyoa_flowmain.hy_field96 = 0;
            else
                Hyoa_flowmain.hy_field96 = float.Parse(this.hy_field96.Text);

            if (this.hy_field97.Text == "")
                Hyoa_flowmain.hy_field97 = 0;
            else
                Hyoa_flowmain.hy_field97 = float.Parse(this.hy_field97.Text);

            if (this.hy_field98.Text == "")
                Hyoa_flowmain.hy_field98 = 0;
            else
                Hyoa_flowmain.hy_field98 = float.Parse(this.hy_field98.Text);

            if (this.hy_field99.Text == "")
                Hyoa_flowmain.hy_field99 = 0;
            else
                Hyoa_flowmain.hy_field99 = float.Parse(this.hy_field99.Text);

            if (this.hy_field100.Text == "")
                Hyoa_flowmain.hy_field100 = 0;
            else
                Hyoa_flowmain.hy_field100 = float.Parse(this.hy_field100.Text);

            Hyoa_flowmain.hy_iftx = this.hy_iftx.Text;
            Hyoa_flowmain.hy_zhtxsj = this.hy_zhtxsj.Text;
            Hyoa_flowmain.hy_readuserlist = this.hy_readuserlist.Text;
            #endregion

            Hyoa_flowmain.Insert();

            //插入历史处理表
            HyoaClass.Hyoa_global Hyoa_global_add = new HyoaClass.Hyoa_global();
            Hyoa_global_add.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.hy_curtacheid.Text, this.hy_curtachename.Text, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "", "", "", this.hy_djsj.Text, "");

        }

        #region 更新内容
        Hyoa_flowmain.DOCID = this.txtdocid.Value;
        Hyoa_flowmain.hy_curtacheid = this.hy_curtacheid.Text;
        Hyoa_flowmain.hy_curtachename = this.hy_curtachename.Text;
        Hyoa_flowmain.hy_curclrid = this.hy_curclrid.Text;
        Hyoa_flowmain.hy_curclrname = this.hy_curclrname.Text;

        Hyoa_flowmain.hy_bt = this.hy_bt.Text;

        Hyoa_flowmain.hy_content1 = this.hy_content1.Text;
        Hyoa_flowmain.hy_content2 = this.hy_content2.Text;
        Hyoa_flowmain.hy_content3 = this.hy_content3.Text;
        Hyoa_flowmain.hy_content4 = this.hy_content4.Text;
        Hyoa_flowmain.hy_content5 = this.hy_content5.Text;
        Hyoa_flowmain.hy_content6 = this.hy_content6.Text;
        Hyoa_flowmain.hy_content7 = this.hy_content7.Text;
        Hyoa_flowmain.hy_content8 = this.hy_content8.Text;
        Hyoa_flowmain.hy_content9 = this.hy_content9.Text;
        Hyoa_flowmain.hy_content10 = this.hy_content10.Text;
        Hyoa_flowmain.hy_content11 = this.hy_content11.Text;
        Hyoa_flowmain.hy_content12 = this.hy_content12.Text;
        Hyoa_flowmain.hy_content13 = this.hy_content13.Text;
        Hyoa_flowmain.hy_content14 = this.hy_content14.Text;
        Hyoa_flowmain.hy_content15 = this.hy_content15.Text;

        Hyoa_flowmain.hy_field1 = this.hy_field1.Text;
        Hyoa_flowmain.hy_field2 = this.hy_field2.Text;
        Hyoa_flowmain.hy_field3 = this.hy_field3.Text;
        Hyoa_flowmain.hy_field4 = this.hy_field4.Text;
        Hyoa_flowmain.hy_field5 = this.hy_field5.Text;
        Hyoa_flowmain.hy_field6 = this.hy_field6.Text;
        Hyoa_flowmain.hy_field7 = this.hy_field7.Text;
        Hyoa_flowmain.hy_field8 = this.hy_field8.Text;
        Hyoa_flowmain.hy_field9 = this.hy_field9.Text;
        Hyoa_flowmain.hy_field10 = this.hy_field10.Text;
        Hyoa_flowmain.hy_field11 = this.hy_field11.Text;
        Hyoa_flowmain.hy_field12 = this.hy_field12.Text;
        Hyoa_flowmain.hy_field13 = this.hy_field13.Text;
        Hyoa_flowmain.hy_field14 = this.hy_field14.Text;
        Hyoa_flowmain.hy_field15 = this.hy_field15.Text;
        Hyoa_flowmain.hy_field16 = this.hy_field16.Text;
        Hyoa_flowmain.hy_field17 = this.hy_field17.Text;
        Hyoa_flowmain.hy_field18 = this.hy_field18.Text;
        Hyoa_flowmain.hy_field19 = this.hy_field19.Text;
        Hyoa_flowmain.hy_field20 = this.hy_field20.Text;
        Hyoa_flowmain.hy_field21 = this.hy_field21.Text;
        Hyoa_flowmain.hy_field22 = this.hy_field22.Text;
        Hyoa_flowmain.hy_field23 = this.hy_field23.Text;
        Hyoa_flowmain.hy_field24 = this.hy_field24.Text;
        Hyoa_flowmain.hy_field25 = this.hy_field25.Text;
        Hyoa_flowmain.hy_field26 = this.hy_field26.Text;
        Hyoa_flowmain.hy_field27 = this.hy_field27.Text;
        Hyoa_flowmain.hy_field28 = this.hy_field28.Text;
        Hyoa_flowmain.hy_field29 = this.hy_field29.Text;
        Hyoa_flowmain.hy_field30 = this.hy_field30.Text;
        Hyoa_flowmain.hy_field31 = this.hy_field31.Text;
        Hyoa_flowmain.hy_field32 = this.hy_field32.Text;
        Hyoa_flowmain.hy_field33 = this.hy_field33.Text;
        Hyoa_flowmain.hy_field34 = this.hy_field34.Text;
        Hyoa_flowmain.hy_field35 = this.hy_field35.Text;

        if (this.hy_field36.Text == "")
            Hyoa_flowmain.hy_field36 = 0;
        else
            Hyoa_flowmain.hy_field36 = float.Parse(this.hy_field36.Text);

        if (this.hy_field37.Text == "")
            Hyoa_flowmain.hy_field37 = 0;
        else
            Hyoa_flowmain.hy_field37 = float.Parse(this.hy_field37.Text);

        if (this.hy_field38.Text == "")
            Hyoa_flowmain.hy_field38 = 0;
        else
            Hyoa_flowmain.hy_field38 = float.Parse(this.hy_field38.Text);

        if (this.hy_field39.Text == "")
            Hyoa_flowmain.hy_field39 = 0;
        else
            Hyoa_flowmain.hy_field39 = float.Parse(this.hy_field39.Text);

        if (this.hy_field40.Text == "")
            Hyoa_flowmain.hy_field40 = 0;
        else
            Hyoa_flowmain.hy_field40 = float.Parse(this.hy_field40.Text);

        Hyoa_flowmain.hy_field41 = this.hy_field41.Text;
        Hyoa_flowmain.hy_field42 = this.hy_field42.Text;
        Hyoa_flowmain.hy_field43 = this.hy_field43.Text;
        Hyoa_flowmain.hy_field44 = this.hy_field44.Text;
        Hyoa_flowmain.hy_field45 = this.hy_field45.Text;
        Hyoa_flowmain.hy_field46 = this.hy_field46.Text;
        Hyoa_flowmain.hy_field47 = this.hy_field47.Text;
        Hyoa_flowmain.hy_field48 = this.hy_field48.Text;
        Hyoa_flowmain.hy_field49 = this.hy_field49.Text;
        Hyoa_flowmain.hy_field50 = this.hy_field50.Text;
        Hyoa_flowmain.hy_field51 = this.hy_field51.Text;
        Hyoa_flowmain.hy_field52 = this.hy_field52.Text;
        Hyoa_flowmain.hy_field53 = this.hy_field53.Text;
        Hyoa_flowmain.hy_field54 = this.hy_field54.Text;
        Hyoa_flowmain.hy_field55 = this.hy_field55.Text;
        Hyoa_flowmain.hy_field56 = this.hy_field56.Text;
        Hyoa_flowmain.hy_field57 = this.hy_field57.Text;
        Hyoa_flowmain.hy_field58 = this.hy_field58.Text;
        Hyoa_flowmain.hy_field59 = this.hy_field59.Text;
        Hyoa_flowmain.hy_field60 = this.hy_field60.Text;

        Hyoa_flowmain.hy_field61 = this.hy_field61.Text;
        Hyoa_flowmain.hy_field62 = this.hy_field62.Text;
        Hyoa_flowmain.hy_field63 = this.hy_field63.Text;
        Hyoa_flowmain.hy_field64 = this.hy_field64.Text;
        Hyoa_flowmain.hy_field65 = this.hy_field65.Text;
        Hyoa_flowmain.hy_field66 = this.hy_field66.Text;
        Hyoa_flowmain.hy_field67 = this.hy_field67.Text;
        Hyoa_flowmain.hy_field68 = this.hy_field68.Text;
        Hyoa_flowmain.hy_field69 = this.hy_field69.Text;
        Hyoa_flowmain.hy_field70 = this.hy_field70.Text;

        if (this.hy_field71.Text == "")
            Hyoa_flowmain.hy_field71 = 0;
        else
            Hyoa_flowmain.hy_field71 = float.Parse(this.hy_field71.Text);

        if (this.hy_field72.Text == "")
            Hyoa_flowmain.hy_field72 = 0;
        else
            Hyoa_flowmain.hy_field72 = float.Parse(this.hy_field72.Text);

        if (this.hy_field73.Text == "")
            Hyoa_flowmain.hy_field73 = 0;
        else
            Hyoa_flowmain.hy_field73 = float.Parse(this.hy_field73.Text);

        if (this.hy_field74.Text == "")
            Hyoa_flowmain.hy_field74 = 0;
        else
            Hyoa_flowmain.hy_field74 = float.Parse(this.hy_field74.Text);

        if (this.hy_field75.Text == "")
            Hyoa_flowmain.hy_field75 = 0;
        else
            Hyoa_flowmain.hy_field75 = float.Parse(this.hy_field75.Text);

        if (this.hy_field76.Text == "")
            Hyoa_flowmain.hy_field76 = 0;
        else
            Hyoa_flowmain.hy_field76 = float.Parse(this.hy_field76.Text);

        if (this.hy_field77.Text == "")
            Hyoa_flowmain.hy_field77 = 0;
        else
            Hyoa_flowmain.hy_field77 = float.Parse(this.hy_field77.Text);

        if (this.hy_field78.Text == "")
            Hyoa_flowmain.hy_field78 = 0;
        else
            Hyoa_flowmain.hy_field78 = float.Parse(this.hy_field78.Text);

        if (this.hy_field79.Text == "")
            Hyoa_flowmain.hy_field79 = 0;
        else
            Hyoa_flowmain.hy_field79 = float.Parse(this.hy_field79.Text);

        if (this.hy_field80.Text == "")
            Hyoa_flowmain.hy_field80 = 0;
        else
            Hyoa_flowmain.hy_field80 = float.Parse(this.hy_field80.Text);

        if (this.hy_field81.Text == "")
            Hyoa_flowmain.hy_field81 = 0;
        else
            Hyoa_flowmain.hy_field81 = float.Parse(this.hy_field81.Text);

        if (this.hy_field82.Text == "")
            Hyoa_flowmain.hy_field82 = 0;
        else
            Hyoa_flowmain.hy_field82 = float.Parse(this.hy_field82.Text);

        if (this.hy_field83.Text == "")
            Hyoa_flowmain.hy_field83 = 0;
        else
            Hyoa_flowmain.hy_field83 = float.Parse(this.hy_field83.Text);

        if (this.hy_field84.Text == "")
            Hyoa_flowmain.hy_field84 = 0;
        else
            Hyoa_flowmain.hy_field84 = float.Parse(this.hy_field84.Text);

        if (this.hy_field85.Text == "")
            Hyoa_flowmain.hy_field85 = 0;
        else
            Hyoa_flowmain.hy_field85 = float.Parse(this.hy_field85.Text);

        if (this.hy_field86.Text == "")
            Hyoa_flowmain.hy_field86 = 0;
        else
            Hyoa_flowmain.hy_field86 = float.Parse(this.hy_field86.Text);

        if (this.hy_field87.Text == "")
            Hyoa_flowmain.hy_field87 = 0;
        else
            Hyoa_flowmain.hy_field87 = float.Parse(this.hy_field87.Text);

        if (this.hy_field88.Text == "")
            Hyoa_flowmain.hy_field88 = 0;
        else
            Hyoa_flowmain.hy_field88 = float.Parse(this.hy_field88.Text);

        if (this.hy_field89.Text == "")
            Hyoa_flowmain.hy_field89 = 0;
        else
            Hyoa_flowmain.hy_field89 = float.Parse(this.hy_field89.Text);

        if (this.hy_field90.Text == "")
            Hyoa_flowmain.hy_field90 = 0;
        else
            Hyoa_flowmain.hy_field90 = float.Parse(this.hy_field90.Text);

        if (this.hy_field91.Text == "")
            Hyoa_flowmain.hy_field91 = 0;
        else
            Hyoa_flowmain.hy_field91 = float.Parse(this.hy_field91.Text);

        if (this.hy_field92.Text == "")
            Hyoa_flowmain.hy_field92 = 0;
        else
            Hyoa_flowmain.hy_field92 = float.Parse(this.hy_field92.Text);

        if (this.hy_field93.Text == "")
            Hyoa_flowmain.hy_field93 = 0;
        else
            Hyoa_flowmain.hy_field93 = float.Parse(this.hy_field93.Text);

        if (this.hy_field94.Text == "")
            Hyoa_flowmain.hy_field94 = 0;
        else
            Hyoa_flowmain.hy_field94 = float.Parse(this.hy_field94.Text);

        if (this.hy_field95.Text == "")
            Hyoa_flowmain.hy_field95 = 0;
        else
            Hyoa_flowmain.hy_field95 = float.Parse(this.hy_field95.Text);

        if (this.hy_field96.Text == "")
            Hyoa_flowmain.hy_field96 = 0;
        else
            Hyoa_flowmain.hy_field96 = float.Parse(this.hy_field96.Text);

        if (this.hy_field97.Text == "")
            Hyoa_flowmain.hy_field97 = 0;
        else
            Hyoa_flowmain.hy_field97 = float.Parse(this.hy_field97.Text);

        if (this.hy_field98.Text == "")
            Hyoa_flowmain.hy_field98 = 0;
        else
            Hyoa_flowmain.hy_field98 = float.Parse(this.hy_field98.Text);

        if (this.hy_field99.Text == "")
            Hyoa_flowmain.hy_field99 = 0;
        else
            Hyoa_flowmain.hy_field99 = float.Parse(this.hy_field99.Text);

        if (this.hy_field100.Text == "")
            Hyoa_flowmain.hy_field100 = 0;
        else
            Hyoa_flowmain.hy_field100 = float.Parse(this.hy_field100.Text);

        Hyoa_flowmain.hy_iftx = this.hy_iftx.Text;
        Hyoa_flowmain.hy_zhtxsj = this.hy_zhtxsj.Text;
        Hyoa_flowmain.hy_readuserlist = this.hy_readuserlist.Text;
        #endregion

        //保存
        if (this.txtwhichoperation.Value == "1")
        {
            hylcbctscl(Hyoa_flowmain);//特殊处理

            //效能系统日志20150603
            if (this.txtop.Value == "add")
            {
                hyXnxtSaveLogs("撰写", "表单:" + this.lblcurtachenameshow.Text + "新增一条记录", "新增");
            }
            else if (this.txtop.Value == "modify")
            {
                hyXnxtSaveLogs("修改", "表单:" + this.lblcurtachenameshow.Text + "修改一条记录", "修改");
            }
            if (this.hy_tableid.Text == "f1265875-5494-465f-ac33-6fa43d208c8f" && this.txtop.Value == "add")
            {
                string strAuthor = "";
                string strAuthorDept = "";
                if (this.hy_field6.Text != "")
                {
                    strAuthor += this.hy_field6.Text + ",";
                }
                if (this.hy_field5.Text != "")
                {
                    strAuthorDept += this.hy_field5.Text + ",";
                }
                hyXnxtMessageLogs("录用", "录用一篇文章", strAuthor, strAuthorDept);
            }
        }
        //提交
        if (this.txtwhichoperation.Value == "2")
        {
            //更新主文档
            Hyoa_flowmain.hy_curtacheid = this.txtnexttacheid.Value;
            Hyoa_flowmain.hy_curtachename = this.txtnexttachename.Value;
            Hyoa_flowmain.hy_curclrid = this.txtnextclrid.Value;
            Hyoa_flowmain.hy_curclrname = this.txtnextclrname.Value;

            //---- 添加当前环节的处理时间 ---- start
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocidtacheid(this.txtdocid.Value, this.hy_curtacheid.Text);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = System.DateTime.Now.ToString();
                }
                else
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();
                }
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //---- 添加当前环节的处理时间 ---- end

            //---  创建后续处理的处理记录+建立处理人待办事宜 ---- start
            Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", this.txtnextcyrid.Value, this.txtnextcyrname.Value, System.DateTime.Now.ToString(), "");

            //待办事宜、短信、即时消息
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' });
            string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' });
            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到当前用户手机号
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                    //得到后续处理人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());

                    //给后续处理人发送一个新的待办事宜(提醒)
                    Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "/main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value);
                    //给后续处理人发送即时消息(提醒)
                    if (this.txtisSendjstx_clr.Value == "1")
                    {
                        Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0);
                    }
                    //给后续处理人发送短信(提醒)
                    if (this.txtisSendsms_clr.Value == "1")
                    {
                        Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0);
                    }
                }
            }
            //--- 创建后续处理的处理记录+建立处理人待办事宜 ---- end

            //--- 创建后续传阅记录+建立待办事宜 ---- start
            string[] lv_cyrid = this.txtnextcyrid.Value.Split(new Char[] { ',' });
            string[] lv_cyrname = this.txtnextcyrname.Value.Split(new Char[] { ',' });

            for (var i = 0; i < lv_cyrid.Length; i++)
            {
                if (lv_cyrid[i].ToString() != "")
                {
                    //建立传阅数据
                    Hyoa_global.Saveflowhistoryinfo_cy_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), "", System.DateTime.Now.ToString());
                    //待办事宜、短信、即时消息
                    //得到当前用户手机号
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                    //得到后续传阅人手机号
                    string cb_cyrsjh = Hyoa_user.GetMobilebyuserid(lv_cyrid[i].ToString());

                    //给后续处理人发送一个新的待办事宜(提醒)
                    Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "/main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待阅", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请阅读", 0, this.hy_flowid.Text, this.txtnexttacheid.Value);
                    //给后续处理人发送即时消息(提醒)
                    if (this.txtisSendjstx_cyr.Value == "1")
                    {
                        Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0);
                    }
                    //给后续处理人发送短信(提醒)
                    if (this.txtisSendsms_cyr.Value == "1")
                    {
                        Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), cb_cyrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0);
                    }

                }
            }
            //效能办公系统传阅数据
            hyXnxtFlowLogs("文章发送给" + this.txtnextcyrname.Value + "阅读", "传阅");
            //--- 创建后续传阅记录+建立待办事宜 ---- end

            //--- 当前处理人的待办事宜转已办 ---- start
            Hyoa_dbsy.Dbsytoybbydocidtacheiduserid(this.txtdocid.Value, this.hy_curtacheid.Text, this.Session["hyuid"].ToString());
            //--- 当前处理人的待办事宜转已办 ---- end

            ls_tip = "文档已成功发送到[" + this.txtnexttachename.Value + "]环节";
            hylctjtscl(Hyoa_flowmain);//特殊处理
        }
        //收回
        if (this.txtwhichoperation.Value == "3")
        {
            //得到上个环节处理人
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 1)
            {
                //删除当前处理人员的待办事宜
                HyoaClass.Hyoa_dbsy Hyoa_dbsy_sh = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy_sh.DeleteByDocid_flowid_tacheid_userid(this.txtdocid.Value, dt_clinfo.Rows[0]["hy_flowid"].ToString(), dt_clinfo.Rows[0]["hy_tacheid"].ToString(), dt_clinfo.Rows[0]["hy_clrid"].ToString());

                string ls_lastclrid = dt_clinfo.Rows[1]["hy_clrid"].ToString();         //上个环节处理人ID
                string ls_lastclrname = dt_clinfo.Rows[1]["hy_clrname"].ToString();     //上个环节处理人中文名
                string ls_lastcldoc = dt_clinfo.Rows[1]["ID"].ToString();               //上个环节处理的记录ID
                string ls_lasttacheid = dt_clinfo.Rows[1]["hy_tacheid"].ToString();     //上个环节处理环节ID
                string ls_lasttachename = dt_clinfo.Rows[1]["hy_tachename"].ToString(); //上个环节处理环节名称
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                dt_clinfo.Clear();

                //删除当前处理的记录
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.Delete();
                //清空上个环节处理时间,更新创建时间
                Hyoa_flowhistoryinfo_cl.ID = ls_lastcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = "";
                Hyoa_flowhistoryinfo_cl.hy_createtime = System.DateTime.Now.ToString();
                Hyoa_flowhistoryinfo_cl.Update_sh();
                //更新主文档中的当前环节ID、当前环节名称、当前处理人ID和中文名
                Hyoa_flowmain.hy_curtacheid = ls_lasttacheid;
                Hyoa_flowmain.hy_curtachename = ls_lasttachename;
                Hyoa_flowmain.hy_curclrid = ls_lastclrid;
                Hyoa_flowmain.hy_curclrname = ls_lastclrname;

                ls_tip = "文档已成功收回到[" + ls_lasttachename + "]环节";
                //绩效考核日志
                hyXnxtFlowLogs("从" + this.hy_curtachename.Text + "环节收回到" + ls_lasttachename + "", "收回");
                hylcshtscl(Hyoa_flowmain);//特殊处理
            }
        }
        //退回
        if (this.txtwhichoperation.Value == "4")
        {
            //更新主文档
            Hyoa_flowmain.hy_curtacheid = this.txtnexttacheid.Value;
            Hyoa_flowmain.hy_curtachename = this.txtnexttachename.Value;
            Hyoa_flowmain.hy_curclrid = this.txtnextclrid.Value;
            Hyoa_flowmain.hy_curclrname = this.txtnextclrname.Value;

            //处理历史处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //新建一条处理记录
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", "", "", System.DateTime.Now.ToString(), "是");

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());

            //(考虑多人的情况)
            string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' });
            string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' });

            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到接收人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());
                    HyoaClass.Hyoa_global Hyoa_global2 = new HyoaClass.Hyoa_global();

                    //给退回到的处理人发送一个新的待办事宜(提醒)
                    Hyoa_global2.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "/main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value);
                    //给退回到的处理人发送即时消息(提醒)
                    if (this.txtisSendjstx.Value == "1")
                    {
                        Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0);
                    }
                    //给退回到的处理人发送短信(提醒)
                    if (this.txtisSendsms.Value == "1")
                    {
                        Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0);
                    }
                }
            }
            //绩效考核写日志  add by wjs at 20150603
            hyXnxtFlowLogs("从" + this.hy_curtachename.Text + "环节退回到" + this.txtnexttachename.Value + "", "退回");

            ls_tip = "已成功退回到[" + this.txtnexttachename.Value + "]环节";
            hylcthtscl(Hyoa_flowmain);//特殊处理
        }
        //多人处理
        if (this.txtwhichoperation.Value == "5")
        {
            //更新主文档
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string ls_newclrid = Hyoa_global.MoveOneString_dh(this.hy_curclrid.Text, this.Session["hyuid"].ToString());
            string ls_newclrname = Hyoa_global.MoveOneString_dh(this.hy_curclrname.Text, this.Session["hyuname"].ToString());
            Hyoa_flowmain.hy_curclrid = ls_newclrid;
            Hyoa_flowmain.hy_curclrname = ls_newclrname;
            //处理处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();

                //办公效率智能分析添加  add by wjs at 20150603
                hyXnxtFlowLogs("从" + this.hy_curtachename.Text + "环节提交到" + this.txtnexttachename.Value + "环节", "提交");
            }
            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            ls_tip = "提交成功,当前环节还需要[" + ls_newclrname + "]进行办理";
            hylcdrcltscl(Hyoa_flowmain);//特殊处理
        }
        //催办
        if (this.txtwhichoperation.Value == "6")
        {
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

            string cb_docid = this.txtdocid.Value;
            string cb_dbrid = this.hy_curclrid.Text;
            string cb_dbrname = this.hy_curclrname.Text;
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "main.aspx?op=modify&docid=" + this.txtdocid.Value + "&pop=1";
            string cb_property = "催办";
            string cb_mudelid = this.hy_mudelid.Text;
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = this.txtcbideas.Value + "-" + this.hy_bt.Text;
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = this.hy_flowid.Text;
            string cb_tacheid = this.hy_curtacheid.Text;
            string cb_from = this.hy_mudelid.Text;

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(cb_fsrid);
            //得到接收人手机号
            string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(cb_dbrid);

            //给当前处理人发送一个新的待办事宜(提醒)
            Hyoa_global.Senddbsy_global(cb_docid, cb_dbrid, cb_dbrname, cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, cb_ifyb, cb_flowid, cb_tacheid);
            //给当前处理人发送即时消息(提醒)
            if (this.txtisSendjstx.Value == "1")
            {
                Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, cb_dbrid, cb_dbrname, cb_from, cb_bt, 0);
            }
            //给当前处理人发送短信(提醒)
            if (this.txtisSendsms.Value == "1")
            {
                Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, cb_dbrid, cb_dbrname, cb_jsrsjh, cb_from, cb_bt, 1, "", "", 0);
            }
            //绩效考核写日志  add by wjs at 20150603
            hyXnxtFlowLogs("催办" + this.hy_curtachename.Text + "环节", "催办");
            ls_tip = "催办成功!";
            hylccbtscl(Hyoa_flowmain);//特殊处理
        }

        //流程结束时的提交
        if (this.txtwhichoperation.Value == "7")
        {
            //更新主文档
            Hyoa_flowmain.hy_curtacheid = "**";
            Hyoa_flowmain.hy_curtachename = "结束";
            Hyoa_flowmain.hy_curclrid = "";
            Hyoa_flowmain.hy_curclrname = "";
            //更新处理表
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            ////流程结束时删除所有该文档对应的待办事宜
            //HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            //Hyoa_dbsy.Deletebydocid(this.txtdocid.Value);

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            ls_tip = "流程结束!";
            hylcjstscl(Hyoa_flowmain);//特殊处理
            hyXnxtFlowLogs("流程结束,文件已归档", "归档");
            if (this.hy_tableid.Text == "1a564b74-3d94-4cef-bb94-f0c0342ae8dd")
            {
                string strAuthor = "";
                string strAuthorDept = "";
                if (this.hy_field2.Text != "")
                {
                    strAuthor += this.hy_field2.Text + ",";
                }
                if (this.hy_field3.Text != "")
                {
                    strAuthorDept += this.hy_field3.Text + ",";
                }
                if (this.hy_field4.Text != "")
                {
                    strAuthor += this.hy_field4.Text + ",";
                }
                if (this.hy_field5.Text != "")
                {
                    strAuthorDept += this.hy_field5.Text + ",";
                }
                if (this.hy_field6.Text != "")
                {
                    strAuthor += this.hy_field6.Text + ",";
                }
                if (this.hy_field7.Text != "")
                {
                    strAuthorDept += this.hy_field7.Text + ",";
                }
                hyXnxtMessageLogs("通过", "通过一篇文章", strAuthor, strAuthorDept);
            }
        }

        Hyoa_flowmain.Update();

        ////处理完成后的提示及跳转(增加刷新附件功能)
        if (this.txtifsxfj.Text == "1")
        {
            //Response.Write("<script>window.location='/main.aspx?op=modify&mid="+this.hy_mudelid.Text+"&tableid="+this.hy_tableid.Text+"&docid="+this.txtdocid.Value+"&url="+this.txturl.Value+"'</script>");
            Response.Write("<script>window.location='/main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>");
        }
        else
        {
            if (this.txtifpop.Value == "")
            {
                Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
            }
            else
            {
                Response.Write("<script>alert('" + ls_tip + "');window.opener.location.reload();window.opener=null;window.open('','_self');window.close();</script>");
            }
        }
    }
コード例 #21
0
    private void DataPlay()
    {
        //hy_json = "{\"success\":true,\"total\":\"60\",\"rows\":[{\"hy_mudelid\":\"111\",\"hy_mudelname\":\"1111\",\"hy_roleid\":\"111111\",\"hy_qqroleid\":\"111111\",\"hy_isenabled\":\"111111\"}]}";
        string hy_json = "";
        string ls_success = "true";    //调用方法成功
        string ls_flag = "0";   //删除失败
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string txtuids = "";
        if (this.Request.Form["txtuids"] != null)
            txtuids = this.Request.Form["txtuids"].ToString();

        string txttableid = "";
        if (this.Request.Form["txttableid"] != null)
            txttableid = this.Request.Form["txttableid"].ToString();

        String[] v_uids = txtuids.Split(',');
        string ls_filepath = "";
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                string sql = "delete from hyc_" + txttableid + " where DOCID='" + v_uids[i] + "'";
                Hyoa_global.ExcuteSQL(sql);

                //删除文档时将待办事宜删除start
                HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy.DOCID = v_uids[i];
                Hyoa_dbsy.Deletebydocid(v_uids[i]);
                //删除文档时将待办事宜删除end

                //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start   add by xf 20121016
                HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
                Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i];
                Hyoa_flowhistoryinfo_cl.DeleteByDOCID();
                HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i];
                Hyoa_flowhistoryinfo_cy.DeleteByDOCID();
                //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end

                //删的时候将附件也删除start
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
                if (dtfileatt.Rows.Count > 0)
                {
                    for (int k = 0; k < dtfileatt.Rows.Count; k++)
                    {
                        ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                        if (File.Exists(ls_filepath))
                        {
                            System.IO.File.Delete(ls_filepath);
                        }
                        Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                        Hyoa_fileatt.Delete();
                    }
                }
                //删的时候将附件也删除end

                //生成删除日志 start
                string ls_oppcontent = "表名:hyc_" + txttableid + ";文档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
                ls_flag = "1";
            }
        }
        hy_json = "{\"success\":" + ls_success + ",\"flag\":\"" + ls_flag + "\"}";
        Response.Write(hy_json);
    }
コード例 #22
0
    public string Gethy_field(string ls_num)
    {
        string ls_return = "";
        string ls_show = "";    //这个区域的内容
        string ls_temp = "";
        string lstitle = "";
        string ls_url = "";
        string ls_sql = "";
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //得到待办事宜
        if (ls_num == "1")
        {
            ls_show = "待办事宜";    //这个区域的内容
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            DataTable dt = Hyoa_dbsy.Getdbsys_dbanddy(this.Session["hyuid"].ToString());
            int i = 5;  //显示条数
            if (dt.Rows.Count < i)
                i = dt.Rows.Count;

            for (int j = 0; j < i; j++)
            {
                string ls_mudelid = dt.Rows[j]["hy_mudelid"].ToString();
                string ls_mudelname = "";
                DataTable dt_getmudel = Hyoa_mudel.Getmudel(ls_mudelid);
                if (dt_getmudel.Rows.Count > 0)
                    ls_mudelname = dt_getmudel.Rows[0]["hy_mudelname"].ToString();

                lstitle = "[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString();
                if (lstitle.Length > 20)
                    lstitle = lstitle.Substring(0, 20) + "...";

                ls_url = "ggdy/Hy_DbToYb.aspx?id=" + dt.Rows[j]["ID"].ToString() + "&pop=1&rnd=" + System.Guid.NewGuid().ToString();
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a title=\"" + "[" + ls_mudelname + "]" + dt.Rows[j]["hy_subbt"].ToString() + "-" + dt.Rows[j]["hy_bt"].ToString() + "\" onclick=\"window.open('" + ls_url + "')\" href=\"javascript:\"><b>" + lstitle + "</b></a></td>";
                ls_temp += "<td width=\"28%\" align=\"right\">";
                ls_temp += "<font color=\"#056ea5\">" + System.DateTime.Parse(dt.Rows[j]["hy_createtime"].ToString()).ToShortDateString().ToString() + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_1\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_1_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            ls_return += "<a href=\"#\" onclick=\"window.open('system/list_dbsy.aspx')\"><font color=\"red\">";
            ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到电子邮件
        if (ls_num == "2")
        {
            ls_show = "最新客户";    //这个区域的内容
            ls_sql = "select * from hyc_Tablekhda  order by  hy_djsj  desc ";
            DataTable dt = Hyoa_global.GetDataTable(ls_sql);
            int i = 5;  //显示条数
            if (dt.Rows.Count < i)
                i = dt.Rows.Count;

            for (int j = 0; j < i; j++)
            {
                lstitle = dt.Rows[j]["hyc_dwmc"].ToString();
                if (lstitle.Length > 20)
                    lstitle = lstitle.Substring(0, 20) + "...";

                ls_url = "main_look.aspx?op=modify&mid=Mudelkhda&tableid=Tablekhda&pop=1&docid=" + dt.Rows[j]["DOCID"].ToString();
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a title=\"" + lstitle + "\" onclick=\"window.open('" + ls_url + "&rnd='+Math.random())\" href=\"javascript:\">·&nbsp;" + lstitle + "</a></td>";
                ls_temp += "<td width=\"28%\" align=\"right\"></td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_2\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_2_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            ls_return += "<a href=\"#\" onclick=\"window.open('list_flc.aspx?mid=Mudelkhda&tableid=Tablekhda&listid=d3044ced-8273-4e7a-83b2-870580dde7a1&rnd='+Math.random())\"><font color=\"red\">";
            ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到日程安排
        if (ls_num == "3")
        {
            ls_show = "最新客户故障";    //这个区域的内容
            ls_sql = "select * from hyc_Tablekhgzdj where hy_djrid='" + Session["hyuid"].ToString() + "' order by hy_djsj desc ";
            DataTable dt = Hyoa_global.GetDataTable(ls_sql);
            int i = 5;  //显示条数
            if (dt.Rows.Count < i)
                i = dt.Rows.Count;

            for (int j = 0; j < i; j++)
            {
                lstitle = dt.Rows[j]["hyc_dwmc"].ToString();
                if (lstitle.Length > 20)
                    lstitle = lstitle.Substring(0, 20) + "...";

                ls_url = "main_look.aspx?op=modify&mid=Mudelkhda&tableid=Tablekhgzdj&pop=1&docid=" + dt.Rows[j]["DOCID"].ToString();
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a title=\"" + dt.Rows[j]["hyc_dwmc"].ToString() + "\" onclick=\"window.open('" + ls_url + "&rnd='+Math.random())\" href=\"javascript:\">" + lstitle + "</a></td>";
                ls_temp += "<td width=\"28%\" align=\"right\">";
                ls_temp += "<font color=\"#056ea5\">" + System.DateTime.Parse(dt.Rows[j]["hy_djsj"].ToString()).ToShortDateString().ToString() + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_3\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_3_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            ls_return += "<a href=\"#\" onclick=\"window.open('list_flc.aspx?mid=Mudelkhda&tableid=Tablekhgzdj&listid=afbdf289-c511-4b91-a2c7-bdb4d510ca78&rnd='+Math.random())\"><font color=\"red\">";
            ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到通知公告
        if (ls_num == "4")
        {
            ls_show = "最新合同";    //这个区域的内容
            Dictionary<string, DateTime> dic = new Dictionary<string, DateTime>();
            string sqlSelect = "";
            //合同表单id
            string[] arryStr = new string[] { "Tablesyyhfwxy", "Tablejdhazfwht", "TableVODfwxy", "Tableffpdfwht", "TableDVBazfwdght", "Tablejwdsjsxy", "Tablejwdscsxy", "Tablekdjrht", "Tablesjcsfwht", "Tablesjgdcsfwht", "Tablesjtxyyhzxy", "Tablezdyht" };
            //将所有表单的登记时间和DOCID Tableid放入集合中
            for (int i = 0; i < arryStr.Length; i++)
            {
                sqlSelect = " select docid,hy_djsj from hyc_" + arryStr[i] + " order by hy_djsj desc ";
                DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
                //获取每个表单一个的表单id 表名  和登记时间
                if (dt.Rows.Count > 0)
                {
                    dic.Add(dt.Rows[0]["docid"].ToString() + "#" + arryStr[i], Convert.ToDateTime(dt.Rows[0]["hy_djsj"].ToString()));
                }
            }
            //开始对登记时间进行排序
            string[] arrayName = new string[dic.Count];
            DateTime[] arrayValue = new DateTime[dic.Count];
            dic.Keys.CopyTo(arrayName, 0);
            dic.Values.CopyTo(arrayValue, 0);
            //会根据arrayValue的值进行升序排序,arrayName对应的会进行位置调整
            Array.Sort(arrayValue, arrayName);
            //降序
            Array.Reverse(arrayValue);
            Array.Reverse(arrayName);
            //重新将值放到新的集合中
            IDictionary<string, DateTime> dicSorted = new Dictionary<string, DateTime>();
            for (int i = 0; i < arrayName.Length; i++)
            {
                dicSorted.Add(arrayName[i], dic[arrayName[i]]);
            }
            //定义一个数组 通过循环 将key放入数组中
            string[] Docid = new string[dicSorted.Count];
            int j = 0;
            foreach (string lsDocid in dicSorted.Keys)
            {
                Docid[j] = lsDocid;
                j++;
            }
            //取集合前六个的值  通过数组中存储的key对集合进行删除操作
            if (Docid.Length > 5)
            {
                for (int i = 5; i < Docid.Length; i++)
                {
                    dicSorted.Remove(Docid[i]);
                }
            }
            //对集合前六个合同进行数据加工 输出到前台
            foreach (string lsDocid in dicSorted.Keys)
            {
                string lsTitle = "";
                string[] lsData = lsDocid.Split('#');
                sqlSelect = " select * from hyc_" + lsData[1] + " where docid ='" + lsData[0] + "' ";
                DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
                sqlSelect = " select hy_name from hyt_tableconfig where id='" + lsData[1] + "' ";
                DataTable dt2 = Hyoa_global.GetDataTable_BASE(sqlSelect);
                if (dt.Rows.Count > 0 && dt2.Rows.Count > 0)
                {
                    lsTitle = "[" + dt2.Rows[0]["hy_name"].ToString() + "]-" + dt.Rows[0]["hyc_jfmc"].ToString();
                    if (lsTitle.Length > 20)
                        lsTitle = lsTitle.Substring(0, 20) + "...";

                    ls_temp += "<tr>";
                    ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                    ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                    ls_temp += "<tbody>";
                    ls_temp += "<tr>";
                    ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"#\" onclick=\" var path='main_look.aspx?op=modify&mid=" + dt.Rows[0]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[0]["hy_tableid"].ToString() + "&docid=" + dt.Rows[0]["docid"].ToString() + " ';window.open(path) \" >&middot;" + lsTitle + "</a></td>";
                    ls_temp += "<td width=\"28%\" align=\"right\">";
                    ls_temp += "<font color=\"#056ea5\">" + System.DateTime.Parse(dt.Rows[0]["hy_djsj"].ToString()).ToShortDateString().ToString() + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                    ls_temp += "</tr>";
                    ls_temp += "</tbody>";
                    ls_temp += "</table>";
                    ls_temp += "</td>";
                    ls_temp += "</tr>";
                }
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_4\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_4_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            //ls_return += "<a href=\"#\" onclick=\"window.open('list_fl.aspx?key=%u5DF2%u53D1%u5E03&mid=Mudeltzgg&tableid=Tabletzgg&listid=fe10af45-e302-4e56-911e-e73fae37cf5a&rnd=c70a7237-f92f-4d9d-8bd3-e343efba54e3&rnd='+Math.random())\"><font color=\"red\">";
            //ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到会议动态
        if (ls_num == "5")
        {
            ls_show = "即将过期合同";    //这个区域的内容
            int j = 0;
            string sqlSelect = "";
            //合同表单id
            string[] arryStr = new string[] { "Tablesyyhfwxy", "Tablejdhazfwht", "TableVODfwxy", "Tableffpdfwht", "TableDVBazfwdght", "Tablejwdsjsxy", "Tablejwdscsxy", "Tablekdjrht", "Tablesjcsfwht", "Tablesjgdcsfwht", "Tablesjtxyyhzxy" };
            for (int i = 0; i < arryStr.Length; i++)
            {
                sqlSelect = " select * from hyc_" + arryStr[i] + " ";
                DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
                string lsTitle = "";
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["hyc_htzzsj"].ToString() != "")
                    {
                        if ((Convert.ToDateTime(dt.Rows[0]["hyc_htzzsj"].ToString()).AddDays(-5) >= Convert.ToDateTime(DateTime.Now)))
                        {
                            sqlSelect = " select hy_name from hyt_tableconfig where id='" + arryStr[i] + "' ";
                            DataTable dt2 = Hyoa_global.GetDataTable_BASE(sqlSelect);
                            if (dt2.Rows.Count > 0)
                            {
                                lsTitle = "[" + dt2.Rows[0]["hy_name"].ToString() + "]-" + dt.Rows[0]["hyc_jfmc"].ToString();
                                if (lsTitle.Length > 20)
                                    lsTitle = lsTitle.Substring(0, 20) + "...";
                                ls_temp += "<tr>";
                                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                                ls_temp += "<tbody>";
                                ls_temp += "<tr>";
                                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"#\" onclick=\" var path='main_look.aspx?op=modify&mid=" + dt.Rows[0]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[0]["hy_tableid"].ToString() + "&docid=" + dt.Rows[0]["docid"].ToString() + " ';window.open(path) \" >&middot;" + lsTitle + "</a></td>";
                                ls_temp += "<td width=\"28%\" align=\"right\">";
                                ls_temp += "<font color=\"#056ea5\">" + System.DateTime.Parse(dt.Rows[0]["hy_djsj"].ToString()).ToShortDateString().ToString() + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                                ls_temp += "</tr>";
                                ls_temp += "</tbody>";
                                ls_temp += "</table>";
                                ls_temp += "</td>";
                                ls_temp += "</tr>";
                                j++;
                            }
                        }
                    }
                }
                if (j == 5)
                {
                    break;
                }
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_5\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_5_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            //ls_return += "<a href=\"#\" onclick=\"window.open('list.aspx?mid=Mudelhydt&tableid=Tablehydt&listid=72aeaf0e-5387-46c1-a329-654147c634f0&rnd='+Math.random())\"><font color=\"red\">";
            //ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }
        //得到公文库
        if (ls_num == "6")
        {
            ls_show = "已过期合同";    //这个区域的内容
            string sqlSelect = "";
            int j = 0;
            //合同表单id
            string[] arryStr = new string[] { "Tablesyyhfwxy", "Tablejdhazfwht", "TableVODfwxy", "Tableffpdfwht", "TableDVBazfwdght", "Tablejwdsjsxy", "Tablejwdscsxy", "Tablekdjrht", "Tablesjcsfwht", "Tablesjgdcsfwht", "Tablesjtxyyhzxy" };
            for (int i = 0; i < arryStr.Length; i++)
            {
                sqlSelect = " select * from hyc_" + arryStr[i] + " order by hyc_htzzsj desc ";
                DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
                string lsTitle = "";
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["hyc_htzzsj"].ToString() != "")
                    {
                        if ((Convert.ToDateTime(dt.Rows[0]["hyc_htzzsj"].ToString()) < Convert.ToDateTime(DateTime.Now)))
                        {
                            sqlSelect = " select hy_name from hyt_tableconfig where id='" + arryStr[i] + "' ";
                            DataTable dt2 = Hyoa_global.GetDataTable_BASE(sqlSelect);
                            if (dt2.Rows.Count > 0)
                            {
                                lsTitle = "[" + dt2.Rows[0]["hy_name"].ToString() + "]-" + dt.Rows[0]["hyc_jfmc"].ToString();
                                if (lsTitle.Length > 20)
                                    lsTitle = lsTitle.Substring(0, 20) + "...";
                                ls_temp += "<tr>";
                                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                                ls_temp += "<tbody>";
                                ls_temp += "<tr>";
                                ls_temp += "<td width=\"72%\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"#\" onclick=\" var path='main_look.aspx?op=modify&mid=" + dt.Rows[0]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[0]["hy_tableid"].ToString() + "&docid=" + dt.Rows[0]["docid"].ToString() + " ';window.open(path) \" >&middot;" + lsTitle + "</a></td>";
                                ls_temp += "<td width=\"28%\" align=\"right\">";
                                ls_temp += "<font color=\"#056ea5\">" + Convert.ToDateTime(dt.Rows[0]["hy_djsj"].ToString()).ToString("yyyy/MM/dd") + "</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                                ls_temp += "</tr>";
                                ls_temp += "</tbody>";
                                ls_temp += "</table>";
                                ls_temp += "</td>";
                                ls_temp += "</tr>";
                                j++;
                            }
                        }
                    }
                }
                if (j == 5)
                {
                    break;
                }
            }
            if (ls_temp == "")
            {
                ls_temp += "<tr>";
                ls_temp += "<td height=\"22\" background=\"hyhtml/desk/line.gif\">";
                ls_temp += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                ls_temp += "<tbody>";
                ls_temp += "<tr>";
                ls_temp += "<td width=\"100%\">&nbsp;&nbsp;&nbsp;&nbsp;暂无记录!</td>";
                ls_temp += "</tr>";
                ls_temp += "</tbody>";
                ls_temp += "</table>";
                ls_temp += "</td>";
                ls_temp += "</tr>";
            }

            ls_return += "<div style=\"position: relative; padding-bottom: 0px\" id=\"module_6\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"height: 160px;border-bottom: 1px solid #cccccc\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td height=\"25\">";
            ls_return += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
            ls_return += "<tbody>";
            ls_return += "<tr>";
            ls_return += "<td style=\"cursor: move; color: #262d33; font-weight: bold\" id=\"module_6_head\" class=\"Navigation\" width=\"72%\">&nbsp;<img align=\"absMiddle\" src=\"hyhtml/images/ico/FUNC20029.gif\"> " + ls_show + "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</td>";
            ls_return += "</tr>";

            ls_return += ls_temp;

            ls_return += "<tr>";
            ls_return += "<td height=\"22\" align=\"right\">";
            //ls_return += "<a href=\"#\" onclick=\"window.open('gwk/index.aspx?rnd='+Math.random())\"><font color=\"red\">";
            //ls_return += "    更多&gt;&gt;..</font></a>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "<tr>";
            ls_return += "<td>";
            ls_return += "</td>";
            ls_return += "</tr>";
            ls_return += "</tbody>";
            ls_return += "</table>";
            ls_return += "</div>";
            ls_return += "<div>";
            ls_return += "</div>";
        }

        return ls_return;
    }
コード例 #23
0
    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

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

        DataTable dt;
        string sql = "select * from hyt_dbsy where hy_property='待阅' and hy_ifyb=1 and hy_subbt='[流程已结束]' and hy_dbrid='" + Session["hyuid"].ToString() + "' order by hy_createtime desc";
        dt = Hyoa_global.GetDataTable(sql);

        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("mudelname", typeof(String));
        tempTable.Columns.Add(col);

        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];
            }
            //根据模块ID得到模块名称
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_mudelid"].ToString());
            if(dt_mudel.Rows.Count>0)
                dr["mudelname"] = dt_mudel.Rows[0]["hy_mudelname"].ToString();

            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();
    }
コード例 #24
0
ファイル: main.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    //////////置为文档已读状态
    ////////private void UpdateReadFlag()
    ////////{
    ////////    HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
    ////////    Hyoa_flowmain.UpdateReadFlag(this.txtdocid.Value, Session["hyuid"].ToString());
    ////////}
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        //新建时先进行一次保存
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
        if (this.txtop.Value == "add")
        {
            //Hyoa_flowmain.DOCID = this.txtdocid.Value;
            //Hyoa_flowmain.hy_mudelid = this.hy_mudelid.Text;
            //Hyoa_flowmain.hy_tableid = this.hy_tableid.Text;
            //Hyoa_flowmain.hy_flowid = this.hy_flowid.Text;
            //Hyoa_flowmain.hy_flowname = this.hy_flowname.Text;
            //Hyoa_flowmain.hy_curtacheid = this.hy_curtacheid.Text;
            //Hyoa_flowmain.hy_curtachename = this.hy_curtachename.Text;
            //Hyoa_flowmain.hy_curclrid = this.hy_curclrid.Text;
            //Hyoa_flowmain.hy_curclrname = this.hy_curclrname.Text;
            //Hyoa_flowmain.hy_djrid = this.hy_djrid.Text;
            //Hyoa_flowmain.hy_djrname = this.hy_djrname.Text;
            //Hyoa_flowmain.hy_djrbmid = this.hy_djrbmid.Text;
            //Hyoa_flowmain.hy_djrbmname = this.hy_djrbmname.Text;
            //Hyoa_flowmain.hy_djsj = this.hy_djsj.Text;

            //Hyoa_flowmain.hy_bt = this.hy_bt.Text;

            //Hyoa_flowmain.hy_iftx = this.hy_iftx.Text;
            //Hyoa_flowmain.hy_zhtxsj = this.hy_zhtxsj.Text;
            //Hyoa_flowmain.hy_readuserlist = this.hy_readuserlist.Text;

            //Hyoa_flowmain.Insert();
            //动态插入数据
            //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string lssqlfield = "SELECT * FROM hyt_flowfield WHERE (hy_tableid = 'Tabledcxt') AND (hy_mudelid = 'Mudeldcxt')";
            DataTable dtfield = Hyoa_global.GetDataTable_BASE(lssqlfield); //得到所有配置域
            string lssqlinsert = "";
            string lssqlinsert1 = "";
            string lssqlinsert2 = "";
            string lssqlinsert3 = "";
            string lssqlinsert4 = "";
            string lssqlinsert5 = "";
            lssqlinsert1 = "insert into hyc_" + this.hy_tableid.Text + "(";
            lssqlinsert2 = "DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_iftx,hy_zhtxsj,hy_readuserlist";
            lssqlinsert3 = ") values (";
            lssqlinsert4 = "'" + this.txtdocid.Value + "'";
            lssqlinsert4 += ",'" + this.hy_mudelid.Text + "'";
            lssqlinsert4 += ",'" + this.hy_tableid.Text + "'";
            lssqlinsert4 += ",'" + this.hy_flowid.Text + "'";
            lssqlinsert4 += ",'" + this.hy_flowname.Text + "'";
            lssqlinsert4 += ",'" + this.hy_curtacheid.Text + "'";
            lssqlinsert4 += ",'" + this.hy_curtachename.Text + "'";
            lssqlinsert4 += ",'" + this.hy_curclrid.Text + "'";
            lssqlinsert4 += ",'" + this.hy_curclrname.Text + "'";
            lssqlinsert4 += ",'" + this.hy_djrid.Text + "'";
            lssqlinsert4 += ",'" + this.hy_djrname.Text + "'";
            lssqlinsert4 += ",'" + this.hy_djrbmid.Text + "'";
            lssqlinsert4 += ",'" + this.hy_djrbmname.Text + "'";
            if (Session["conntype"].ToString() == "SQL")
            {
                lssqlinsert4 += ",'"+this.hy_djsj.Text + "'";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                lssqlinsert4 += ",to_date('" + this.hy_djsj.Text + "','YYYY-MM-DD HH24:MI:SS')";
            }
            lssqlinsert4 += ",'" + this.hy_bt.Text + "'";
            lssqlinsert4 += ",'" + this.hy_iftx.Text + "'";
            lssqlinsert4 += ",'" + this.hy_zhtxsj.Text + "'";
            lssqlinsert4 += ",'" + this.hy_readuserlist.Text+"'";
            lssqlinsert5 = ")";
            for (int ii = 0; ii < dtfield.Rows.Count; ii++)
            {
                lssqlinsert2 += "," + "hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString();

                if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "文本" || dtfield.Rows[ii]["hy_fieldtype"].ToString() == "多行文本")
                {
                    TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                    lssqlinsert4 += ",'" + txt1.Text + "'";
                }
                if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "日期")
                {
                    TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        lssqlinsert4 += ",'" + txt1.Text + "'";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        lssqlinsert4 += ",to_date('" + txt1.Text + "','YYYY-MM-DD HH24:MI:SS')";
                    }
                }
                if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "对话框列表")
                {
                    DropDownList ddl1 = (DropDownList)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                    lssqlinsert4 += ",'" + ddl1.SelectedValue + "'";
                }
            }

            lssqlinsert = lssqlinsert1 + lssqlinsert2 + lssqlinsert3 + lssqlinsert4 + lssqlinsert5;
            //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            //Response.Write(lssqlinsert);
            Hyoa_global.ExcuteSQL(lssqlinsert);

            //插入历史处理表
            HyoaClass.Hyoa_global Hyoa_global_add = new HyoaClass.Hyoa_global();
            Hyoa_global_add.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.hy_curtacheid.Text, this.hy_curtachename.Text, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "", "", "", this.hy_djsj.Text, "");

        }

        //更新内容
        //Hyoa_flowmain.DOCID = this.txtdocid.Value;
        //Hyoa_flowmain.hy_curtacheid = this.hy_curtacheid.Text;
        //Hyoa_flowmain.hy_curtachename = this.hy_curtachename.Text;
        //Hyoa_flowmain.hy_curclrid = this.hy_curclrid.Text;
        //Hyoa_flowmain.hy_curclrname = this.hy_curclrname.Text;
        //Hyoa_flowmain.hy_bt = this.hy_bt.Text;

        //Hyoa_flowmain.hy_iftx = this.hy_iftx.Text;
        //Hyoa_flowmain.hy_zhtxsj = this.hy_zhtxsj.Text;
        //Hyoa_flowmain.hy_readuserlist = this.hy_readuserlist.Text;

        string lssqlfield2 = "SELECT * FROM hyt_flowfield WHERE (hy_tableid = 'Tabledcxt') AND (hy_mudelid = 'Mudeldcxt')";
        DataTable dtfield2 = Hyoa_global.GetDataTable_BASE(lssqlfield2); //得到所有配置域
        string lssqlupdate1 = "update hyc_" + this.hy_tableid.Text + " set hy_curtacheid = '" + this.hy_curtacheid.Text + "'";
        lssqlupdate1 += ",hy_curtachename='" + this.hy_curtachename.Text + "'";
        lssqlupdate1 += ",hy_curclrid='" + this.hy_curclrid.Text + "'";
        lssqlupdate1 += ",hy_curclrname='" + this.hy_curclrname.Text + "'";
        lssqlupdate1 += ",hy_bt='" + this.hy_bt.Text + "'";
        for (int ii = 0; ii < dtfield2.Rows.Count; ii++)
        {
           if (dtfield2.Rows[ii]["hy_fieldtype"].ToString() == "文本" || dtfield2.Rows[ii]["hy_fieldtype"].ToString() == "多行文本" || dtfield2.Rows[ii]["hy_fieldtype"].ToString() == "日期")
            {
                TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield2.Rows[ii]["hy_fieldid"].ToString());

                lssqlupdate1 += ",hyc_" + dtfield2.Rows[ii]["hy_fieldid"].ToString() + "='" + txt1.Text + "'";

            }
            if (dtfield2.Rows[ii]["hy_fieldtype"].ToString() == "对话框列表")
            {
                DropDownList ddl1 = (DropDownList)this.FindControl("txthyc_" + dtfield2.Rows[ii]["hy_fieldid"].ToString());
                lssqlupdate1 += ",hyc_" + dtfield2.Rows[ii]["hy_fieldid"].ToString() + "='" + ddl1.SelectedValue + "'";
            }
        }
        lssqlupdate1 += " where DOCID='" + this.txtdocid.Value + "'";
        Hyoa_global.ExcuteSQL(lssqlupdate1);

        //更新hy_bt字段
        string sql_updatebt = "";
        if (Session["conntype"].ToString() == "SQL")
        {
            sql_updatebt = "update hyc_" + this.hy_tableid.Text + " set hy_bt = '['+hyc_nf+']'+hyc_bh+'号' where DOCID='" + this.txtdocid.Value + "'";
        }
        if (Session["conntype"].ToString() == "ORACLE")
        {
            sql_updatebt = "update hyc_" + this.hy_tableid.Text + " set hy_bt = CONCAT(CONCAT(CONCAT(CONCAT('[',hyc_nf),']'),hyc_bh),'号') where DOCID='" + this.txtdocid.Value + "'";
        }
        Hyoa_global.ExcuteSQL(sql_updatebt);
        sql_updatebt = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "' ";
        DataTable dt_updatebt = Hyoa_global.GetDataTable(sql_updatebt);
        if (dt_updatebt.Rows.Count > 0)
            this.hy_bt.Text = dt_updatebt.Rows[0]["hy_bt"].ToString();

        //保存
        if (this.txtwhichoperation.Value == "1")
        {
            hylcbctscl();//特殊处理
        }
        //提交
        if (this.txtwhichoperation.Value == "2")
        {
            //更新主文档
            lssqlupdate1 = "update hyc_" + this.hy_tableid.Text +" set hy_curtacheid='" + this.txtnexttacheid.Value + "'";
            lssqlupdate1 += ",hy_curtachename='" + this.txtnexttachename.Value + "'";
            lssqlupdate1 += ",hy_curclrid='" + this.txtnextclrid.Value + "'";
            lssqlupdate1 += ",hy_curclrname='" + this.txtnextclrname.Value + "'";
            lssqlupdate1 += " where DOCID='" + this.txtdocid.Value + "'";
            Hyoa_global.ExcuteSQL(lssqlupdate1);
            //Hyoa_flowmain.hy_curtacheid = this.txtnexttacheid.Value;
            //Hyoa_flowmain.hy_curtachename = this.txtnexttachename.Value;
            //Hyoa_flowmain.hy_curclrid = this.txtnextclrid.Value;
            //Hyoa_flowmain.hy_curclrname = this.txtnextclrname.Value;

            //---- 添加当前环节的处理时间 ---- start
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocidtacheid(this.txtdocid.Value, this.hy_curtacheid.Text);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = System.DateTime.Now.ToString();
                }
                else
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();
                }
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //---- 添加当前环节的处理时间 ---- end

            //---  创建后续处理的处理记录+建立处理人待办事宜 ---- start
            Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", this.txtnextcyrid.Value, this.txtnextcyrname.Value, System.DateTime.Now.ToString(), "");

            //待办事宜、短信、即时消息
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' });
            string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' });
            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到当前用户手机号
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                    //得到后续处理人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());
                    string ls_sendbt;
                    if (this.txtnexttacheid.Value == "tache0002")
                    {
                        //ls_sendbt = "有督查件:《区政府政务督查通知单〔" + this.hy_field36.Text + "〕" + this.hy_field37.Text + "号》,请在区政府信息督查系统查收并于" + this.hy_field34.Text.ToString() + "前按要求及时反馈。";
                        if (this.txthyc_lb.SelectedValue == "办件")
                        {
                            ls_sendbt = "《督查通知单〔" + this.txthyc_nf.Text + "〕" + this.txthyc_bh.Text + "号》已发,请尽快查收并于" + this.txthyc_cbqx.Text.ToString() + "前按要求反馈。";
                            //《区政府督查通知单〔2012〕235号》已发,请尽快查收并于2012-08-10前按要求反馈。
                        }
                        else
                        {
                            ls_sendbt = "有" + this.txthyc_lb.SelectedValue + ":《督查通知单〔" + this.txthyc_nf.Text + "〕" + this.txthyc_bh.Text + "号》已发,请及时查收并转交领导。";
                            //有重要阅件:《区政府督查通知单〔2012〕235号》已发,请及时查收并转交领导。
                        }
                    }
                    else
                    {
                        ls_sendbt = this.hy_bt.Text;
                    }
                    //给后续处理人发送一个新的待办事宜(提醒)
                    Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "zwdc/main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                    //给后续处理人发送即时消息(提醒)
                    if (this.txtisSendjstx_clr.Value == "1")
                    {
                        Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, ls_sendbt, 0, this.hy_tableid.Text);
                    }
                    //给后续处理人发送短信(提醒)
                    if (this.txtisSendsms_clr.Value == "1")
                    {
                        Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, ls_sendbt, 1, "", "", 0, this.hy_tableid.Text);
                    }
                }
            }
            //--- 创建后续处理的处理记录+建立处理人待办事宜 ---- end

            //--- 创建后续传阅记录+建立待办事宜 ---- start
            string[] lv_cyrid = this.txtnextcyrid.Value.Split(new Char[] { ',' });
            string[] lv_cyrname = this.txtnextcyrname.Value.Split(new Char[] { ',' });
            for (var i = 0; i < lv_cyrid.Length; i++)
            {
                if (lv_cyrid[i].ToString() != "")
                {
                    //建立传阅数据
                    Hyoa_global.Saveflowhistoryinfo_cy_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), "", System.DateTime.Now.ToString());

                    //待办事宜、短信、即时消息
                    //得到当前用户手机号
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                    //得到后续传阅人手机号
                    string cb_cyrsjh = Hyoa_user.GetMobilebyuserid(lv_cyrid[i].ToString());
                    string ls_sendbt;
                    if (this.txtnexttacheid.Value == "tache0002")
                    {
                        if (this.txthyc_lb.SelectedValue == "办件")
                        {
                            ls_sendbt = "《督查通知单〔" + this.txthyc_nf.Text + "〕" + this.txthyc_bh.Text + "号》已发,请尽快查收并于" + this.txthyc_cbqx.Text.ToString() + "前按要求反馈。";
                            //《区政府督查通知单〔2012〕235号》已发,请尽快查收并于2012-08-10前按要求反馈。
                        }
                        else
                        {
                            ls_sendbt = "有" + this.txthyc_lb.SelectedValue + ":《督查通知单〔" + this.txthyc_nf.Text + "〕" + this.txthyc_bh.Text + "号》已发,请及时查收并转交领导。";
                            //有重要阅件:《区政府督查通知单〔2012〕235号》已发,请及时查收并转交领导。
                        }
                    }
                    else
                    {
                        ls_sendbt = this.txthyc_dcsx.Text;
                    }
                    //给后续处理人发送一个新的待办事宜(提醒)
                    Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "zwdc/main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待阅", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请阅读", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                    //给后续处理人发送即时消息(提醒)
                    if (this.txtisSendjstx_cyr.Value == "1")
                    {
                        Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.hy_mudelid.Text, ls_sendbt, 0, this.hy_tableid.Text);
                    }
                    //给后续处理人发送短信(提醒)
                    if (this.txtisSendsms_cyr.Value == "1")
                    {
                        Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), cb_cyrsjh, this.hy_mudelid.Text, ls_sendbt, 1, "", "", 0, this.hy_tableid.Text);
                    }

                }
            }
            //--- 创建后续传阅记录+建立待办事宜 ---- end

            //--- 当前处理人的待办事宜转已办 ---- start
            Hyoa_dbsy.Dbsytoybbydocidtacheiduserid(this.txtdocid.Value, this.hy_curtacheid.Text, this.Session["hyuid"].ToString());
            //--- 当前处理人的待办事宜转已办 ---- end

            ls_tip = "文档已成功发送到[" + this.txtnexttachename.Value + "]环节";
            hylctjtscl();//特殊处理
        }
        //收回
        if (this.txtwhichoperation.Value == "3")
        {
            //得到上个环节处理人
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 1)
            {
                //删除当前处理人员的待办事宜
                HyoaClass.Hyoa_dbsy Hyoa_dbsy_sh = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy_sh.DeleteByDocid_flowid_tacheid_userid(this.txtdocid.Value, dt_clinfo.Rows[0]["hy_flowid"].ToString(), dt_clinfo.Rows[0]["hy_tacheid"].ToString(), dt_clinfo.Rows[0]["hy_clrid"].ToString());

                string ls_lastclrid = dt_clinfo.Rows[1]["hy_clrid"].ToString();         //上个环节处理人ID
                string ls_lastclrname = dt_clinfo.Rows[1]["hy_clrname"].ToString();     //上个环节处理人中文名
                string ls_lastcldoc = dt_clinfo.Rows[1]["ID"].ToString();               //上个环节处理的记录ID
                string ls_lasttacheid = dt_clinfo.Rows[1]["hy_tacheid"].ToString();     //上个环节处理环节ID
                string ls_lasttachename = dt_clinfo.Rows[1]["hy_tachename"].ToString(); //上个环节处理环节名称
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                dt_clinfo.Clear();

                //删除当前处理的记录
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.Delete();
                //清空上个环节处理时间,更新创建时间
                Hyoa_flowhistoryinfo_cl.ID = ls_lastcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = "";
                Hyoa_flowhistoryinfo_cl.hy_createtime = System.DateTime.Now.ToString();
                Hyoa_flowhistoryinfo_cl.Update_sh();
                //更新主文档中的当前环节ID、当前环节名称、当前处理人ID和中文名
                lssqlupdate1 = "update hyc_" + this.hy_tableid.Text + " set hy_curtacheid='" + ls_lasttacheid + "'";
                lssqlupdate1 += ",hy_curtachename='" + ls_lasttachename + "'";
                lssqlupdate1 += ",hy_curclrid='" + ls_lastclrid + "'";
                lssqlupdate1 += ",hy_curclrname='" + ls_lastclrname + "'";
                lssqlupdate1 += " where DOCID='" + this.txtdocid.Value + "'";
                Hyoa_global.ExcuteSQL(lssqlupdate1);
                //Hyoa_flowmain.hy_curtacheid = ls_lasttacheid;
                //Hyoa_flowmain.hy_curtachename = ls_lasttachename;
                //Hyoa_flowmain.hy_curclrid = ls_lastclrid;
                //Hyoa_flowmain.hy_curclrname = ls_lastclrname;

                ls_tip = "文档已成功收回到[" + ls_lasttachename + "]环节";
                hylcshtscl();//特殊处理
            }
        }
        //退回
        if (this.txtwhichoperation.Value == "4")
        {
            //更新主文档
            //Hyoa_flowmain.hy_curtacheid = this.txtnexttacheid.Value;
            //Hyoa_flowmain.hy_curtachename = this.txtnexttachename.Value;
            //Hyoa_flowmain.hy_curclrid = this.txtnextclrid.Value;
            //Hyoa_flowmain.hy_curclrname = this.txtnextclrname.Value;
            lssqlupdate1 = "update hyc_" + this.hy_tableid.Text + " set hy_curtacheid='" + this.txtnexttacheid.Value + "'";
            lssqlupdate1 += ",hy_curtachename='" + this.txtnexttachename.Value + "'";
            lssqlupdate1 += ",hy_curclrid='" + this.txtnextclrid.Value + "'";
            lssqlupdate1 += ",hy_curclrname='" + this.txtnextclrname.Value + "'";
            lssqlupdate1 += " where DOCID='" + this.txtdocid.Value + "'";
            Hyoa_global.ExcuteSQL(lssqlupdate1);

            //处理历史处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //新建一条处理记录
            //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", "", "", System.DateTime.Now.ToString(), "是");

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
            string ls_sendbt;
            if (this.txtnexttacheid.Value == "tache0002")
            {
                if (this.txthyc_lb.SelectedValue == "办件")
                {
                    ls_sendbt = "《督查通知单〔" + this.txthyc_nf.Text + "〕" + this.txthyc_bh.Text + "号》已发,请尽快查收并于" + this.txthyc_cbqx.Text.ToString() + "前按要求反馈。";
                    //《区政府督查通知单〔2012〕235号》已发,请尽快查收并于2012-08-10前按要求反馈。
                }
                else
                {
                    ls_sendbt = "有" + this.txthyc_lb.Text + ":《督查通知单〔" + this.txthyc_nf.Text + "〕" + this.txthyc_bh.Text + "号》已发,请及时查收并转交领导。";
                    //有重要阅件:《区政府督查通知单〔2012〕235号》已发,请及时查收并转交领导。
                }
            }
            else
            {
                ls_sendbt = this.hy_bt.Text;
            }
            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());

            //(考虑多人的情况)
            string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' });
            string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' });

            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到接收人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());
                    HyoaClass.Hyoa_global Hyoa_global2 = new HyoaClass.Hyoa_global();

                    //给退回到的处理人发送一个新的待办事宜(提醒)
                    Hyoa_global2.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "zwdc/main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text);
                    //给退回到的处理人发送即时消息(提醒)
                    if (this.txtisSendjstx.Value == "1")
                    {
                        Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, ls_sendbt, 0, this.hy_tableid.Text);
                    }
                    //给退回到的处理人发送短信(提醒)
                    if (this.txtisSendsms.Value == "1")
                    {
                        Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, ls_sendbt, 1, "", "", 0, this.hy_tableid.Text);
                    }
                }
            }
            ls_tip = "已成功退回到[" + this.txtnexttachename.Value + "]环节";
            hylcthtscl();//特殊处理
        }
        //多人处理
        if (this.txtwhichoperation.Value == "5")
        {
            //更新主文档
            //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string ls_newclrid = Hyoa_global.MoveOneString_dh(this.hy_curclrid.Text, this.Session["hyuid"].ToString());
            string ls_newclrname = Hyoa_global.MoveOneString_dh(this.hy_curclrname.Text, this.Session["hyuname"].ToString());

            lssqlupdate1 = "update hyc_" + this.hy_tableid.Text + " set hy_curclrid='" + ls_newclrid + "'";
            lssqlupdate1 += ",hy_curclrname='" + ls_newclrname + "'";
            lssqlupdate1 += " where DOCID='" + this.txtdocid.Value + "'";
            Hyoa_global.ExcuteSQL(lssqlupdate1);
            //Hyoa_flowmain.hy_curclrid = ls_newclrid;
            //Hyoa_flowmain.hy_curclrname = ls_newclrname;
            //处理处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            ls_tip = "提交成功,当前环节还需要[" + ls_newclrname + "]进行办理";
            hylcdrcltscl();//特殊处理
        }
        //催办
        if (this.txtwhichoperation.Value == "6")
        {
            //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

            string cb_docid = this.txtdocid.Value;
            string cb_dbrid = this.hy_curclrid.Text;
            string cb_dbrname = this.hy_curclrname.Text;
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "zwdc/main.aspx?op=modify&docid=" + this.txtdocid.Value + "&pop=1";
            string cb_property = "催办";
            string cb_mudelid = this.hy_mudelid.Text;
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = this.txtcbideas.Value + "-" + this.hy_bt.Text;
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = this.hy_flowid.Text;
            string cb_tacheid = this.hy_curtacheid.Text;
            string cb_from = this.hy_mudelid.Text;

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(cb_fsrid);
            //得到接收人手机号
            string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(cb_dbrid);

            //给当前处理人发送一个新的待办事宜(提醒)
            Hyoa_global.Senddbsy_global(cb_docid, cb_dbrid, cb_dbrname, cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, cb_ifyb, cb_flowid, cb_tacheid, this.hy_tableid.Text);
            //给当前处理人发送即时消息(提醒)
            if (this.txtisSendjstx.Value == "1")
            {
                Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, cb_dbrid, cb_dbrname, cb_from, cb_bt, 0, this.hy_tableid.Text);
            }
            //给当前处理人发送短信(提醒)
            if (this.txtisSendsms.Value == "1")
            {
                Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, cb_dbrid, cb_dbrname, cb_jsrsjh, cb_from, cb_bt, 1, "", "", 0, this.hy_tableid.Text);
            }

            ls_tip = "催办成功!";
            hylccbtscl();//特殊处理
        }

        //流程结束时的提交
        if (this.txtwhichoperation.Value == "7")
        {
            //更新主文档
            lssqlupdate1 = "update hyc_" + this.hy_tableid.Text + " set hy_curtacheid='" + "**" + "'";
            lssqlupdate1 += ",hy_curtachename='" + "结束" + "'";
            lssqlupdate1 += ",hy_curclrid='" + "" + "'";
            lssqlupdate1 += ",hy_curclrname='" + "" + "'";
            lssqlupdate1 += " where DOCID='" + this.txtdocid.Value + "'";
            Hyoa_global.ExcuteSQL(lssqlupdate1);
            //Hyoa_flowmain.hy_curtacheid = "**";
            //Hyoa_flowmain.hy_curtachename = "结束";
            //Hyoa_flowmain.hy_curclrid = "";
            //Hyoa_flowmain.hy_curclrname = "";
            //更新处理表
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString();
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString();

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            ////流程结束时删除所有该文档对应的待办事宜
            //HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            //Hyoa_dbsy.Deletebydocid(this.txtdocid.Value);

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());

            ls_tip = "流程结束!";
            hylcjstscl();//特殊处理
        }

        lssqlupdate1 += " where DOCID='" + this.txtdocid.Value + "'";
        //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        Hyoa_global.ExcuteSQL(lssqlupdate1);
        //Hyoa_flowmain.Update();

        //处理完成后的提示及跳转(增加刷新附件功能)
        if (this.txtifsxfj.Text == "1")
        {
            Response.Write("<script>window.location='zwdc/main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>");
        }
        else
        {
            if (this.txtifpop.Value == "")
            {
                Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
            }
            else
            {
                Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
            }
        }
    }
コード例 #25
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>");
        }
    }
コード例 #26
0
 //得到待办事宜数
 protected void getdbsys()
 {
     HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
     DataTable dt = Hyoa_dbsy.Getdbsys_dbanddy(Session["hyuid"].ToString());
     this.lbldbsys.Text = dt.Rows.Count.ToString();
 }
コード例 #27
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] != "")
            {

                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));
    }
コード例 #28
0
ファイル: list_zb.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        String[] v_uids = this.txtuids.Value.Split(',');
        string ls_filepath = "";
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                string sql = "delete from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'";
                Hyoa_global.ExcuteSQL(sql);

                //删除文档时将待办事宜删除start
                HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy.DOCID = v_uids[i];
                Hyoa_dbsy.Deletebydocid(v_uids[i]);
                //删除文档时将待办事宜删除end

                //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start   add by xf 20121016
                HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
                Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i];
                Hyoa_flowhistoryinfo_cl.DeleteByDOCID();
                HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i];
                Hyoa_flowhistoryinfo_cy.DeleteByDOCID();
                //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end

                //删的时候将附件也删除start
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
                if (dtfileatt.Rows.Count > 0)
                {
                    for (int k = 0; k < dtfileatt.Rows.Count; k++)
                    {
                        ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                        if (File.Exists(ls_filepath))
                        {
                            System.IO.File.Delete(ls_filepath);
                        }
                        Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                        Hyoa_fileatt.Delete();
                    }
                }
                //删的时候将附件也删除end

                //生成删除日志 start
                string ls_oppcontent = "表名:hyc_" + txttableid.Value + ";文档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));
    }
コード例 #29
0
    //保存
    private void DataPlay()
    {
        //hy_json = "{\"success\":true,\"total\":\"60\",\"rows\":[{\"hy_mudelid\":\"111\",\"hy_mudelname\":\"1111\",\"hy_roleid\":\"111111\",\"hy_qqroleid\":\"111111\",\"hy_isenabled\":\"111111\"}]}";
        string hy_json = "";
        string ls_success = "true";    //调用方法成功
        string ls_flag = "0";   //失败
        string ls_tip = "保存成功!";
        string txtop = "";
        if (Request.Form["txtop"] != null)
            txtop = Request.Form["txtop"].ToString();

        string hy_bt = "";
        if (Request.Form["hy_bt"] != null)
            hy_bt = Request.Form["hy_bt"].ToString();

        //新文档时
        //新建时先进行一次保存
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string sql = "";
        if (txtop == "add")
        {
            //处理特殊字符
            hy_bt = ReplaceString_Tszf(hy_bt);
            if (Session["conntype"].ToString() == "SQL")
            {
                //edited by xf 20140625
                sql = "insert into hyc_" + Request.Form["hy_tableid"].ToString() + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values (";
                sql += "'" + Request.Form["txtdocid"].ToString() + "','" + Request.Form["hy_mudelid"].ToString() + "','" + Request.Form["hy_tableid"].ToString() + "','" + Request.Form["hy_flowid"].ToString() + "','" + Request.Form["hy_flowname"].ToString() + "'";
                sql += ",'" + Request.Form["hy_curtacheid"].ToString() + "','" + Request.Form["hy_curtachename"].ToString() + "','" + Request.Form["hy_curclrid"].ToString() + "','" + Request.Form["hy_curclrname"].ToString() + "','" + Request.Form["hy_djrid"].ToString() + "'";
                sql += ",'" + Request.Form["hy_djrname"].ToString() + "','" + Request.Form["hy_djrbmid"].ToString() + "','" + Request.Form["hy_djrbmname"].ToString() + "','" + Request.Form["hy_djsj"].ToString() + "','" + Request.Form["hy_bt"].ToString() + "'";
                sql += ",'','','," + Session["hyuid"].ToString() + ",',',') ";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                //edited by xf 20140625
                sql = "insert into hyc_" + Request.Form["hy_tableid"].ToString() + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values (";
                sql += "'" + Request.Form["txtdocid"].ToString() + "','" + Request.Form["hy_mudelid"].ToString() + "','" + Request.Form["hy_tableid"].ToString() + "','" + Request.Form["hy_flowid"].ToString() + "','" + Request.Form["hy_flowname"].ToString() + "'";
                sql += ",'" + Request.Form["hy_curtacheid"].ToString() + "','" + Request.Form["hy_curtachename"].ToString() + "','" + Request.Form["hy_curclrid"].ToString() + "','" + Request.Form["hy_curclrname"].ToString() + "','" + Request.Form["hy_djrid"].ToString() + "'";
                sql += ",'" + Request.Form["hy_djrname"].ToString() + "','" + Request.Form["hy_djrbmid"].ToString() + "','" + Request.Form["hy_djrbmname"].ToString() + "',to_date('" + Request.Form["hy_djsj"].ToString() + "','YYYY-MM-DD HH24:MI:SS'),'" + Request.Form["hy_bt"].ToString() + "'";
                sql += ",'','','," + Session["hyuid"].ToString() + ",',',') ";
            }
            Hyoa_global.ExcuteSQL(sql);

            //插入历史处理表(如果是流程文档)
            if (Request.Form["txtifhaveflow"].ToString() == "是")
            {
                Hyoa_global.Saveflowhistoryinfo_cl_global(Request.Form["txtdocid"].ToString(), Request.Form["hy_flowid"].ToString(), Request.Form["hy_flowname"].ToString(), Request.Form["hy_curtacheid"].ToString(), Request.Form["hy_curtachename"].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "", "", "", Request.Form["hy_djsj"].ToString(), "");
            }
        }
        //更新内容
        sql = "update hyc_" + Request.Form["hy_tableid"].ToString() + " set hy_tableid='" + Request.Form["hy_tableid"].ToString() + "',hy_bt='" + Request.Form["hy_bt"].ToString() + "' ";
        //根据“需要保存的字段”来进行保存
        if (Request.Form["txtsavefields"].ToString() != "")
        {
            string[] lv_savefields = Request.Form["txtsavefields"].ToString().Split(',');
            string[] lv_savefields_sx = Request.Form["txtsavefields_sx"].ToString().Split(',');
            string fielddocvalue = "";
            for (int i = 0; i < lv_savefields.Length; i++)
            {
                if (lv_savefields_sx[i].ToString() == "0")  //文本
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "1")  //日期
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        if (Session["conntype"].ToString() == "SQL")
                        {
                            if (fielddocvalue == "")
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=null";
                            else
                                sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                        }
                        if (Session["conntype"].ToString() == "ORACLE")
                        {
                            if (fielddocvalue == "")
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=null";
                            else
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=to_date('" + fielddocvalue + "','YYYY-MM-DD HH24:MI:SS')";
                        }
                    }
                }
                if (lv_savefields_sx[i].ToString() == "3")  //数值
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        if (fielddocvalue == "")
                            sql += ",hyc_" + lv_savefields[i].ToString() + "=0";
                        else
                            sql += ",hyc_" + lv_savefields[i].ToString() + "=" + fielddocvalue;
                    }
                }
                if (lv_savefields_sx[i].ToString() == "5")  //口令
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "6")  //编辑器
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "7")  //复选框
                {
                    //string s = "";
                    //CheckBoxList txfs = (CheckBoxList)this.FindControl(lv_savefields[i].ToString());
                    //foreach (ListItem li in txfs.Items)
                    //{
                    //    if (li.Selected)
                    //    {
                    //        if (li.Selected) s += li.Value + ",";
                    //    }
                    //}
                    //s = s.TrimEnd(',');
                    //s = ReplaceString_Tszf(s);
                    //sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'";
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "8")  //单选框
                {
                    //string s = "";
                    //RadioButtonList txfs = (RadioButtonList)this.FindControl(lv_savefields[i].ToString());
                    //foreach (ListItem li in txfs.Items)
                    //{
                    //    if (li.Selected)
                    //    {
                    //        if (li.Selected) s += li.Value + ",";
                    //    }
                    //}
                    //s = s.TrimEnd(',');
                    //s = ReplaceString_Tszf(s);
                    //sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'";
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "9")  //意见
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        if (fielddocvalue != "")
                        {
                            HyoaClass.Hyoa_yj Hyoa_yj = new HyoaClass.Hyoa_yj();
                            Hyoa_yj.yjid = Hyoa_global.GetRandom();
                            Hyoa_yj.hy_tableid = Request.Form["hy_tableid"].ToString();
                            Hyoa_yj.hy_fatherid = Request.Form["txtdocid"].ToString();
                            Hyoa_yj.hy_fieldid = lv_savefields[i].ToString();
                            Hyoa_yj.hy_yjuserid = Session["hyuid"].ToString();
                            Hyoa_yj.hy_yjusername = Session["hyuname"].ToString();
                            Hyoa_yj.hy_yjdeptid = Session["hydeptid"].ToString();
                            Hyoa_yj.hy_yjdeptname = Session["hydeptname"].ToString();
                            Hyoa_yj.hy_yjtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            Hyoa_yj.hy_yjbody = fielddocvalue;
                            Hyoa_yj.hy_yjip = HttpContext.Current.Request.UserHostAddress;
                            Hyoa_yj.hy_yjifshow = "";
                            Hyoa_yj.Insert();
                        }
                    }
                }
            }
        }

        //保存
        if (Request.Form["txtwhichoperation"].ToString() == "1")
        {
            hylcbctscl(sql);  //特殊处理
        }

        //确认
        if (Request.Form["txtwhichoperation"].ToString() == "111")
        {
            sql += ",hy_ifconfirm='1'";
        }

        //取消确认
        if (Request.Form["txtwhichoperation"].ToString() == "112")
        {
            sql += ",hy_ifconfirm='0'";
        }
        //提交
        if (Request.Form["txtwhichoperation"].ToString() == "2")
        {
            //更新主文档
            sql += ",hy_curtacheid='" + Request.Form["txtnexttacheid"].ToString() + "'";
            sql += ",hy_curtachename='" + Request.Form["txtnexttachename"].ToString() + "'";
            sql += ",hy_curclrid='" + Request.Form["txtnextclrid"].ToString() + "'";
            sql += ",hy_curclrname='" + Request.Form["txtnextclrname"].ToString() + "'";

            //---- 添加当前环节的处理时间 ---- start
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocidtacheid(Request.Form["txtdocid"].ToString(), Request.Form["hy_curtacheid"].ToString());
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
                else
                {
                    Hyoa_flowhistoryinfo_cl.hy_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //---- 添加当前环节的处理时间 ---- end

            ////////////////////如果后续环节选择了“结束”,则不需要发待办事宜和短消息 start//////////////////////
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            if (Request.Form["txtnexttacheid"].ToString() != "**")
            {
                //---  创建后续处理的处理记录+建立处理人待办事宜 ---- start
                Hyoa_global.Saveflowhistoryinfo_cl_global(Request.Form["txtdocid"].ToString(), Request.Form["hy_flowid"].ToString(), Request.Form["hy_flowname"].ToString(), Request.Form["txtnexttacheid"].ToString(), Request.Form["txtnexttachename"].ToString(), Request.Form["txtnextclrid"].ToString(), Request.Form["txtnextclrname"].ToString(), "", Request.Form["txtnextcyrid"].ToString(), Request.Form["txtnextcyrname"].ToString(), System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");

                //待办事宜、短信、即时消息
                string[] lv_dbrid = Request.Form["txtnextclrid"].ToString().Split(new Char[] { ',' });
                string[] lv_dbrname = Request.Form["txtnextclrname"].ToString().Split(new Char[] { ',' });
                for (var i = 0; i < lv_dbrid.Length; i++)
                {
                    if (lv_dbrid[i].ToString() != "")
                    {
                        //得到当前用户手机号
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                        //得到后续处理人手机号
                        string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());

                        //给后续处理人发送一个新的待办事宜(提醒)
                        Hyoa_global.Senddbsy_global(Request.Form["txtdocid"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + Request.Form["hy_mudelid"].ToString() + "&tableid=" + Request.Form["hy_tableid"].ToString() + "&docid=" + Request.Form["txtdocid"].ToString() + "&pop=1", "待办", Request.Form["hy_mudelid"].ToString(), "待办箱", "一般", Request.Form["hy_bt"].ToString(), "请办理", 0, Request.Form["hy_flowid"].ToString(), Request.Form["txtnexttacheid"].ToString(), Request.Form["hy_tableid"].ToString());
                        //给后续处理人发送即时消息(提醒)
                        if (Request.Form["txtisSendjstx_clr"].ToString() == "1")
                        {
                            Hyoa_global.Sendjstx_global(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), Request.Form["hy_mudelid"].ToString(), Request.Form["hy_bt"].ToString(), 0, Request.Form["hy_tableid"].ToString());
                        }
                        //给后续处理人发送短信(提醒)
                        if (Request.Form["txtisSendsms_clr"].ToString() == "1")
                        {
                            Hyoa_global.Sendsms_global(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, Request.Form["hy_mudelid"].ToString(), Request.Form["hy_bt"].ToString(), 1, "", "", 0, Request.Form["hy_tableid"].ToString());
                        }
                    }
                }
                //--- 创建后续处理的处理记录+建立处理人待办事宜 ---- end

                //--- 创建后续传阅记录+建立待办事宜 ---- start
                string[] lv_cyrid = Request.Form["txtnextcyrid"].ToString().Split(new Char[] { ',' });
                string[] lv_cyrname = Request.Form["txtnextcyrname"].ToString().Split(new Char[] { ',' });
                for (var i = 0; i < lv_cyrid.Length; i++)
                {
                    if (lv_cyrid[i].ToString() != "")
                    {
                        //建立传阅数据
                        Hyoa_global.Saveflowhistoryinfo_cy_global(Request.Form["txtdocid"].ToString(), Request.Form["hy_flowid"].ToString(), Request.Form["hy_flowname"].ToString(), Request.Form["txtnexttacheid"].ToString(), Request.Form["txtnexttachename"].ToString(), lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), "", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                        //待办事宜、短信、即时消息
                        //得到当前用户手机号
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                        //得到后续传阅人手机号
                        string cb_cyrsjh = Hyoa_user.GetMobilebyuserid(lv_cyrid[i].ToString());

                        //给后续处理人发送一个新的待办事宜(提醒)
                        Hyoa_global.Senddbsy_global(Request.Form["txtdocid"].ToString(), lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + Request.Form["hy_mudelid"].ToString() + "&tableid=" + Request.Form["hy_tableid"].ToString() + "&docid=" + Request.Form["txtdocid"].ToString() + "&pop=1", "待阅", Request.Form["hy_mudelid"].ToString(), "待办箱", "一般", Request.Form["hy_bt"].ToString(), "请阅读", 0, Request.Form["hy_flowid"].ToString(), Request.Form["txtnexttacheid"].ToString(), Request.Form["hy_tableid"].ToString());
                        //给后续处理人发送即时消息(提醒)
                        if (Request.Form["txtisSendjstx_cyr"].ToString() == "1")
                        {
                            Hyoa_global.Sendjstx_global(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), Request.Form["hy_mudelid"].ToString(), Request.Form["hy_bt"].ToString(), 0, Request.Form["hy_tableid"].ToString());
                        }
                        //给后续处理人发送短信(提醒)
                        if (Request.Form["txtisSendsms_cyr"].ToString() == "1")
                        {
                            Hyoa_global.Sendsms_global(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), cb_cyrsjh, Request.Form["hy_mudelid"].ToString(), Request.Form["hy_bt"].ToString(), 1, "", "", 0, Request.Form["hy_tableid"].ToString());
                        }

                    }
                }
                //--- 创建后续传阅记录+建立待办事宜 ---- end
            }
            ////////////////////如果后续环节选择了“结束”,则不需要发待办事宜和短消息 start//////////////////////

            //--- 当前处理人的待办事宜转已办 ---- start
            Hyoa_dbsy.Dbsytoybbydocidtacheiduserid(Request.Form["txtdocid"].ToString(), Request.Form["hy_curtacheid"].ToString(), this.Session["hyuid"].ToString());
            //--- 当前处理人的待办事宜转已办 ---- end
            ls_tip = "文档已成功发送到[" + Request.Form["txtnexttachename"].ToString() + "]环节";
            hylctjtscl(sql);//特殊处理
        }

        //收回
        if (Request.Form["txtwhichoperation"].ToString() == "3")
        {
            //得到上个环节处理人
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(Request.Form["txtdocid"].ToString());
            if (dt_clinfo.Rows.Count > 1)
            {
                //删除当前处理人员的待办事宜
                HyoaClass.Hyoa_dbsy Hyoa_dbsy_sh = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy_sh.DeleteByDocid_flowid_tacheid_userid(Request.Form["txtdocid"].ToString(), dt_clinfo.Rows[0]["hy_flowid"].ToString(), dt_clinfo.Rows[0]["hy_tacheid"].ToString(), dt_clinfo.Rows[0]["hy_clrid"].ToString());

                string ls_lastclrid = dt_clinfo.Rows[1]["hy_clrid"].ToString();         //上个环节处理人ID
                string ls_lastclrname = dt_clinfo.Rows[1]["hy_clrname"].ToString();     //上个环节处理人中文名
                string ls_lastcldoc = dt_clinfo.Rows[1]["ID"].ToString();               //上个环节处理的记录ID
                string ls_lasttacheid = dt_clinfo.Rows[1]["hy_tacheid"].ToString();     //上个环节处理环节ID
                string ls_lasttachename = dt_clinfo.Rows[1]["hy_tachename"].ToString(); //上个环节处理环节名称
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                dt_clinfo.Clear();

                //删除当前处理的记录
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.Delete();
                //清空上个环节处理时间,更新创建时间
                Hyoa_flowhistoryinfo_cl.ID = ls_lastcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = "";
                Hyoa_flowhistoryinfo_cl.hy_createtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                Hyoa_flowhistoryinfo_cl.Update_sh();
                //更新主文档中的当前环节ID、当前环节名称、当前处理人ID和中文名
                sql += ",hy_curtacheid='" + ls_lasttacheid + "'";
                sql += ",hy_curtachename='" + ls_lasttachename + "'";
                sql += ",hy_curclrid='" + ls_lastclrid + "'";
                sql += ",hy_curclrname='" + ls_lastclrname + "'";
                ls_tip = "文档已成功收回到[" + ls_lasttachename + "]环节";
                hylcshtscl(sql);//特殊处理
            }
        }

        //退回
        if (Request.Form["txtwhichoperation"].ToString() == "4")
        {
            //更新主文档
            sql += ",hy_curtacheid='" + Request.Form["txtnexttacheid"].ToString() + "'";
            sql += ",hy_curtachename='" + Request.Form["txtnexttachename"].ToString() + "'";
            sql += ",hy_curclrid='" + Request.Form["txtnextclrid"].ToString() + "'";
            sql += ",hy_curclrname='" + Request.Form["txtnextclrname"].ToString() + "'";

            //处理历史处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(Request.Form["txtdocid"].ToString());
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //新建一条处理记录
            Hyoa_global.Saveflowhistoryinfo_cl_global(Request.Form["txtdocid"].ToString(), Request.Form["hy_flowid"].ToString(), Request.Form["hy_flowname"].ToString(), Request.Form["txtnexttacheid"].ToString(), Request.Form["txtnexttachename"].ToString(), Request.Form["txtnextclrid"].ToString(), Request.Form["txtnextclrname"].ToString(), "", "", "", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "是");

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString());

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());

            //(考虑多人的情况)
            string[] lv_dbrid = Request.Form["txtnextclrid"].ToString().Split(new Char[] { ',' });
            string[] lv_dbrname = Request.Form["txtnextclrname"].ToString().Split(new Char[] { ',' });

            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到接收人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());
                    HyoaClass.Hyoa_global Hyoa_global2 = new HyoaClass.Hyoa_global();

                    //给退回到的处理人发送一个新的待办事宜(提醒)
                    Hyoa_global2.Senddbsy_global(Request.Form["txtdocid"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + Request.Form["hy_mudelid"].ToString() + "&tableid=" + Request.Form["hy_tableid"].ToString() + "&docid=" + Request.Form["txtdocid"].ToString() + "&pop=1", "待办", Request.Form["hy_mudelid"].ToString(), "待办箱", "一般", Request.Form["hy_bt"].ToString(), "请办理", 0, Request.Form["hy_flowid"].ToString(), Request.Form["txtnexttacheid"].ToString(), Request.Form["hy_tableid"].ToString());
                    //给退回到的处理人发送即时消息(提醒)
                    if (Request.Form["txtisSendjstx"].ToString() == "1")
                    {
                        Hyoa_global.Sendjstx_global(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), Request.Form["hy_mudelid"].ToString(), Request.Form["hy_bt"].ToString(), 0, Request.Form["hy_tableid"].ToString());
                    }
                    //给退回到的处理人发送短信(提醒)
                    if (Request.Form["txtisSendsms"].ToString() == "1")
                    {
                        Hyoa_global.Sendsms_global(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, Request.Form["hy_mudelid"].ToString(), Request.Form["hy_bt"].ToString(), 1, "", "", 0, Request.Form["hy_tableid"].ToString());
                    }
                }
            }
            ls_tip = "已成功退回到[" + Request.Form["txtnexttachename"].ToString() + "]环节";
            hylcthtscl(sql);//特殊处理
        }

        //多人处理
        if (Request.Form["txtwhichoperation"].ToString() == "5")
        {
            //更新主文档
            string ls_newclrid = Hyoa_global.MoveOneString_dh(Request.Form["hy_curclrid"].ToString(), this.Session["hyuid"].ToString());
            string ls_newclrname = Hyoa_global.MoveOneString_dh(Request.Form["hy_curclrname"].ToString(), this.Session["hyuname"].ToString());
            sql += ",hy_curclrid='" + ls_newclrid + "'";
            sql += ",hy_curclrname='" + ls_newclrname + "'";
            //处理处理记录
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(Request.Form["txtdocid"].ToString());
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString());

            ls_tip = "提交成功,当前环节还需要[" + ls_newclrname + "]进行办理";
            hylcdrcltscl(sql);//特殊处理
        }

        //催办
        if (Request.Form["txtwhichoperation"].ToString() == "6")
        {
            string cb_docid = Request.Form["txtdocid"].ToString();
            string cb_dbrid = Request.Form["hy_curclrid"].ToString();
            string cb_dbrname = Request.Form["hy_curclrname"].ToString();
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "main.aspx?op=modify&mid=" + Request.Form["hy_mudelid"].ToString() + "&tableid=" + Request.Form["hy_tableid"].ToString() + "&docid=" + Request.Form["txtdocid"].ToString() + "&pop=1";
            string cb_property = "催办";
            string cb_mudelid = Request.Form["hy_mudelid"].ToString();
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = Request.Form["txtcbideas"].ToString() + "-" + Request.Form["hy_bt"].ToString();
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = Request.Form["hy_flowid"].ToString();
            string cb_tacheid = Request.Form["hy_curtacheid"].ToString();
            string cb_from = Request.Form["hy_mudelid"].ToString();

            //得到发送人手机号
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(cb_fsrid);
            //得到接收人手机号
            string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(cb_dbrid);

            //给当前处理人发送一个新的待办事宜(提醒)
            Hyoa_global.Senddbsy_global(cb_docid, cb_dbrid, cb_dbrname, cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, cb_ifyb, cb_flowid, cb_tacheid, Request.Form["hy_tableid"].ToString());
            //给当前处理人发送即时消息(提醒)
            if (Request.Form["txtisSendjstx"].ToString() == "1")
            {
                Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, cb_dbrid, cb_dbrname, cb_from, cb_bt, 0, Request.Form["hy_tableid"].ToString());
            }
            //给当前处理人发送短信(提醒)
            if (Request.Form["txtisSendsms"].ToString() == "1")
            {
                Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, cb_dbrid, cb_dbrname, cb_jsrsjh, cb_from, cb_bt, 1, "", "", 0, Request.Form["hy_tableid"].ToString());
            }

            ls_tip = "催办成功!";
            hylccbtscl(sql);//特殊处理
        }

        //流程结束时的提交
        if (Request.Form["txtwhichoperation"].ToString() == "7")
        {
            //更新主文档
            sql += ",hy_curtacheid='**'";
            sql += ",hy_curtachename='结束'";
            sql += ",hy_curclrid=''";
            sql += ",hy_curclrname=''";
            //更新处理表
            HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
            DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(Request.Form["txtdocid"].ToString());
            if (dt_clinfo.Rows.Count > 0)
            {
                string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString();                //当前处理的记录ID
                string ls_clsj = "";                                                    //当前处理的记录处理时间
                if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "")
                    ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                else
                    ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                dt_clinfo.Clear();
                Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc;
                Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj;
                Hyoa_flowhistoryinfo_cl.Update();
            }
            ////流程结束时删除所有该文档对应的待办事宜
            //HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            //Hyoa_dbsy.Deletebydocid(Request.Form["txtdocid"].ToString());

            //处理待办事宜
            //转已办-当前处理人的待办事宜
            HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
            Hyoa_dbsy.Dbsytoybbydociduserid(Request.Form["txtdocid"].ToString(), this.Session["hyuid"].ToString());

            ls_tip = "流程结束!";
            hylcjstscl(sql);//特殊处理
        }

        //收文阅件分发
        if (Request.Form["txtwhichoperation"].ToString() == "8")
        {
            string cb_docid = Request.Form["txtdocid"].ToString();
            string cb_dbrid = Request.Form["hy_curclrid"].ToString();
            string cb_dbrname = Request.Form["hy_curclrname"].ToString();
            string cb_fsrid = this.Session["hyuid"].ToString();
            string cb_fsrname = this.Session["hyuname"].ToString();
            string cb_url = "main.aspx?op=modify&mid=" + Request.Form["hy_mudelid"].ToString() + "&tableid=" + Request.Form["hy_tableid"].ToString() + "&docid=" + Request.Form["txtdocid"].ToString() + "&pop=1";
            string cb_property = "待阅";
            string cb_mudelid = Request.Form["hy_mudelid"].ToString();
            string cb_foldername = "待办箱";
            string cb_hj = "一般";
            string cb_bt = Request.Form["hy_bt"].ToString();
            string cb_subbt = "请阅读";
            float cb_ifyb = 0;
            string cb_flowid = Request.Form["hy_flowid"].ToString();
            string cb_tacheid = Request.Form["hy_curtacheid"].ToString();
            string cb_from = Request.Form["hy_mudelid"].ToString();

            string[] lv_dbrid = Request.Form["txtswly_dbsy_userids"].ToString().Split(new Char[] { '+' });
            string[] lv_dbrname = Request.Form["txtswly_dbsy_usernames"].ToString().Split(new Char[] { '+' });
            for (var i = 0; i < lv_dbrid.Length; i++)
            {
                if (lv_dbrid[i].ToString() != "")
                {
                    //得到当前用户手机号
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString());
                    //得到后续处理人手机号
                    string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString());

                    //给后续处理人发送一个新的待办事宜(提醒)
                    Hyoa_global.Senddbsy_global(cb_docid, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, 0, cb_flowid, cb_tacheid, Request.Form["hy_tableid"].ToString());
                    //给后续处理人发送即时消息(提醒)
                    Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_mudelid, cb_bt, 0, Request.Form["hy_tableid"].ToString());
                    //给后续处理人发送短信(提醒)
                    Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, cb_mudelid, cb_bt, 1, "", "", 0, Request.Form["hy_tableid"].ToString());

                    //在hyp_flowhistoryinfo_cy中添加传阅信息
                    string sql_cy = "select * from hyp_flowhistoryinfo_cy where DOCID='" + Request.Form["txtdocid"].ToString() + "' and hy_cyrid='" + lv_dbrid[i] + "' order by hy_createtime DESC ";
                    DataTable dt_cy = Hyoa_global.GetDataTable(sql_cy);
                    if (dt_cy.Rows.Count > 0)
                    {
                    }
                    else
                    {
                        HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                        Hyoa_flowhistoryinfo_cy.ID = Hyoa_global.GetRandom();
                        Hyoa_flowhistoryinfo_cy.DOCID = Request.Form["txtdocid"].ToString();
                        Hyoa_flowhistoryinfo_cy.hy_flowid = Request.Form["hy_flowid"].ToString();
                        Hyoa_flowhistoryinfo_cy.hy_flowname = Request.Form["hy_flowname"].ToString();
                        Hyoa_flowhistoryinfo_cy.hy_tacheid = Request.Form["hy_curtacheid"].ToString();
                        Hyoa_flowhistoryinfo_cy.hy_tachename = Request.Form["hy_curtachename"].ToString();
                        Hyoa_flowhistoryinfo_cy.hy_cyrid = lv_dbrid[i];
                        Hyoa_flowhistoryinfo_cy.hy_cyrname = lv_dbrname[i];
                        Hyoa_flowhistoryinfo_cy.hy_ydsj = "";
                        Hyoa_flowhistoryinfo_cy.hy_createtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        Hyoa_flowhistoryinfo_cy.Insert();
                    }
                }
            }
            //在当前环节处理的记录中添加传阅信息,主要用于列表的显示控制
            string sql_cl = "select * from hyp_flowhistoryinfo_cl where DOCID='" + Request.Form["txtdocid"].ToString() + "' order by hy_createtime DESC ";
            DataTable dt_cl = Hyoa_global.GetDataTable(sql_cl);
            if (dt_cl.Rows.Count > 0)
            {
                if (dt_cl.Rows[0]["hy_cyrid"].ToString() == "")
                {
                    sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid='" + Request.Form["txtswly_dbsy_userids"].ToString().Replace("+", ",") + "',hy_cyrname='" + Request.Form["txtswly_dbsy_usernames"].ToString().Replace("+", ",") + "' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    Hyoa_global.ExcuteSQL(sql_cl);
                }
                else
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid=hy_cyrid+'," + Request.Form["txtswly_dbsy_userids"].ToString().Replace("+", ",") + "',hy_cyrname=hy_cyrname+'," + Request.Form["txtswly_dbsy_usernames"].ToString().Replace("+", ",") + "' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid=CONCAT(hy_cyrid,'," + Request.Form["txtswly_dbsy_userids"].ToString().Replace("+", ",") + "'),hy_cyrname=CONCAT(hy_cyrname,'," + Request.Form["txtswly_dbsy_usernames"].ToString().Replace("+", ",") + ")' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'";
                    }
                    Hyoa_global.ExcuteSQL(sql_cl);
                }
            }
            ls_tip = "阅件分发成功!";
        }

        //在主表单内嵌列表的功能中,保存、提交和确认子表单时,需要将父文档的DOCID保存到当前记录的hy_motherid中
        //ADD BY XF 2011-11-17
        if (Request.Form["txtwhichoperation"].ToString() == "1" || Request.Form["txtwhichoperation"].ToString() == "2" || Request.Form["txtwhichoperation"].ToString() == "111")
        {
            if (Request.QueryString["op"] != null)
            {
                if (Request.QueryString["op"].ToString() != "")
                {
                    if (Request.QueryString["motherid"] != null)
                    {
                        if (Request.QueryString["motherid"].ToString() != "")
                        {
                            sql += ",hy_motherid='" + Request.QueryString["motherid"].ToString() + "'";
                        }
                    }
                }
            }
        }

        sql += " where DOCID='" + Request.Form["txtdocid"].ToString() + "'";
        Hyoa_global.ExcuteSQL(sql);
        ls_flag = "1";
        hy_json = "{\"success\":" + ls_success + ",\"flag\":\"" + ls_flag + "\"}";
        Response.Write(hy_json);

        ////处理完成后的提示及跳转(增加刷新附件功能)
        //if (Request.Form["txtifsxfj"].ToString() == "1")
        //{
        //    //Response.Write("<script>window.location='main.aspx?op=modify&mid=" + Request.Form["hy_mudelid"].ToString() + "&tableid=" + Request.Form["hy_tableid"].ToString() + "&docid=" + Request.Form["txtdocid"].ToString() + "&url=" + Request.Form["txturl"].ToString() + "'</script>");
        //}
        //else
        //{
        //    //if (Request.Form["txtifpop"].ToString() == "")
        //    //{
        //    //    //Response.Write("<script>alert('" + ls_tip + "');window.location='" + Request.Form["txturl"].ToString() + "'</script>");
        //    //}
        //    //else
        //    //{
        //    //    Response.Write("<script>alert('" + ls_tip + "');try{window.opener.location.reload();}catch(err){}self.close();</script>");
        //    //}
        //    Response.Write("<div data-role=\"dialog\">");
        //    Response.Write("<div data-role=\"header\" data-theme=\"d\">");
        //    Response.Write("<h1>");
        //    Response.Write("消息窗口</h1>");
        //    Response.Write("</div>");
        //    Response.Write("<div data-role=\"content\" style=\"text-align: center\">");
        //    Response.Write("<h1>");
        //    Response.Write(ls_tip + "</h1>");
        //    Response.Write("<a href=\"" + Request.Form["txturl"].ToString() + "\" data-icon=\"gear\" data-role=\"button\" data-theme=\"b\" data-transition=\"flip\">确  定</a>");
        //    Response.Write("</div>");
        //    Response.Write("</div>");
        //}
    }