Exemplo n.º 1
0
    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));
    }
Exemplo n.º 2
0
    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));
    }
Exemplo n.º 3
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //保存
    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
    }
Exemplo n.º 4
0
    //加载主表单    Written by xf 20110515
    private void DataPlay()
    {
        txtsavefields.Text = "";
        txtsavefields_sx.Text = "";

        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

            #region 新文档
            if (this.Request.QueryString["op"] == "add")
            {
                this.td_ydry.Visible = false; //新文档时,“已读人员”按钮隐藏
                this.txtiffirsttache.Value = "1"; //新文档时,“是否第一环节”置为1

                //文档ID(保存POST到当前页面时,DOCID不重新加载)
                if (!this.IsPostBack)
                {
                    this.txtdocid.Value = Hyoa_global.GetRandom();
                    this.hy_djsj.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
                this.hy_djrid.Text = this.Session["hyuid"].ToString();
                this.hy_djrname.Text = this.Session["hyuname"].ToString();
                this.hy_djrbmid.Text = this.Session["hydeptid"].ToString();
                this.hy_djrbmname.Text = this.Session["hydeptname"].ToString();

                HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                if (dt_tableconfig.Rows.Count > 0)
                {
                    if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是")
                    {
                        //根据模块ID得到流程信息
                        HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
                        DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text);
                        if (dt.Rows.Count > 0)
                        {
                            //判断当前用户是否有登记权限
                            //得到第一环节ID
                            string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString());
                            if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString()))
                            {
                                this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                                this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                                this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString();
                                this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                this.hy_curclrid.Text = this.Session["hyuid"].ToString();
                                this.hy_curclrname.Text = this.Session["hyuname"].ToString();
                                this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                this.txtSystemClRight.Value = "1";

                                //-------条件流程start-------
                                HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
                                DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid);
                                if (dt_firsttache.Rows.Count > 0)
                                {
                                    if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是")
                                        ConditionFlow(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid);
                                }
                                //-------条件流程end-------
                            }
                            else
                            {
                                if (this.txtifpop.Value == "")
                                {
                                    this.td_submit.Visible = false;
                                    this.td_nextstep.Visible = false;
                                    Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>");
                                    return;
                                }
                                else
                                {
                                    this.td_submit.Visible = false;
                                    this.td_nextstep.Visible = false;
                                    Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>");
                                    return;
                                }
                            }
                        }
                        dt.Clear();
                        this.td_nextstep.Visible = true; //提交
                    }
                }
                //加载页面
                if (this.hy_tableid.Text == "Tablefpbd")
                {
                        this.td_dc.Visible = true;
                }
                GetMainTableHtml("0", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);
                this.td_submit.Visible = true; //保存
                hywebopen_newdoc();     //新文档OPEN时的特殊处理

            }
            #endregion

            #region 旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                this.td_browseflow.Visible = true;  //查看流程

                if (this.Request.QueryString["docid"] != null)
                {
                    this.txtdocid.Value = this.Request.QueryString["docid"].ToString();
                    string sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "' ";

                    DataTable dt = Hyoa_global.GetDataTable(sql);
                    if (dt.Rows.Count > 0)
                    {
                        this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString();
                        this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString();
                        this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                        this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                        this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString();
                        this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString();
                        this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString();
                        this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString();
                        this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString();
                        this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString();
                        this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString();
                        this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString();
                        if (!this.IsPostBack)
                        {
                            this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString();
                        }
                        this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString();
                        this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString();
                        this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString();
                        this.hy_readdatelist.Text = dt.Rows[0]["hy_readdatelist"].ToString();
                        this.hy_clrylist.Text = dt.Rows[0]["hy_clrylist"].ToString();
                        this.hy_cyrylist.Text = dt.Rows[0]["hy_cyrylist"].ToString();
                        this.hy_motherid.Text = dt.Rows[0]["hy_motherid"].ToString();
                        this.hy_ifconfirm.Text = dt.Rows[0]["hy_ifconfirm"].ToString();
                        UpdateReadFlag();  //打开时添加阅读情况
                    }
                    dt.Clear();

                    //流程已结束
                    if (this.hy_curtacheid.Text == "**")
                    {
                        this.lblcurtachenameshow.Text = "流程已结束";

                        //20111216 add start
                        if (this.hy_mudelid.Text == "Mudelfwgl" || this.hy_mudelid.Text == "Mudelswgl")
                        {
                            //有发布权限
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            {
                                this.td_fabu.Visible = true;  //收发文模块流程结束后显示发布按钮
                                //收发文流程结束后分发轮阅  20140809 hjadd start
                                this.td_ffly.Visible = true;  //收发文模块流程结束后显示分发按钮
                                //收发文流程结束后分发轮阅  20140809 hjadd start
                            }
                        }
                        //20111216 add end

                        //判断是否为传阅人
                        HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                        dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                        if (dt.Rows.Count > 0)
                        {
                            this.txtSystemClRight.Value = "0";
                            this.txtSystemYdRight.Value = "1";
                        }
                        //判断是否历史处理人
                        //判断是否是历史处理人员
                        if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                        {
                            this.txtifhistoryclr.Value = "1";
                            this.txtSystemClRight.Value = "0";
                            this.txtSystemYdRight.Value = "1";
                        }
                    }
                    else
                    {
                        //////////////流程未结束///////////////////////
                        //判断是否为当前处理人
                        if (("," + this.hy_curclrid.Text + ",").IndexOf(("," + this.Session["hyuid"].ToString() + ",")) >= 0)
                        {
                            this.txtSystemClRight.Value = "1";
                            this.td_submit.Visible = true; //保存
                            this.td_nextstep.Visible = true; //提交
                            if (this.hy_curtacheid.Text != "tache0001")
                            {
                                this.td_returnsumbit.Visible = true; //退回
                            }

                            //-------条件流程start-------
                            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
                            DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            if (dt_firsttache.Rows.Count > 0)
                            {
                                if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是")
                                    ConditionFlow(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            }
                            //-------条件流程end-------
                        }
                        else
                        {
                            //判断是否为传阅人
                            HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                            dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                            if (dt.Rows.Count > 0)
                            {
                                this.txtSystemYdRight.Value = "1";
                            }
                            //判断是否是上一环节处理人
                            if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                            {
                                this.txtiflastclr.Value = "1";
                                this.txtSystemYdRight.Value = "1";
                                this.td_withdraw.Visible = true; //收回
                                this.td_press.Visible = true; //催办
                            }
                            else
                            {
                                //判断是否是历史处理人员
                                if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                {
                                    this.txtifhistoryclr.Value = "1";
                                    this.txtSystemYdRight.Value = "1";
                                    this.td_press.Visible = true; //催办
                                }
                            }
                        }
                        //判断是否为第一个环节
                        HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
                        DataTable dt_flowhistoryinfo_cl = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value);
                        if (dt_flowhistoryinfo_cl.Rows.Count == 1)
                        {
                            this.txtiffirsttache.Value = "1"; //旧文档时,如果历史处理环节中只有一条记录,“是否第一环节”置为1
                        }
                        dt_flowhistoryinfo_cl.Clear();

                        //判断是否为最后一个环节
                        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                        DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                        if (dtflowwork.Rows.Count > 0)
                        {
                            if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                this.txtiflasttache.Value = "1";
                        }
                        dtflowwork.Clear();
                        //////////////流程未结束///////////////////////
                    }

                    //如果表单是流程后公开显示,则置为阅读权限
                    if (this.hy_curtacheid.Text == "**")
                    {
                        HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                        DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.hy_tableid.Text);
                        if (dt_tableconfig.Rows.Count > 0)
                        {
                            if (dt_tableconfig.Rows[0]["hy_ispuballByflowYB"].ToString() == "是")
                            {
                                this.txtSystemYdRight.Value = "1";
                            }
                        }
                    }
                    //没有操作权限的用户,如果是全权用户,则置为阅读权限    ADD BY XF 2011-11-17
                    if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                    {
                        //得到当前模块对应的全权用户组
                        HyoaClass.Hyoa_mudel Hyoa_mudel_forqqyh = new HyoaClass.Hyoa_mudel();
                        DataTable dt_mudel_forqqyh = Hyoa_mudel_forqqyh.Getmudel(this.hy_mudelid.Text);
                        if (dt_mudel_forqqyh.Rows.Count > 0)
                        {
                            if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != null)
                            {
                                if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != "")
                                {
                                    string ls_role_forqqyh = dt_mudel_forqqyh.Rows[0]["hy_qqroleid"].ToString();
                                    HyoaClass.Hyoa_global Hyoa_global_forqqyh = new HyoaClass.Hyoa_global();
                                    if (Hyoa_global_forqqyh.isHaveRole(ls_role_forqqyh, this.Session["hyuid"].ToString()))
                                    {
                                        this.txtSystemYdRight.Value = "1";  //阅读权限
                                    }
                                }
                            }
                        }
                    }

                    //指定的特殊模块,流转过程中,所有人员可以浏览该文档
                    hySetYdRight_TS();

                    //如果是“可修改所有文档的权限人员”,则可以修改所有的,可以把已办文件转在办
                    if (Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString()))
                    {
                        this.txtSystemYdRight.Value = "1";
                        this.td_submit.Visible = true; //保存
                        if (this.hy_curtacheid.Text == "**")
                            this.td_ybtozb.Visible = true; //已办转在办
                    }

                    //既没有处理权限,又没有阅读权限的情况下
                    if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                    {
                        if (this.txtifpop.Value == "")
                        {
                            this.td_submit.Visible = false;
                            this.td_nextstep.Visible = false;
                            Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>");
                            return;
                        }
                        else
                        {
                            this.td_submit.Visible = false;
                            this.td_nextstep.Visible = false;
                            Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>");
                            return;
                        }
                    }

                    //加载页面
                    if (this.hy_tableid.Text == "Tablefpbd")
                    {
                            this.td_dc.Visible = true;

                    }
                    GetMainTableHtml("1", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);

                    //----加载补充意见页面 s add by xf 2013-6-24-----
                    HyoaClass.Hyoa_tableconfig Hyoa_tableconfig_forbcyj = new HyoaClass.Hyoa_tableconfig();
                    DataTable dt_tableconfig_forbcyj = Hyoa_tableconfig_forbcyj.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                    if (dt_tableconfig_forbcyj.Rows.Count > 0)
                    {
                        if (dt_tableconfig_forbcyj.Rows[0]["hy_ifcomment"] != null)
                        {
                            if (dt_tableconfig_forbcyj.Rows[0]["hy_ifcomment"].ToString() == "是")
                            {
                                this.tb_nbsp.Visible = true;
                                this.tb_bctitle.Visible = true;
                                this.tb_bcbody.Visible = true;
                                if (this.txtSystemClRight.Value == "0")
                                {
                                    this.td_bcyj.Visible = true;
                                    this.tr_bcyj.Visible = true;
                                }

                                //得到已经补充意见内容
                                HyoaClass.Hyoa_bcyj Hyoa_bcyj = new HyoaClass.Hyoa_bcyj();
                                DataTable dt_bcyj = Hyoa_bcyj.GetdocsByfatherid(this.txtdocid.Value);
                                if (dt_bcyj.Rows.Count > 0)
                                {
                                    //输出补充意见记录
                                    this.lblbody_bcyj.Text = "";
                                    for (var i = 0; i < dt_bcyj.Rows.Count; i++)
                                    {
                                        this.lblbody_bcyj.Text += dt_bcyj.Rows[i]["hy_bcbody"].ToString() + "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                        this.lblbody_bcyj.Text += "(补充意见人:" + dt_bcyj.Rows[i]["hy_bcusername"].ToString() + "&nbsp;&nbsp;&nbsp;所在部门:" + dt_bcyj.Rows[i]["hy_bcdeptname"].ToString();
                                        this.lblbody_bcyj.Text += "&nbsp;&nbsp;&nbsp;补充时间:" + dt_bcyj.Rows[i]["hy_bctime"].ToString() + "&nbsp;&nbsp;&nbsp;IP:" + dt_bcyj.Rows[i]["hy_bcip"].ToString();
                                        this.lblbody_bcyj.Text += ")<br><hr height=1 color=#DEEEFE></hr>";
                                    }
                                }
                            }
                        }
                    }
                    //----加载补充意见页面 e-----
                }
                hywebopen_olddoc(); //旧文档OPEN的特殊处理
            }
            #endregion
        }
    }
Exemplo n.º 5
0
    //加载主表单    Written by xf 20110515
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //新文档
            if (this.Request.QueryString["op"] == "add")
            {
                HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                //文档ID
                this.txtdocid.Value = Hyoa_global.GetRandom();

                this.hy_djrid.Text = this.Session["hyuid"].ToString();
                this.hy_djrname.Text = this.Session["hyuname"].ToString();
                this.hy_djrbmid.Text = this.Session["hydeptid"].ToString();
                this.hy_djrbmname.Text = this.Session["hydeptname"].ToString();
                this.hy_djsj.Text = System.DateTime.Now.ToString();

                if (this.txtifhaveflow.Value == "是")
                {
                    HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                    DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                    if (dt_tableconfig.Rows.Count > 0)
                    {
                        if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是")
                        {
                            //根据模块ID得到流程信息
                            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
                            DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text);
                            //Response.Write("<script>alert('"+dt.Rows.Count.ToString()+"')</script>");
                            if (dt.Rows.Count > 0)
                            {
                                //判断当前用户是否有登记权限
                                //得到第一环节ID
                                string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString());
                                if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString()))
                                {
                                    this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                                    this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                                    this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString();
                                    this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                    this.hy_curclrid.Text = this.Session["hyuid"].ToString();
                                    this.hy_curclrname.Text = this.Session["hyuname"].ToString();
                                    this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                    this.txtSystemClRight.Value = "1";
                                }
                                else
                                {
                                    Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');history.back();</script>");
                                }
                            }
                            dt.Clear();
                            this.td_nextstep.Visible = true; //提交
                        }
                    }
                    //加载页面
                    this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "0", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);
                    this.rptlist.DataBind();
                    this.td_submit.Visible = true; //保存
                }
                else
                {
                    this.lblcurtachenameshow.Text = this.lbltablename.Text;
                    //如果非流程(授权用户统一管理)
                    if (this.txttablerole.Value == "0")
                    {
                        if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            this.txtSystemClRight.Value = "1";
                    }
                    //如果非流程(每个人管理自己的信息)
                    if (this.txttablerole.Value == "1")
                    {
                        this.txtSystemClRight.Value = "1";
                    }
                    //如果非流程(每个人操作自己的信息、授权用户可管理所有信息)
                    if (this.txttablerole.Value == "2")
                    {
                        this.txtSystemClRight.Value = "1";
                    }

                    if(this.txtSystemClRight.Value == "1")
                        this.td_submit.Visible = true; //保存
                    else
                        this.td_submit.Visible = false; //保存

                    //加载页面
                    this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "0", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "0", "");
                    this.rptlist.DataBind();

                }
                hywebopen_newdoc();     //新文档OPEN时的特殊处理
            }
            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                this.td_browseflow.Visible = true;  //查看流程

                if (this.Request.QueryString["docid"] != null)
                {
                    this.txtdocid.Value = this.Request.QueryString["docid"].ToString();

                    HyoaClass.Hyoa_flowmain flowmain = new HyoaClass.Hyoa_flowmain();
                    DataTable dt = flowmain.Getflowmain(this.txtdocid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString();
                        this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString();
                        this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                        this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                        this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString();
                        this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString();
                        this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString();
                        this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString();
                        this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString();
                        this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString();
                        this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString();
                        this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString();
                        this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString();
                        this.hy_content1.Text = dt.Rows[0]["hy_content1"].ToString();
                        this.hy_content2.Text = dt.Rows[0]["hy_content2"].ToString();
                        this.hy_content3.Text = dt.Rows[0]["hy_content3"].ToString();
                        this.hy_content4.Text = dt.Rows[0]["hy_content4"].ToString();
                        this.hy_content5.Text = dt.Rows[0]["hy_content5"].ToString();
                        this.hy_content6.Text = dt.Rows[0]["hy_content6"].ToString();
                        this.hy_content7.Text = dt.Rows[0]["hy_content7"].ToString();
                        this.hy_content8.Text = dt.Rows[0]["hy_content8"].ToString();
                        this.hy_content9.Text = dt.Rows[0]["hy_content9"].ToString();
                        this.hy_content10.Text = dt.Rows[0]["hy_content10"].ToString();
                        this.hy_content11.Text = dt.Rows[0]["hy_content11"].ToString();
                        this.hy_content12.Text = dt.Rows[0]["hy_content12"].ToString();
                        this.hy_content13.Text = dt.Rows[0]["hy_content13"].ToString();
                        this.hy_content14.Text = dt.Rows[0]["hy_content14"].ToString();
                        this.hy_content15.Text = dt.Rows[0]["hy_content15"].ToString();
                        this.hy_field1.Text = dt.Rows[0]["hy_field1"].ToString();
                        this.hy_field2.Text = dt.Rows[0]["hy_field2"].ToString();
                        this.hy_field3.Text = dt.Rows[0]["hy_field3"].ToString();
                        this.hy_field4.Text = dt.Rows[0]["hy_field4"].ToString();
                        this.hy_field5.Text = dt.Rows[0]["hy_field5"].ToString();
                        this.hy_field6.Text = dt.Rows[0]["hy_field6"].ToString();
                        this.hy_field7.Text = dt.Rows[0]["hy_field7"].ToString();
                        this.hy_field8.Text = dt.Rows[0]["hy_field8"].ToString();
                        this.hy_field9.Text = dt.Rows[0]["hy_field9"].ToString();
                        this.hy_field10.Text = dt.Rows[0]["hy_field10"].ToString();
                        this.hy_field11.Text = dt.Rows[0]["hy_field11"].ToString();
                        this.hy_field12.Text = dt.Rows[0]["hy_field12"].ToString();
                        this.hy_field13.Text = dt.Rows[0]["hy_field13"].ToString();
                        this.hy_field14.Text = dt.Rows[0]["hy_field14"].ToString();
                        this.hy_field15.Text = dt.Rows[0]["hy_field15"].ToString();
                        this.hy_field16.Text = dt.Rows[0]["hy_field16"].ToString();
                        this.hy_field17.Text = dt.Rows[0]["hy_field17"].ToString();
                        this.hy_field18.Text = dt.Rows[0]["hy_field18"].ToString();
                        this.hy_field19.Text = dt.Rows[0]["hy_field19"].ToString();
                        this.hy_field20.Text = dt.Rows[0]["hy_field20"].ToString();
                        this.hy_field21.Text = dt.Rows[0]["hy_field21"].ToString();
                        this.hy_field22.Text = dt.Rows[0]["hy_field22"].ToString();
                        this.hy_field23.Text = dt.Rows[0]["hy_field23"].ToString();
                        this.hy_field24.Text = dt.Rows[0]["hy_field24"].ToString();
                        this.hy_field25.Text = dt.Rows[0]["hy_field25"].ToString();
                        this.hy_field26.Text = dt.Rows[0]["hy_field26"].ToString();
                        this.hy_field27.Text = dt.Rows[0]["hy_field27"].ToString();
                        this.hy_field28.Text = dt.Rows[0]["hy_field28"].ToString();
                        this.hy_field29.Text = dt.Rows[0]["hy_field29"].ToString();
                        this.hy_field30.Text = dt.Rows[0]["hy_field30"].ToString();
                        this.hy_field31.Text = dt.Rows[0]["hy_field31"].ToString();
                        this.hy_field32.Text = dt.Rows[0]["hy_field32"].ToString();
                        this.hy_field33.Text = dt.Rows[0]["hy_field33"].ToString();
                        this.hy_field34.Text = dt.Rows[0]["hy_field34"].ToString();
                        this.hy_field35.Text = dt.Rows[0]["hy_field35"].ToString();
                        this.hy_field36.Text = dt.Rows[0]["hy_field36"].ToString();
                        this.hy_field37.Text = dt.Rows[0]["hy_field37"].ToString();
                        this.hy_field38.Text = dt.Rows[0]["hy_field38"].ToString();
                        this.hy_field39.Text = dt.Rows[0]["hy_field39"].ToString();
                        this.hy_field40.Text = dt.Rows[0]["hy_field40"].ToString();
                        this.hy_field41.Text = dt.Rows[0]["hy_field41"].ToString();
                        this.hy_field42.Text = dt.Rows[0]["hy_field42"].ToString();
                        this.hy_field43.Text = dt.Rows[0]["hy_field43"].ToString();
                        this.hy_field44.Text = dt.Rows[0]["hy_field44"].ToString();
                        this.hy_field45.Text = dt.Rows[0]["hy_field45"].ToString();
                        this.hy_field46.Text = dt.Rows[0]["hy_field46"].ToString();
                        this.hy_field47.Text = dt.Rows[0]["hy_field47"].ToString();
                        this.hy_field48.Text = dt.Rows[0]["hy_field48"].ToString();
                        this.hy_field49.Text = dt.Rows[0]["hy_field49"].ToString();
                        this.hy_field50.Text = dt.Rows[0]["hy_field50"].ToString();
                        this.hy_field51.Text = dt.Rows[0]["hy_field51"].ToString();
                        this.hy_field52.Text = dt.Rows[0]["hy_field52"].ToString();
                        this.hy_field53.Text = dt.Rows[0]["hy_field53"].ToString();
                        this.hy_field54.Text = dt.Rows[0]["hy_field54"].ToString();
                        this.hy_field55.Text = dt.Rows[0]["hy_field55"].ToString();
                        this.hy_field56.Text = dt.Rows[0]["hy_field56"].ToString();
                        this.hy_field57.Text = dt.Rows[0]["hy_field57"].ToString();
                        this.hy_field58.Text = dt.Rows[0]["hy_field58"].ToString();
                        this.hy_field59.Text = dt.Rows[0]["hy_field59"].ToString();
                        this.hy_field60.Text = dt.Rows[0]["hy_field60"].ToString();
                        this.hy_field61.Text = dt.Rows[0]["hy_field61"].ToString();
                        this.hy_field62.Text = dt.Rows[0]["hy_field62"].ToString();
                        this.hy_field63.Text = dt.Rows[0]["hy_field63"].ToString();
                        this.hy_field64.Text = dt.Rows[0]["hy_field64"].ToString();
                        this.hy_field65.Text = dt.Rows[0]["hy_field65"].ToString();
                        this.hy_field66.Text = dt.Rows[0]["hy_field66"].ToString();
                        this.hy_field67.Text = dt.Rows[0]["hy_field67"].ToString();
                        this.hy_field68.Text = dt.Rows[0]["hy_field68"].ToString();
                        this.hy_field69.Text = dt.Rows[0]["hy_field69"].ToString();
                        this.hy_field70.Text = dt.Rows[0]["hy_field70"].ToString();
                        this.hy_field71.Text = dt.Rows[0]["hy_field71"].ToString();
                        this.hy_field72.Text = dt.Rows[0]["hy_field72"].ToString();
                        this.hy_field73.Text = dt.Rows[0]["hy_field73"].ToString();
                        this.hy_field74.Text = dt.Rows[0]["hy_field74"].ToString();
                        this.hy_field75.Text = dt.Rows[0]["hy_field75"].ToString();
                        this.hy_field76.Text = dt.Rows[0]["hy_field76"].ToString();
                        this.hy_field77.Text = dt.Rows[0]["hy_field77"].ToString();
                        this.hy_field78.Text = dt.Rows[0]["hy_field78"].ToString();
                        this.hy_field79.Text = dt.Rows[0]["hy_field79"].ToString();
                        this.hy_field80.Text = dt.Rows[0]["hy_field80"].ToString();

                        this.hy_field81.Text = dt.Rows[0]["hy_field81"].ToString();
                        this.hy_field82.Text = dt.Rows[0]["hy_field82"].ToString();
                        this.hy_field83.Text = dt.Rows[0]["hy_field83"].ToString();
                        this.hy_field84.Text = dt.Rows[0]["hy_field84"].ToString();
                        this.hy_field85.Text = dt.Rows[0]["hy_field85"].ToString();
                        this.hy_field86.Text = dt.Rows[0]["hy_field86"].ToString();
                        this.hy_field87.Text = dt.Rows[0]["hy_field87"].ToString();
                        this.hy_field88.Text = dt.Rows[0]["hy_field88"].ToString();
                        this.hy_field89.Text = dt.Rows[0]["hy_field89"].ToString();
                        this.hy_field90.Text = dt.Rows[0]["hy_field90"].ToString();

                        this.hy_field91.Text = dt.Rows[0]["hy_field91"].ToString();
                        this.hy_field92.Text = dt.Rows[0]["hy_field92"].ToString();
                        this.hy_field93.Text = dt.Rows[0]["hy_field93"].ToString();
                        this.hy_field94.Text = dt.Rows[0]["hy_field94"].ToString();
                        this.hy_field95.Text = dt.Rows[0]["hy_field95"].ToString();
                        this.hy_field96.Text = dt.Rows[0]["hy_field96"].ToString();
                        this.hy_field97.Text = dt.Rows[0]["hy_field97"].ToString();
                        this.hy_field98.Text = dt.Rows[0]["hy_field98"].ToString();
                        this.hy_field99.Text = dt.Rows[0]["hy_field99"].ToString();
                        this.hy_field100.Text = dt.Rows[0]["hy_field100"].ToString();

                        this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString();
                        this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString();
                        this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString();
                    }
                    dt.Clear();
                    //流程文档
                    if (this.txtifhaveflow.Value == "是")
                    {
                        //流程已结束
                        if (this.hy_curtacheid.Text == "**")
                        {
                            //////////////流程已结束///////////////////////
                            this.lblcurtachenameshow.Text = "流程已结束";

                            UpdateReadFlag();  //打开时置为已读
                            //////////////流程已结束///////////////////////
                        }
                        else
                        {
                            //////////////流程未结束///////////////////////
                            //判断是否为当前处理人
                            if (this.hy_curclrid.Text.IndexOf(this.Session["hyuid"].ToString()) >= 0)
                            {
                                this.txtSystemClRight.Value = "1";
                                this.td_submit.Visible = true; //保存
                                this.td_nextstep.Visible = true; //提交
                                this.td_returnsumbit.Visible = true; //退回
                            }
                            else
                            {
                                //判断是否为传阅人
                                HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                                dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                                if (dt.Rows.Count > 0)
                                {
                                    this.txtSystemYdRight.Value = "1";
                                }
                                //判断是否是上一环节处理人
                                HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                                if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                {
                                    this.txtiflastclr.Value = "1";
                                    this.txtSystemYdRight.Value = "1";
                                    this.td_withdraw.Visible = true; //收回
                                    this.td_press.Visible = true; //催办
                                }
                                else
                                {
                                    //判断是否是历史处理人员
                                    if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                    {
                                        this.txtifhistoryclr.Value = "1";
                                        this.txtSystemYdRight.Value = "1";
                                        this.td_press.Visible = true; //催办
                                    }
                                }
                            }
                            //判断是否为最后一个环节
                            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                            DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            if (dtflowwork.Rows.Count > 0)
                            {
                                if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                    this.txtiflasttache.Value = "1";
                            }
                            dtflowwork.Clear();
                            //既没有处理权限,又没有阅读权限的情况下
                            if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                            {
                                Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');history.back();</script>");
                            }
                            //////////////流程未结束///////////////////////
                        }
                        //加载页面
                        this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "1", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);
                        this.rptlist.DataBind();
                    }
                    else
                    {
                        this.lblcurtachenameshow.Text = this.lbltablename.Text;

                        //非流程表单
                        this.td_nextstep.Visible = false;
                        this.td_withdraw.Visible = false;
                        this.td_returnsumbit.Visible = false;
                        this.td_press.Visible = false;
                        this.td_browseflow.Visible = false;

                        ////////////判断当前表单是否为只显示个人
                        //////////HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                        //////////DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                        //////////if (dt_tableconfig.Rows.Count > 0)
                        //////////{
                        //////////    //不是流程文档,不显示所有记录
                        //////////    if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "否" && dt_tableconfig.Rows[0]["hy_ifdisplayall"].ToString() == "否")
                        //////////    {
                        //////////        //判断是否为当前文档登记人
                        //////////        if(this.hy_djrid.Text==Session["hyuid"].ToString())
                        //////////            this.txtSystemClRight.Value = "1";
                        //////////    }
                        //////////    else
                        //////////    {
                        //////////        if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                        //////////            this.txtSystemClRight.Value = "1";
                        //////////    }
                        //////////}

                        //如果非流程(授权用户统一管理)
                        if (this.txttablerole.Value == "0")
                        {
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                                this.txtSystemClRight.Value = "1";
                        }
                        //如果非流程(每个人管理自己的信息)
                        if (this.txttablerole.Value == "1")
                        {
                            //判断是否为当前文档登记人
                            if (this.hy_djrid.Text == Session["hyuid"].ToString())
                                this.txtSystemClRight.Value = "1";
                        }
                        //如果非流程(每个人操作自己的信息、授权用户可管理所有信息)
                        if (this.txttablerole.Value == "2")
                        {
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            {
                                this.txtSystemClRight.Value = "1";
                            }
                            else
                            {
                                if (this.hy_djrid.Text == Session["hyuid"].ToString())
                                    this.txtSystemClRight.Value = "1";
                            }
                        }

                        if (this.txtSystemClRight.Value == "1")
                            this.td_submit.Visible = true; //保存
                        else
                            this.td_submit.Visible = false; //保存

                        //加载页面
                        this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "1", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "0","");
                        this.rptlist.DataBind();

                        UpdateReadFlag();  //打开时置为已读
                    }

                }
                hywebopen_olddoc(); //旧文档OPEN的特殊处理
            }
        }
    }
Exemplo n.º 6
0
    //加载主表单    Written by xf 20110515
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //新文档
            if (this.Request.QueryString["op"] == "add")
            {
                HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                //文档ID
                this.txtdocid.Value = Hyoa_global.GetRandom();

                this.hy_djrid.Text = this.Session["hyuid"].ToString();
                this.hy_djrname.Text = this.Session["hyuname"].ToString();
                this.hy_djrbmid.Text = this.Session["hydeptid"].ToString();
                this.hy_djrbmname.Text = this.Session["hydeptname"].ToString();
                this.hy_djsj.Text = System.DateTime.Now.ToString();

                if (this.txtifhaveflow.Value == "是")
                {
                    HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                    DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                    if (dt_tableconfig.Rows.Count > 0)
                    {
                        if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是")
                        {
                            //根据模块ID得到流程信息
                            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
                            DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text);
                            //Response.Write("<script>alert('"+dt.Rows.Count.ToString()+"')</script>");
                            if (dt.Rows.Count > 0)
                            {
                                //判断当前用户是否有登记权限
                                //得到第一环节ID
                                string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString());
                                if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString()))
                                {
                                    this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                                    this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                                    this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString();
                                    this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                    this.hy_curclrid.Text = this.Session["hyuid"].ToString();
                                    this.hy_curclrname.Text = this.Session["hyuname"].ToString();
                                    this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                    this.txtSystemClRight.Value = "1";
                                }
                                else
                                {
                                    Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');history.back();</script>");
                                }
                            }
                            dt.Clear();
                            this.td_nextstep.Visible = true; //提交
                        }
                    }
                    //加载页面
                    this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "0", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);
                    this.rptlist.DataBind();
                    this.td_submit.Visible = true; //保存
                }
                else
                {
                    this.lblcurtachenameshow.Text = this.lbltablename.Text;
                    //如果非流程(授权用户统一管理)
                    if (this.txttablerole.Value == "0")
                    {
                        if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            this.txtSystemClRight.Value = "1";
                    }
                    //如果非流程(每个人管理自己的信息)
                    if (this.txttablerole.Value == "1")
                    {
                        this.txtSystemClRight.Value = "1";
                    }
                    //如果非流程(每个人操作自己的信息、授权用户可管理所有信息)
                    if (this.txttablerole.Value == "2")
                    {
                        this.txtSystemClRight.Value = "1";
                    }

                    if (this.txtSystemClRight.Value == "1")
                        this.td_submit.Visible = true; //保存
                    else
                        this.td_submit.Visible = false; //保存

                    //加载页面
                    this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "0", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "0", "");
                    this.rptlist.DataBind();
                }
                hywebopen_newdoc();     //新文档OPEN时的特殊处理
            }
            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                this.td_browseflow.Visible = true;  //查看流程

                if (this.Request.QueryString["docid"] != null)
                {
                    this.txtdocid.Value = this.Request.QueryString["docid"].ToString();

                    HyoaClass.Hyoa_flowmain flowmain = new HyoaClass.Hyoa_flowmain();
                    DataTable dt = flowmain.Getflowmain(this.txtdocid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString();
                        this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString();
                        this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                        this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                        this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString();
                        this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString();
                        this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString();
                        this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString();
                        this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString();
                        this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString();
                        this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString();
                        this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString();
                        this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString();
                        this.hy_content1.Text = dt.Rows[0]["hy_content1"].ToString();
                        this.hy_content2.Text = dt.Rows[0]["hy_content2"].ToString();
                        this.hy_content3.Text = dt.Rows[0]["hy_content3"].ToString();
                        this.hy_content4.Text = dt.Rows[0]["hy_content4"].ToString();
                        this.hy_content5.Text = dt.Rows[0]["hy_content5"].ToString();
                        this.hy_content6.Text = dt.Rows[0]["hy_content6"].ToString();
                        this.hy_content7.Text = dt.Rows[0]["hy_content7"].ToString();
                        this.hy_content8.Text = dt.Rows[0]["hy_content8"].ToString();
                        this.hy_content9.Text = dt.Rows[0]["hy_content9"].ToString();
                        this.hy_content10.Text = dt.Rows[0]["hy_content10"].ToString();
                        this.hy_content11.Text = dt.Rows[0]["hy_content11"].ToString();
                        this.hy_content12.Text = dt.Rows[0]["hy_content12"].ToString();
                        this.hy_content13.Text = dt.Rows[0]["hy_content13"].ToString();
                        this.hy_content14.Text = dt.Rows[0]["hy_content14"].ToString();
                        this.hy_content15.Text = dt.Rows[0]["hy_content15"].ToString();
                        this.hy_field1.Text = dt.Rows[0]["hy_field1"].ToString();
                        this.hy_field2.Text = dt.Rows[0]["hy_field2"].ToString();
                        this.hy_field3.Text = dt.Rows[0]["hy_field3"].ToString();
                        this.hy_field4.Text = dt.Rows[0]["hy_field4"].ToString();
                        this.hy_field5.Text = dt.Rows[0]["hy_field5"].ToString();
                        this.hy_field6.Text = dt.Rows[0]["hy_field6"].ToString();
                        this.hy_field7.Text = dt.Rows[0]["hy_field7"].ToString();
                        this.hy_field8.Text = dt.Rows[0]["hy_field8"].ToString();
                        this.hy_field9.Text = dt.Rows[0]["hy_field9"].ToString();
                        this.hy_field10.Text = dt.Rows[0]["hy_field10"].ToString();
                        this.hy_field11.Text = dt.Rows[0]["hy_field11"].ToString();
                        this.hy_field12.Text = dt.Rows[0]["hy_field12"].ToString();
                        this.hy_field13.Text = dt.Rows[0]["hy_field13"].ToString();
                        this.hy_field14.Text = dt.Rows[0]["hy_field14"].ToString();
                        this.hy_field15.Text = dt.Rows[0]["hy_field15"].ToString();
                        this.hy_field16.Text = dt.Rows[0]["hy_field16"].ToString();
                        this.hy_field17.Text = dt.Rows[0]["hy_field17"].ToString();
                        this.hy_field18.Text = dt.Rows[0]["hy_field18"].ToString();
                        this.hy_field19.Text = dt.Rows[0]["hy_field19"].ToString();
                        this.hy_field20.Text = dt.Rows[0]["hy_field20"].ToString();
                        this.hy_field21.Text = dt.Rows[0]["hy_field21"].ToString();
                        this.hy_field22.Text = dt.Rows[0]["hy_field22"].ToString();
                        this.hy_field23.Text = dt.Rows[0]["hy_field23"].ToString();
                        this.hy_field24.Text = dt.Rows[0]["hy_field24"].ToString();
                        this.hy_field25.Text = dt.Rows[0]["hy_field25"].ToString();
                        this.hy_field26.Text = dt.Rows[0]["hy_field26"].ToString();
                        this.hy_field27.Text = dt.Rows[0]["hy_field27"].ToString();
                        this.hy_field28.Text = dt.Rows[0]["hy_field28"].ToString();
                        this.hy_field29.Text = dt.Rows[0]["hy_field29"].ToString();
                        this.hy_field30.Text = dt.Rows[0]["hy_field30"].ToString();
                        this.hy_field31.Text = dt.Rows[0]["hy_field31"].ToString();
                        this.hy_field32.Text = dt.Rows[0]["hy_field32"].ToString();
                        this.hy_field33.Text = dt.Rows[0]["hy_field33"].ToString();
                        this.hy_field34.Text = dt.Rows[0]["hy_field34"].ToString();
                        this.hy_field35.Text = dt.Rows[0]["hy_field35"].ToString();
                        this.hy_field36.Text = dt.Rows[0]["hy_field36"].ToString();
                        this.hy_field37.Text = dt.Rows[0]["hy_field37"].ToString();
                        this.hy_field38.Text = dt.Rows[0]["hy_field38"].ToString();
                        this.hy_field39.Text = dt.Rows[0]["hy_field39"].ToString();
                        this.hy_field40.Text = dt.Rows[0]["hy_field40"].ToString();
                        this.hy_field41.Text = dt.Rows[0]["hy_field41"].ToString();
                        this.hy_field42.Text = dt.Rows[0]["hy_field42"].ToString();
                        this.hy_field43.Text = dt.Rows[0]["hy_field43"].ToString();
                        this.hy_field44.Text = dt.Rows[0]["hy_field44"].ToString();
                        this.hy_field45.Text = dt.Rows[0]["hy_field45"].ToString();
                        this.hy_field46.Text = dt.Rows[0]["hy_field46"].ToString();
                        this.hy_field47.Text = dt.Rows[0]["hy_field47"].ToString();
                        this.hy_field48.Text = dt.Rows[0]["hy_field48"].ToString();
                        this.hy_field49.Text = dt.Rows[0]["hy_field49"].ToString();
                        this.hy_field50.Text = dt.Rows[0]["hy_field50"].ToString();
                        this.hy_field51.Text = dt.Rows[0]["hy_field51"].ToString();
                        this.hy_field52.Text = dt.Rows[0]["hy_field52"].ToString();
                        this.hy_field53.Text = dt.Rows[0]["hy_field53"].ToString();
                        this.hy_field54.Text = dt.Rows[0]["hy_field54"].ToString();
                        this.hy_field55.Text = dt.Rows[0]["hy_field55"].ToString();
                        this.hy_field56.Text = dt.Rows[0]["hy_field56"].ToString();
                        this.hy_field57.Text = dt.Rows[0]["hy_field57"].ToString();
                        this.hy_field58.Text = dt.Rows[0]["hy_field58"].ToString();
                        this.hy_field59.Text = dt.Rows[0]["hy_field59"].ToString();
                        this.hy_field60.Text = dt.Rows[0]["hy_field60"].ToString();
                        this.hy_field61.Text = dt.Rows[0]["hy_field61"].ToString();
                        this.hy_field62.Text = dt.Rows[0]["hy_field62"].ToString();
                        this.hy_field63.Text = dt.Rows[0]["hy_field63"].ToString();
                        this.hy_field64.Text = dt.Rows[0]["hy_field64"].ToString();
                        this.hy_field65.Text = dt.Rows[0]["hy_field65"].ToString();
                        this.hy_field66.Text = dt.Rows[0]["hy_field66"].ToString();
                        this.hy_field67.Text = dt.Rows[0]["hy_field67"].ToString();
                        this.hy_field68.Text = dt.Rows[0]["hy_field68"].ToString();
                        this.hy_field69.Text = dt.Rows[0]["hy_field69"].ToString();
                        this.hy_field70.Text = dt.Rows[0]["hy_field70"].ToString();
                        this.hy_field71.Text = dt.Rows[0]["hy_field71"].ToString();
                        this.hy_field72.Text = dt.Rows[0]["hy_field72"].ToString();
                        this.hy_field73.Text = dt.Rows[0]["hy_field73"].ToString();
                        this.hy_field74.Text = dt.Rows[0]["hy_field74"].ToString();
                        this.hy_field75.Text = dt.Rows[0]["hy_field75"].ToString();
                        this.hy_field76.Text = dt.Rows[0]["hy_field76"].ToString();
                        this.hy_field77.Text = dt.Rows[0]["hy_field77"].ToString();
                        this.hy_field78.Text = dt.Rows[0]["hy_field78"].ToString();
                        this.hy_field79.Text = dt.Rows[0]["hy_field79"].ToString();
                        this.hy_field80.Text = dt.Rows[0]["hy_field80"].ToString();

                        this.hy_field81.Text = dt.Rows[0]["hy_field81"].ToString();
                        this.hy_field82.Text = dt.Rows[0]["hy_field82"].ToString();
                        this.hy_field83.Text = dt.Rows[0]["hy_field83"].ToString();
                        this.hy_field84.Text = dt.Rows[0]["hy_field84"].ToString();
                        this.hy_field85.Text = dt.Rows[0]["hy_field85"].ToString();
                        this.hy_field86.Text = dt.Rows[0]["hy_field86"].ToString();
                        this.hy_field87.Text = dt.Rows[0]["hy_field87"].ToString();
                        this.hy_field88.Text = dt.Rows[0]["hy_field88"].ToString();
                        this.hy_field89.Text = dt.Rows[0]["hy_field89"].ToString();
                        this.hy_field90.Text = dt.Rows[0]["hy_field90"].ToString();

                        this.hy_field91.Text = dt.Rows[0]["hy_field91"].ToString();
                        this.hy_field92.Text = dt.Rows[0]["hy_field92"].ToString();
                        this.hy_field93.Text = dt.Rows[0]["hy_field93"].ToString();
                        this.hy_field94.Text = dt.Rows[0]["hy_field94"].ToString();
                        this.hy_field95.Text = dt.Rows[0]["hy_field95"].ToString();
                        this.hy_field96.Text = dt.Rows[0]["hy_field96"].ToString();
                        this.hy_field97.Text = dt.Rows[0]["hy_field97"].ToString();
                        this.hy_field98.Text = dt.Rows[0]["hy_field98"].ToString();
                        this.hy_field99.Text = dt.Rows[0]["hy_field99"].ToString();
                        this.hy_field100.Text = dt.Rows[0]["hy_field100"].ToString();

                        this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString();
                        this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString();
                        this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString();

                        //信息管理市局录用记录 特殊显示取消按钮用于删除复制的这条数据
                        if (this.hy_mudelid.Text == "xxgl" && this.hy_tableid.Text == "f1265875-5494-465f-ac33-6fa43d208c8f" && this.hy_field100.Text == "1")
                        {
                            //this.td_qx.Visible = true;
                            this.td_return.Visible = false;
                        }
                        HyoaClass.DAO DAO = new HyoaClass.DAO();
                        string sql_SelectCount = "select count(*) as num from hyp_flowhistoryinfo_cl where docid='" + this.txtdocid.Value + "'";
                        DataTable dt_Count = DAO.GetDataTable(sql_SelectCount);
                        if (dt_Count.Rows.Count > 0)
                        {
                            this.txtclts.Value = dt_Count.Rows[0]["num"].ToString();
                        }
                    }
                    dt.Clear();
                    //流程文档
                    if (this.txtifhaveflow.Value == "是")
                    {
                        //流程已结束
                        if (this.hy_curtacheid.Text == "**")
                        {
                            //////////////流程已结束///////////////////////
                            this.lblcurtachenameshow.Text = "流程已结束";

                            UpdateReadFlag();  //打开时置为已读
                            //////////////流程已结束///////////////////////
                        }
                        else
                        {
                            //////////////流程未结束///////////////////////
                            //判断是否为当前处理人
                            if (this.hy_curclrid.Text.IndexOf(this.Session["hyuid"].ToString()) >= 0)
                            {
                                this.txtSystemClRight.Value = "1";
                                this.td_submit.Visible = true; //保存
                                this.td_nextstep.Visible = true; //提交
                                this.td_returnsumbit.Visible = true; //退回

                            }
                            else
                            {
                                //判断是否为传阅人
                                HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                                dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                                if (dt.Rows.Count > 0)
                                {
                                    this.txtSystemYdRight.Value = "1";
                                }
                                //判断是否是上一环节处理人
                                HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                                if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                {
                                    this.txtiflastclr.Value = "1";
                                    this.txtSystemYdRight.Value = "1";
                                    this.td_withdraw.Visible = true; //收回
                                    this.td_press.Visible = true; //催办
                                }
                                else
                                {
                                    //判断是否是历史处理人员
                                    if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                    {
                                        this.txtifhistoryclr.Value = "1";
                                        this.txtSystemYdRight.Value = "1";
                                        this.td_press.Visible = true; //催办
                                    }
                                }
                            }
                            //判断是否为最后一个环节
                            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                            DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            if (dtflowwork.Rows.Count > 0)
                            {
                                if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                    this.txtiflasttache.Value = "1";
                            }
                            dtflowwork.Clear();
                            //既没有处理权限,又没有阅读权限的情况下
                            if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                            {
                                Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');history.back();</script>");
                            }
                            //////////////流程未结束///////////////////////
                        }
                        //加载页面
                        this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "1", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);
                        this.rptlist.DataBind();

                        ////////补充意见s  只要是旧文档,且有流程的模块就能填写轮阅意见
                        this.tb_bctitle.Visible = true;
                        this.tb_bcbody.Visible = true;
                        //流程已结束
                        if (this.hy_curtacheid.Text == "**")
                        {
                            this.tr_bcyj.Visible = false;
                        }
                        else
                        {
                            this.tr_bcyj.Visible = true;
                        }
                        //得到已经补充意见内容
                        HyoaClass.Hyoa_bcyj Hyoa_bcyj = new HyoaClass.Hyoa_bcyj();
                        DataTable dt_bcyj = Hyoa_bcyj.GetdocsByfatherid(this.txtdocid.Value);
                        if (dt_bcyj.Rows.Count > 0)
                        {
                            //输出补充意见记录
                            this.lblbody_bcyj.Text = "";
                            for (var i = 0; i < dt_bcyj.Rows.Count; i++)
                            {
                                this.lblbody_bcyj.Text += dt_bcyj.Rows[i]["hy_bcbody"].ToString() + "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                this.lblbody_bcyj.Text += "(轮阅人:" + dt_bcyj.Rows[i]["hy_bcusername"].ToString() + "&nbsp;&nbsp;&nbsp;所在部门:" + dt_bcyj.Rows[i]["hy_bcdeptname"].ToString();
                                this.lblbody_bcyj.Text += "&nbsp;&nbsp;&nbsp;填写时间:" + dt_bcyj.Rows[i]["hy_bctime"].ToString();
                                //+ "&nbsp;&nbsp;&nbsp;IP:" + dt_bcyj.Rows[i]["hy_bcip"].ToString();
                                this.lblbody_bcyj.Text += ")<br><hr height=1 color=#DEEEFE></hr>";
                            }
                        }
                        ////////补充意见e
                    }
                    else
                    {
                        this.lblcurtachenameshow.Text = this.lbltablename.Text;

                        //非流程表单
                        this.td_nextstep.Visible = false;
                        this.td_withdraw.Visible = false;
                        this.td_returnsumbit.Visible = false;
                        this.td_press.Visible = false;
                        this.td_browseflow.Visible = false;

                        ////////////判断当前表单是否为只显示个人
                        //////////HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                        //////////DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                        //////////if (dt_tableconfig.Rows.Count > 0)
                        //////////{
                        //////////    //不是流程文档,不显示所有记录
                        //////////    if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "否" && dt_tableconfig.Rows[0]["hy_ifdisplayall"].ToString() == "否")
                        //////////    {
                        //////////        //判断是否为当前文档登记人
                        //////////        if(this.hy_djrid.Text==Session["hyuid"].ToString())
                        //////////            this.txtSystemClRight.Value = "1";
                        //////////    }
                        //////////    else
                        //////////    {
                        //////////        if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                        //////////            this.txtSystemClRight.Value = "1";
                        //////////    }
                        //////////}

                        //如果非流程(授权用户统一管理)
                        if (this.txttablerole.Value == "0")
                        {
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                                this.txtSystemClRight.Value = "1";
                        }
                        //如果非流程(每个人管理自己的信息)
                        if (this.txttablerole.Value == "1")
                        {
                            //判断是否为当前文档登记人
                            if (this.hy_djrid.Text == Session["hyuid"].ToString())
                                this.txtSystemClRight.Value = "1";
                        }
                        //如果非流程(每个人操作自己的信息、授权用户可管理所有信息)
                        if (this.txttablerole.Value == "2")
                        {
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            {
                                this.txtSystemClRight.Value = "1";
                            }
                            else
                            {
                                if (this.hy_djrid.Text == Session["hyuid"].ToString())
                                    this.txtSystemClRight.Value = "1";
                            }
                        }

                        if (this.txtSystemClRight.Value == "1")
                        {
                            //只有登记人和管理员可以修改,有保存按钮
                            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                            if (this.hy_djrid.Text == Session["hyuid"].ToString() || Hyoa_global.isHaveRole("Role9999", Session["hyuid"].ToString()))
                            {
                                this.td_submit.Visible = true; //保存

                                //信息管理市局录用记录
                                if (this.hy_mudelid.Text == "xxgl" && this.hy_tableid.Text == "f1265875-5494-465f-ac33-6fa43d208c8f")
                                {
                                    this.td_sc.Visible = false; //删除
                                }
                            }
                            else
                            {
                                this.td_submit.Visible = false; //保存
                            }
                        }
                        else
                        {
                            this.td_submit.Visible = false; //保存
                        }

                        //加载页面
                        this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "1", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "0", "");
                        this.rptlist.DataBind();

                        UpdateReadFlag();  //打开时置为已读
                    }

                }
                hywebopen_olddoc(); //旧文档OPEN的特殊处理
            }
        }
    }
Exemplo n.º 7
0
    //加载主表单    Written by xf 20110515
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //新文档
            if (this.Request.QueryString["op"] == "add")
            {
                //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                //文档ID
                this.txtdocid.Value = Hyoa_global.GetRandom();

                this.hy_djrid.Text = this.Session["hyuid"].ToString();
                this.hy_djrname.Text = this.Session["hyuname"].ToString();
                this.hy_djrbmid.Text = this.Session["hydeptid"].ToString();
                this.hy_djrbmname.Text = this.Session["hydeptname"].ToString();
                this.hy_djsj.Text = System.DateTime.Now.ToString();
                this.txthyc_nf.Text = System.DateTime.Now.ToString("yyyy");
                this.txthyc_djsj.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
                this.txthyc_lxks.Text = this.Session["hydeptname"].ToString();
                this.txthyc_lxr.Text = this.Session["hyuname"].ToString();
                HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                if (dt_tableconfig.Rows.Count > 0)
                {
                    if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是")
                    {
                        //根据模块ID得到流程信息
                        HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
                        DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text);
                        //Response.Write("<script>alert('"+dt.Rows.Count.ToString()+"')</script>");
                        if (dt.Rows.Count > 0)
                        {
                            //判断当前用户是否有登记权限
                            //得到第一环节ID
                            string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString());
                            if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString()))
                            {
                                this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                                this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                                this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString();
                                this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                this.hy_curclrid.Text = this.Session["hyuid"].ToString();
                                this.hy_curclrname.Text = this.Session["hyuname"].ToString();
                                this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                this.txtSystemClRight.Value = "1";
                                this.txtSystemYdRight.Value = "0";
                            }
                            else
                            {
                                Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');</script>");
                            }
                        }
                        dt.Clear();
                        this.td_nextstep.Visible = true; //提交
                        this.td_submit.Visible = true; //保存
                    }
                }
                //加载页面
                WebOpen(this.hy_mudelid.Text, this.hy_tableid.Text, this.hy_flowid.Text, this.hy_curtacheid.Text, this.txtSystemClRight.Value, this.txtSystemYdRight.Value, "0");
            }
            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                this.td_browseflow.Visible = true;  //查看流程

                if (this.Request.QueryString["docid"] != null)
                {
                    this.txtdocid.Value = this.Request.QueryString["docid"].ToString();

                    //HyoaClass.Hyoa_flowmain flowmain = new HyoaClass.Hyoa_flowmain();
                    //DataTable dt = flowmain.Getflowmain(this.txtdocid.Value);
                    //HyoaClass.Hyoa_global Hyoa_global=new HyoaClass.Hyoa_global ();
                    string lssql = "select * from hyc_Tabledcxt where DOCID='" + this.txtdocid.Value + "'";
                    DataTable dt = Hyoa_global.GetDataTable(lssql);
                    if (dt.Rows.Count > 0)
                    {
                        this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString();
                        this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString();
                        this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                        this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                        this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString();
                        this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString();
                        this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString();
                        this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString();
                        this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString();
                        this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString();
                        this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString();
                        this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString();
                        this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString();

                        string lssqlfield = "SELECT * FROM hyt_flowfield WHERE (hy_tableid = 'Tabledcxt') AND (hy_mudelid = 'Mudeldcxt')";
                        DataTable dtfield = Hyoa_global.GetDataTable_BASE(lssqlfield); //得到所有配置域
                        for (int ii = 0; ii < dtfield.Rows.Count; ii++)
                        {
                            if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "文本")
                            {
                                TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                                txt1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                                Label lbl1 = (Label)this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                                lbl1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                            }
                            if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "多行文本")
                            {
                                TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                                txt1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                                Label lbl1 = (Label)this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                                lbl1.Text = RtfToText2(dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString());
                            }
                            if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "日期")
                            {
                                TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                                Label lbl1 = (Label)this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                                if (dtfield.Rows[ii]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                                {
                                    txt1.Text = System.DateTime.Parse(dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString()).ToShortDateString();
                                    lbl1.Text = System.DateTime.Parse(dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString()).ToShortDateString();
                                }
                                else
                                {
                                    txt1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                                    lbl1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                                }
                            }
                            if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "对话框列表")
                            {
                                DropDownList ddl1 = (DropDownList)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                                ddl1.SelectedValue = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                                Label lbl1 = (Label)this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString());
                                lbl1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                            }
                            //this.FindControl("11111"). = "1";
                            //this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()).value = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                            //this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()).value = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString();
                        }

                        //this.txthyc_nf.Text = dt.Rows[0]["hyc_nf"].ToString();
                        //this.txthyc_bh.Text = dt.Rows[0]["hyc_bh"].ToString();
                        //this.txthyc_lb.SelectedValue = dt.Rows[0]["hyc_lb"].ToString();
                        //this.txthyc_hj.SelectedValue = dt.Rows[0]["hyc_hj"].ToString();
                        //this.txthyc_djsj.Text = dt.Rows[0]["hyc_djsj"].ToString();
                        //this.txthyc_cbdw.Text = dt.Rows[0]["hyc_cbdw"].ToString();
                        //this.txthyc_dcsx.Text = dt.Rows[0]["hyc_dcsx"].ToString();
                        //this.txthyc_blyq.Text = dt.Rows[0]["hyc_blyq"].ToString();
                        //this.txthyc_lxks.Text = dt.Rows[0]["hyc_lxks"].ToString();
                        //this.txthyc_lxr.Text = dt.Rows[0]["hyc_lxr"].ToString();
                        //this.txthyc_lxdh.Text = dt.Rows[0]["hyc_lxdh"].ToString();
                        //this.txthyc_cbqx.Text = dt.Rows[0]["hyc_cbqx"].ToString();

                        //this.lblhyc_nf.Text = dt.Rows[0]["hyc_nf"].ToString();
                        //this.lblhyc_bh.Text = dt.Rows[0]["hyc_bh"].ToString();
                        //this.lblhyc_lb.SelectedValue = dt.Rows[0]["hyc_lb"].ToString();
                        //this.lblhyc_hj.SelectedValue = dt.Rows[0]["hyc_hj"].ToString();
                        //this.lblhyc_djsj.Text = dt.Rows[0]["hyc_djsj"].ToString();
                        //this.lblhyc_cbdw.Text = dt.Rows[0]["hyc_cbdw"].ToString();
                        //this.lblhyc_dcsx.Text = dt.Rows[0]["hyc_dcsx"].ToString();
                        //this.lblhyc_blyq.Text = dt.Rows[0]["hyc_blyq"].ToString();
                        //this.lblhyc_lxks.Text = dt.Rows[0]["hyc_lxks"].ToString();
                        //this.lblhyc_lxr.Text = dt.Rows[0]["hyc_lxr"].ToString();
                        //this.lblhyc_lxdh.Text = dt.Rows[0]["hyc_lxdh"].ToString();
                        //this.lblhyc_cbqx.Text = dt.Rows[0]["hyc_cbqx"].ToString();

                        this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString();
                        this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString();
                        this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString();
                    }
                    dt.Clear();
                    //流程文档
                    if (this.txtifhaveflow.Value == "是")
                    {
                        //流程已结束
                        if (this.hy_curtacheid.Text == "**")
                        {
                            //////////////流程已结束///////////////////////
                            this.lblcurtachenameshow.Text = "流程已结束";
                            //UpdateReadFlag();  //打开时置为已读
                            //////////////流程已结束///////////////////////
                            //判断是否为传阅人
                            HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                            dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                            if (dt.Rows.Count > 0)
                            {
                                this.txtSystemClRight.Value = "0";
                                this.txtSystemYdRight.Value = "1";
                            }
                            //判断是否历史处理人
                            //判断是否是历史处理人员
                            //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                            if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                            {
                                this.txtifhistoryclr.Value = "1";
                                this.txtSystemClRight.Value = "0";
                                this.txtSystemYdRight.Value = "1";
                            }
                        }
                        else
                        {
                            //////////////流程未结束///////////////////////
                            //判断是否为当前处理人
                            if (this.hy_curclrid.Text.IndexOf(this.Session["hyuid"].ToString()) >= 0)
                            {
                                this.txtSystemClRight.Value = "1";
                                this.txtSystemYdRight.Value = "0";
                                this.td_submit.Visible = true; //保存
                                this.td_nextstep.Visible = true; //提交
                                //this.td_returnsumbit.Visible = true; //退回
                            }
                            else
                            {
                                //判断是否为传阅人
                                HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                                dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                                if (dt.Rows.Count > 0)
                                {
                                    this.txtSystemClRight.Value = "0";
                                    this.txtSystemYdRight.Value = "1";
                                }
                                //判断是否是上一环节处理人
                                //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                                if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                {
                                    this.txtiflastclr.Value = "1";
                                    this.txtSystemClRight.Value = "0";
                                    this.txtSystemYdRight.Value = "1";
                                    //this.td_withdraw.Visible = true; //收回
                                    //this.td_press.Visible = true; //催办
                                }
                                else
                                {
                                    //判断是否是历史处理人员
                                    if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                    {
                                        this.txtifhistoryclr.Value = "1";
                                        this.txtSystemClRight.Value = "0";
                                        this.txtSystemYdRight.Value = "1";
                                        //this.td_press.Visible = true; //催办
                                    }
                                }
                            }
                            //判断是否为最后一个环节
                            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                            DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            if (dtflowwork.Rows.Count > 0)
                            {
                                if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                    this.txtiflasttache.Value = "1";
                            }
                            dtflowwork.Clear();
                            //////////////流程未结束///////////////////////
                        }
                        //既没有处理权限,又没有阅读权限的情况下
                        if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                        {
                            Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');</script>");
                        }
                        //加载页面
                        WebOpen(this.hy_mudelid.Text, this.hy_tableid.Text, this.hy_flowid.Text, this.hy_curtacheid.Text, this.txtSystemClRight.Value, this.txtSystemYdRight.Value, "1");
                    }

                }
            }

            //隐藏、显示控制
            string lssqlfield5 = "SELECT * FROM hyt_flowfield WHERE (hy_tableid = 'Tabledcxt') AND (hy_mudelid = 'Mudeldcxt')";
            DataTable dtfield5 = Hyoa_global.GetDataTable_BASE(lssqlfield5); //得到所有配置域
            string lssqlflowtachefield = "";//流程环节对应的域
            DataTable dtflowtachefield;
            for (int ii = 0; ii < dtfield5.Rows.Count; ii++)
            {
                lssqlflowtachefield = "select * from hyt_flowtachefield where hy_flowid = '" + this.hy_flowid.Text + "' and hy_tacheid = '" + this.hy_curtacheid.Text + "' and hy_fieldid='" + dtfield5.Rows[ii]["hy_fieldid"].ToString() + "'";
                dtflowtachefield = Hyoa_global.GetDataTable_BASE(lssqlflowtachefield);
                if (dtflowtachefield.Rows.Count > 0)
                {
                    this.FindControl("txthyc_" + dtfield5.Rows[ii]["hy_fieldid"].ToString()).Visible = true;
                    this.FindControl("lblhyc_" + dtfield5.Rows[ii]["hy_fieldid"].ToString()).Visible = false;
                }
                else
                {
                    this.FindControl("txthyc_" + dtfield5.Rows[ii]["hy_fieldid"].ToString()).Visible = false;
                    this.FindControl("lblhyc_" + dtfield5.Rows[ii]["hy_fieldid"].ToString()).Visible = true;
                }

            }

        }
    }
Exemplo n.º 8
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);
    }
Exemplo n.º 9
0
    //加载主表单    Written by xf 20110515
    private void DataPlay()
    {
        txtsavefields.Text = "";
        txtsavefields_sx.Text = "";

        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

            //新文档
            if (this.Request.QueryString["op"] == "add")
            {
                //文档ID(保存POST到当前页面时,DOCID不重新加载)
                if (!this.IsPostBack)
                {
                    this.txtdocid.Value = Hyoa_global.GetRandom();
                }
                this.hy_djrid.Text = this.Session["hyuid"].ToString();
                this.hy_djrname.Text = this.Session["hyuname"].ToString();
                this.hy_djrbmid.Text = this.Session["hydeptid"].ToString();
                this.hy_djrbmname.Text = this.Session["hydeptname"].ToString();
                this.hy_djsj.Text = System.DateTime.Now.ToString();

                if (this.txtifhaveflow.Value == "是")
                {
                    HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                    DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                    if (dt_tableconfig.Rows.Count > 0)
                    {
                        if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是")
                        {
                            //根据模块ID得到流程信息
                            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
                            DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text);
                            if (dt.Rows.Count > 0)
                            {
                                //判断当前用户是否有登记权限
                                //得到第一环节ID
                                string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString());
                                if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString()))
                                {
                                    this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                                    this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                                    this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString();
                                    this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString();
                                    this.hy_curclrid.Text = this.Session["hyuid"].ToString();
                                    this.hy_curclrname.Text = this.Session["hyuname"].ToString();
                                    this.lblcurtachenameshow.Text = "当前环节:" + dt.Rows[0]["hy_nexttachename"].ToString();
                                    this.txtSystemClRight.Value = "1";

                                    //-------条件流程start-------
                                    HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
                                    DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid);
                                    if (dt_firsttache.Rows.Count > 0)
                                    {
                                        if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是")
                                            ConditionFlow(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid);
                                    }
                                    //-------条件流程end-------
                                }
                                else
                                {
                                    if (this.txtifpop.Value == "")
                                    {
                                        Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>");
                                        this.td_submit.Visible = false;
                                        this.td_nextstep.Visible = false;
                                        return;
                                    }
                                    else
                                    {
                                        Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>");
                                        return;
                                    }
                                }
                            }
                            dt.Clear();
                            this.td_nextstep.Visible = true; //提交
                        }
                    }
                    //加载页面
                    GetMainTableHtml("0", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);
                    this.td_submit.Visible = true; //保存
                }
                else
                {
                    //this.lblcurtachenameshow.Text = this.lbltablename.Text;
                    //如果非流程(授权用户可新建信息、可删除所有信息)
                    if (this.txttablerole.Value == "0")
                    {
                        if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            this.txtSystemClRight.Value = "1";
                    }
                    //如果非流程(每个人管理自己的信息)
                    if (this.txttablerole.Value == "1")
                    {
                        this.txtSystemClRight.Value = "1";
                    }
                    //如果非流程(每个人管理自己的信息、授权用户可管理所有信息)
                    if (this.txttablerole.Value == "2")
                    {
                        this.txtSystemClRight.Value = "1";
                    }
                    //如果非流程(授权用户可新建、只能删自己新建的信息)
                    if (this.txttablerole.Value == "3")
                    {
                        if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            this.txtSystemClRight.Value = "1";
                    }

                    if (this.txtSystemClRight.Value == "1")
                    {
                        this.td_submit.Visible = true; //保存
                    }
                    else
                    {
                        this.td_submit.Visible = false; //保存
                    }
                    //加载页面
                    GetMainTableHtml("0", this.txtSystemClRight.Value, "0", "");
                }
                hywebopen_newdoc();     //新文档OPEN时的特殊处理
            }
            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                this.td_browseflow.Visible = true;  //查看流程

                if (this.Request.QueryString["docid"] != null)
                {
                    this.txtdocid.Value = this.Request.QueryString["docid"].ToString();
                    string sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "' ";

                    DataTable dt = Hyoa_global.GetDataTable(sql);
                    if (dt.Rows.Count > 0)
                    {
                        this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString();
                        this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString();
                        this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString();
                        this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString();
                        this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString();
                        this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString();
                        this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString();
                        this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString();
                        this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString();
                        this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString();
                        this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString();
                        this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString();
                        this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString();
                        this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString();
                        this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString();
                        this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString();
                        this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString();
                        this.hy_readdatelist.Text = dt.Rows[0]["hy_readdatelist"].ToString();
                        this.hy_motherid.Text = dt.Rows[0]["hy_motherid"].ToString();
                        this.hy_ifconfirm.Text = dt.Rows[0]["hy_ifconfirm"].ToString();
                        UpdateReadFlag();  //打开时添加阅读情况
                    }
                    //dt.Clear();
                    //流程文档
                    if (this.txtifhaveflow.Value == "是")
                    {
                        this.lblcurtachenameshow.Text = "当前环节:" + dt.Rows[0]["hy_curtachename"].ToString();
                        //流程已结束
                        if (this.hy_curtacheid.Text == "**")
                        {
                            this.lblcurtachenameshow.Text = "当前环节:" + "流程已结束";

                            //20111216 add start
                            if (this.hy_mudelid.Text == "Mudelfwgl" || this.hy_mudelid.Text == "Mudelswgl")
                            {
                                //有发布权限
                                if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                                    this.td_fabu.Visible = true;  //收发文模块流程结束后显示发布按钮
                            }
                            //20111216 add end

                            //判断是否为传阅人
                            HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                            dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                            if (dt.Rows.Count > 0)
                            {
                                this.txtSystemClRight.Value = "0";
                                this.txtSystemYdRight.Value = "1";
                            }
                            //判断是否历史处理人
                            //判断是否是历史处理人员
                            if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                            {
                                this.txtifhistoryclr.Value = "1";
                                this.txtSystemClRight.Value = "0";
                                this.txtSystemYdRight.Value = "1";
                            }
                        }
                        else
                        {
                            //////////////流程未结束///////////////////////
                            //判断是否为当前处理人
                            if (this.hy_curclrid.Text.IndexOf(this.Session["hyuid"].ToString()) >= 0)
                            {
                                this.txtSystemClRight.Value = "1";
                                this.td_submit.Visible = true; //保存
                                this.td_nextstep.Visible = true; //提交
                                this.td_returnsumbit.Visible = true; //退回

                                //-------条件流程start-------
                                HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
                                DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                                if (dt_firsttache.Rows.Count > 0)
                                {
                                    if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是")
                                        ConditionFlow(this.hy_flowid.Text, this.hy_curtacheid.Text);
                                }
                                //-------条件流程end-------
                            }
                            else
                            {
                                //判断是否为传阅人
                                HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                                dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString());
                                if (dt.Rows.Count > 0)
                                {
                                    this.txtSystemYdRight.Value = "1";
                                }
                                //判断是否是上一环节处理人
                                if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                {
                                    this.txtiflastclr.Value = "1";
                                    this.txtSystemYdRight.Value = "1";
                                    this.td_withdraw.Visible = true; //收回
                                    this.td_press.Visible = true; //催办
                                }
                                else
                                {
                                    //判断是否是历史处理人员
                                    if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString()))
                                    {
                                        this.txtifhistoryclr.Value = "1";
                                        this.txtSystemYdRight.Value = "1";
                                        this.td_press.Visible = true; //催办
                                    }
                                }
                            }
                            //判断是否为最后一个环节
                            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                            DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            if (dtflowwork.Rows.Count > 0)
                            {
                                if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                    this.txtiflasttache.Value = "1";
                            }
                            dtflowwork.Clear();
                            //////////////流程未结束///////////////////////
                        }

                        //如果表单是流程后公开显示,则置为阅读权限
                        if (this.hy_curtacheid.Text == "**")
                        {
                            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                            DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.hy_tableid.Text);
                            if (dt_tableconfig.Rows.Count > 0)
                            {
                                if (dt_tableconfig.Rows[0]["hy_ispuballByflowYB"].ToString() == "是")
                                {
                                    this.txtSystemYdRight.Value = "1";
                                }
                            }
                        }
                        //没有操作权限的用户,如果是全权用户,则置为阅读权限    ADD BY XF 2011-11-17
                        if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                        {
                            //得到当前模块对应的全权用户组
                            HyoaClass.Hyoa_mudel Hyoa_mudel_forqqyh = new HyoaClass.Hyoa_mudel();
                            DataTable dt_mudel_forqqyh = Hyoa_mudel_forqqyh.Getmudel(this.hy_mudelid.Text);
                            if (dt_mudel_forqqyh.Rows.Count > 0)
                            {
                                if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != null)
                                {
                                    if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != "")
                                    {
                                        string ls_role_forqqyh = dt_mudel_forqqyh.Rows[0]["hy_qqroleid"].ToString();
                                        HyoaClass.Hyoa_global Hyoa_global_forqqyh = new HyoaClass.Hyoa_global();
                                        if (Hyoa_global_forqqyh.isHaveRole(ls_role_forqqyh, this.Session["hyuid"].ToString()))
                                        {
                                            this.txtSystemYdRight.Value = "1";  //阅读权限
                                        }
                                    }
                                }
                            }
                        }

                        //指定的特殊模块,流转过程中,所有人员可以浏览该文档
                        hySetYdRight_TS();

                        //既没有处理权限,又没有阅读权限的情况下
                        if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0")
                        {
                            if (this.txtifpop.Value == "")
                            {
                                Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>");
                                this.td_submit.Visible = false;
                                this.td_nextstep.Visible = false;
                                return;
                            }
                            else
                            {
                                Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>");
                                return;
                            }
                        }

                        //加载页面
                        GetMainTableHtml("1", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text);
                    }
                    else
                    {
                        //this.lblcurtachenameshow.Text = this.lbltablename.Text;

                        //非流程表单
                        this.td_nextstep.Visible = false;
                        this.td_withdraw.Visible = false;
                        this.td_returnsumbit.Visible = false;
                        this.td_press.Visible = false;
                        this.td_browseflow.Visible = false;

                        ////////////判断当前表单是否为只显示个人
                        //////////HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
                        //////////DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                        //////////if (dt_tableconfig.Rows.Count > 0)
                        //////////{
                        //////////    //不是流程文档,不显示所有记录
                        //////////    if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "否" && dt_tableconfig.Rows[0]["hy_ifdisplayall"].ToString() == "否")
                        //////////    {
                        //////////        //判断是否为当前文档登记人
                        //////////        if(this.hy_djrid.Text==Session["hyuid"].ToString())
                        //////////            this.txtSystemClRight.Value = "1";
                        //////////    }
                        //////////    else
                        //////////    {
                        //////////        if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                        //////////            this.txtSystemClRight.Value = "1";
                        //////////    }
                        //////////}

                        //如果非流程(授权用户统一管理)
                        if (this.txttablerole.Value == "0")
                        {
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                                this.txtSystemClRight.Value = "1";
                        }
                        //如果非流程(每个人管理自己的信息)
                        if (this.txttablerole.Value == "1")
                        {
                            //判断是否为当前文档登记人
                            if (this.hy_djrid.Text == Session["hyuid"].ToString())
                                this.txtSystemClRight.Value = "1";
                        }
                        //如果非流程(每个人操作自己的信息、授权用户可管理所有信息)
                        if (this.txttablerole.Value == "2")
                        {
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            {
                                this.txtSystemClRight.Value = "1";
                            }
                            else
                            {
                                if (this.hy_djrid.Text == Session["hyuid"].ToString())
                                    this.txtSystemClRight.Value = "1";
                            }
                        }
                        //如果非流程(授权用户可新建、只能删自己新建的信息)
                        if (this.txttablerole.Value == "3")
                        {
                            if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1")
                            {
                                if (this.hy_djrid.Text == Session["hyuid"].ToString())
                                    this.txtSystemClRight.Value = "1";
                            }
                        }

                        if (this.txtSystemClRight.Value == "1")
                        {
                            this.td_submit.Visible = true; //保存
                        }
                        else
                        {
                            this.td_submit.Visible = false; //保存
                        }

                        //加载主表单页面
                        GetMainTableHtml("1", this.txtSystemClRight.Value, "0", "");
                    }

                }
                hywebopen_olddoc(); //旧文档OPEN的特殊处理
            }
        }
    }
Exemplo n.º 10
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>");
            }
        }
    }
Exemplo n.º 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 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>");
        //}
    }