Ejemplo n.º 1
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("login.aspx");

        string ls_tip = "保存成功!";
        if (this.Session["hyuid"].ToString() == "025" && this.hy_tableid.Text == "Tablejemx")
        {
            string sqlSelect = " select * from hyc_Tablefpbd where docid ='" + this.txtMotherid.Value + "' ";
            HyoaClass.Hyoa_global hyoaGlobal = new Hyoa_global();
            DataTable dt = hyoaGlobal.GetDataTable(sqlSelect);
            if (dt.Rows.Count > 0)
            {
                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();
            }
        }

        #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);

            //调用添加客户名称的方法
            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")
            {
                Khdaxx();   //添加客户信息内容
                Htblzt();   //添加办理状态表
            }
            //add by zxx 20150305
            if (this.hy_mudelid.Text == "Mudelxjsq" && this.hy_tableid.Text == "Tablexjsq"
             || this.hy_mudelid.Text == "Mudelshd" && this.hy_tableid.Text == "Tableshd" || this.hy_mudelid.Text == "Mudelszds" && this.hy_tableid.Text == "Tableszds")
            {
                Htblzt();   //添加办理状态表
            }
            //add by ccg 20150617
            if (this.hy_mudelid.Text == "Mudelsyyhfwxy_new" && this.hy_tableid.Text == "Tablesyyhfwxy_new" || this.hy_mudelid.Text == "Mudelszdsywfwht_new" && this.hy_tableid.Text == "Tableszdsywfwht_new"
             || this.hy_mudelid.Text == "Mudeljwdscsxy_new" && this.hy_tableid.Text == "Tablejwdscsxy_new" || this.hy_mudelid.Text == "Mudeljwdsjm" && this.hy_tableid.Text == "Tablejwdsjm"
             || this.hy_mudelid.Text == "Mudelsjcsfwht_new" && this.hy_tableid.Text == "Tablesjcsfwht_new" || this.hy_mudelid.Text == "Mudelkdjrht_new" && this.hy_tableid.Text == "Tablekdjrht_new"
             || this.hy_mudelid.Text == "Mudelsjgdcsfwht_new" && this.hy_tableid.Text == "Tablesjgdcsfwht_new" || this.hy_mudelid.Text == "Mudelsjtxyyhzxy_new" && this.hy_tableid.Text == "Tablesjtxyyhzxy_new" || this.hy_mudelid.Text == "Mudelzdyht" && this.hy_tableid.Text == "Tablezdyht"
             || this.hy_mudelid.Text == "Mudelgcsght" && this.hy_tableid.Text == "Tablegcsght"
             || this.hy_mudelid.Text == "Mudelqtht" && this.hy_tableid.Text == "Tableqtht"
             || this.hy_mudelid.Text == "Mudelgxhzhht" && this.hy_tableid.Text == "Tablegxhzhht")
            {
                Htblzt();   //添加办理状态表
            }

        }
        #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.txtwc.Text == "1")
        {
            Htblztwc();  //特殊处理
        }
        #endregion
        #region 确认
        if (this.txtwhichoperation.Value == "111")
        {
            sql += ",hy_ifconfirm='1'";
        }
        #endregion

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

        #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);
        if (this.txtop.Value == "add")
        {
            string slbh_sql = "SELECT TOP 1 * FROM hyc_Tableslbhwh ORDER BY hyc_pxh";
            string update_sql = "";
            DataTable dt_slbh = Hyoa_global.GetDataTable(slbh_sql);
            if (dt_slbh.Rows.Count > 0)
            {
                int bh = Convert.ToInt32(dt_slbh.Rows[0]["hyc_slbh"].ToString());
                bh = bh + 1;
                string docid = dt_slbh.Rows[0]["DOCID"].ToString();
                update_sql = "UPDATE hyc_Tableslbhwh SET hyc_slbh = '" + bh + "' WHERE DOCID = '" + docid + "'";
            }
            Hyoa_global.ExcuteSQL(update_sql);
        }
        // add by wjs 20141029 end
        if (this.hy_tableid.Text == "Tabletjjzr")
        {
            Zbtjkz();
        }

        #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.txt_nextFlag.Value == "1")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + 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 + "');try{window.opener.location.reload();}catch(err){}self.close();</script>");
            }
        }
        #endregion
    }
Ejemplo n.º 2
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; //新文档时,“已读人员”按钮隐藏

                //文档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();

                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; //保存
                    this.td_continue.Visible = true; //保存并继续新建
                    this.td_xyb.Visible = false;   //下一步

                    if (this.hy_tableid.Text == "Tablekdjrht" || this.hy_tableid.Text == "Tablesyyhfwxy" || this.hy_tableid.Text == "Tablejdhazfwht" || this.hy_tableid.Text == "TableVODfwxy" || this.hy_tableid.Text == "Tableffpdfwht" || this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_tableid.Text == "Tablejwdscsxy" || this.hy_tableid.Text == "Tablekdjrht" || this.hy_tableid.Text == "Tablesjcsfwht" || this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_tableid.Text == "Tablesjtxyyhzxy" || this.hy_tableid.Text == "Tablezdyht" || this.hy_tableid.Text == "Tablegxhzhht" || this.hy_tableid.Text == "Tableqtht" || this.hy_tableid.Text == "Tablexjsq" || this.hy_tableid.Text == "Tableshd" || this.hy_tableid.Text == "Tableszds")
                    {
                        this.td_continue.Visible = false;
                        this.td_xyb.Visible = true;
                    }
                    if (this.hy_tableid.Text == "Tablesyyhfwxy_new" || this.hy_tableid.Text == "Tableszdsywfwht_new" || this.hy_tableid.Text == "Tablejwdscsxy_new" || this.hy_tableid.Text == "Tablejwdsjm" || this.hy_tableid.Text == "Tablesjcsfwht_new" || this.hy_tableid.Text == "Tablekdjrht_new" || this.hy_tableid.Text == "Tablesjgdcsfwht_new" || this.hy_tableid.Text == "Tablesjtxyyhzxy_new" || this.hy_tableid.Text == "Tablegcsght")
                    {
                        this.td_continue.Visible = false;
                        this.td_xyb.Visible = true;
                    }
                    if (this.hy_tableid.Text == "Tablefpbd")
                    {
                        this.btn_consubmit.Value = "付 款";
                        this.td_consubmit.Visible = true;//确认td_qxsubmit
                    }
                }
                else
                {
                    this.td_submit.Visible = false; //保存
                    this.td_xyb.Visible = false;   //下一步
                    this.td_continue.Visible = false; //保存并继续新建
                }
                //加载页面
                GetMainTableHtml("0", this.txtSystemClRight.Value, "0", "");
                hywebopen_newdoc();     //新文档OPEN时的特殊处理
            }
            #endregion

            #region 旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                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();
                        // this.txt_slbh.Value=dt.Rows[0]["hyc_slbh"].ToString();
                        UpdateReadFlag();  //打开时添加阅读情况
                    }
                    dt.Clear();
                    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")
                    {
                        //判断是否为当前文档登记人
                        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; //保存
                        this.td_continue.Visible = false; //保存并继续新建
                        this.td_xyb.Visible = false;   //下一步

                        if (this.hy_tableid.Text == "Tablekdjrht" || this.hy_tableid.Text == "Tablesyyhfwxy" || this.hy_tableid.Text == "Tablejdhazfwht"
                            || this.hy_tableid.Text == "TableVODfwxy" || this.hy_tableid.Text == "Tableffpdfwht" || this.hy_tableid.Text == "TableDVBazfwdght"
                            || this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_tableid.Text == "Tablejwdscsxy" || this.hy_tableid.Text == "Tablekdjrht"
                            || this.hy_tableid.Text == "Tablesjcsfwht" || this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_tableid.Text == "Tablesjtxyyhzxy"
                            || this.hy_tableid.Text == "Tablezdyht" || this.hy_tableid.Text == "Tablegxhzhht" || this.hy_tableid.Text == "Tableqtht"
                            || this.hy_tableid.Text == "Tablexjsq" || this.hy_tableid.Text == "Tableshd" || this.hy_tableid.Text == "Tableszds"
                            //下面新合同  add by ccg 20150617
                            || this.hy_tableid.Text == "Tablesyyhfwxy_new" || this.hy_tableid.Text == "Tableszdsywfwht_new" || this.hy_tableid.Text == "Tablejwdscsxy_new"
                            || this.hy_tableid.Text == "Tablejwdsjm" || this.hy_tableid.Text == "Tablesjcsfwht_new" || this.hy_tableid.Text == "Tablekdjrht_new"
                            || this.hy_tableid.Text == "Tablesjgdcsfwht_new" || this.hy_tableid.Text == "Tablesjtxyyhzxy_new" || this.hy_tableid.Text == "Tablezdyht"
                            || this.hy_tableid.Text == "Tablegcsght" || this.hy_tableid.Text == "Tableqtht" || this.hy_tableid.Text == "Tablegxhzhht")
                        {
                            string sql_wc = "";
                            DataTable dtwc;
                            sql_wc = "select * from hyt_blzt where DOCID='" + this.txtdocid.Value + "' and hy_state='未完成'";
                            dtwc = Hyoa_global.GetDataTable(sql_wc);
                            if (dtwc.Rows.Count > 0)
                            {
                                if (dtwc.Rows[0]["hy_state"].ToString() == "未完成")
                                {
                                    this.td_wcan.Visible = true;   //完成
                                }
                            }

                            this.td_continue.Visible = false;
                            this.td_xyb.Visible = true;
                        }
                        if (this.hy_ifconfirm.Text != "1" && this.hy_tableid.Text == "Tablefpbd")
                        {
                            this.btn_consubmit.Value = "付款";
                            this.td_consubmit.Visible = true;   //确认
                        }
                    }
                    else
                    {
                        this.td_submit.Visible = false; //保存
                        //this.td_wcan.Visible = false;   //完成
                        this.td_xyb.Visible = false;   //下一步
                        this.td_continue.Visible = false; //保存并继续新建
                    }
                    //如果是超级管理员把取消按钮显示出来。用于用户确认后还要修改
                    //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
                    //{
                    //    this.td_qxsubmit.Visible = true;    //取消按钮
                    //}

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

                    //----加载评论页面 s add by xf 2011-11-19-----
                    HyoaClass.Hyoa_tableconfig Hyoa_tableconfig_forpinglun = new HyoaClass.Hyoa_tableconfig();
                    DataTable dt_tableconfig_forpinglun = Hyoa_tableconfig_forpinglun.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text);
                    if (dt_tableconfig_forpinglun.Rows.Count > 0)
                    {
                        if (dt_tableconfig_forpinglun.Rows[0]["hy_ifcomment"] != null)
                        {
                            if (dt_tableconfig_forpinglun.Rows[0]["hy_ifcomment"].ToString() == "是")
                            {
                                this.tb_nbsp.Visible = true;
                                this.tb_pltitle.Visible = true;
                                this.tb_plbody.Visible = true;
                                this.td_pinglun.Visible = true;
                                //得到已经评论的内容
                                HyoaClass.Hyoa_pinglun Hyoa_pinglun = new HyoaClass.Hyoa_pinglun();
                                DataTable dt_pinglun = Hyoa_pinglun.GetcommentByfatherid(this.txtdocid.Value);
                                if (dt_pinglun.Rows.Count > 0)
                                {
                                    //输出评论记录
                                    this.lblbody.Text = "";
                                    for (var i = 0; i < dt_pinglun.Rows.Count; i++)
                                    {
                                        this.lblbody.Text += dt_pinglun.Rows[i]["hy_plbody"].ToString() + "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                        this.lblbody.Text += "(评论人:" + dt_pinglun.Rows[i]["hy_plusername"].ToString() + "&nbsp;&nbsp;&nbsp;所在部门:" + dt_pinglun.Rows[i]["hy_pldeptname"].ToString();
                                        this.lblbody.Text += "&nbsp;&nbsp;&nbsp;评论时间:" + dt_pinglun.Rows[i]["hy_pltime"].ToString() + "&nbsp;&nbsp;&nbsp;IP:" + dt_pinglun.Rows[i]["hy_plip"].ToString();
                                        this.lblbody.Text += ")<br><hr height=1 color=#DEEEFE></hr>";
                                    }
                                }
                            }
                        }
                    }
                    //----加载评论页面 e-----
                }
                hywebopen_olddoc(); //旧文档OPEN的特殊处理
            }
            #endregion
        }

        // 部门礼品卡  显示导出按键     小潘   2015-12
        if (this.hy_tableid.Text == "Tablelpksqd")
        {
            //if (this.hy_curtacheid.Text == "tache0001" || this.hy_curtacheid.Text == "**")
            //{
            this.td_dc.Visible = true;
            //}
        }
    }
Ejemplo n.º 3
0
 //评论add by xf 2011-11-19
 protected void Button_PinglunSave_Click(object sender, EventArgs e)
 {
     if (this.txtpinglun.Text.Trim() == "")
     {
         Response.Write("<script>alert('评论内容不能为空!');</script>");
         return;
     }
     else
     {
         //保存评论记录
         HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
         HyoaClass.Hyoa_pinglun Hyoa_pinglun = new HyoaClass.Hyoa_pinglun();
         Hyoa_pinglun.plid = Hyoa_global.GetRandom();
         Hyoa_pinglun.hy_tableid = this.hy_tableid.Text;
         Hyoa_pinglun.hy_fatherid = this.txtdocid.Value;
         Hyoa_pinglun.hy_pluserid = Session["hyuid"].ToString();
         Hyoa_pinglun.hy_plusername = Session["hyuname"].ToString();
         Hyoa_pinglun.hy_pldeptid = Session["hydeptid"].ToString();
         Hyoa_pinglun.hy_pldeptname = Session["hydeptname"].ToString();
         Hyoa_pinglun.hy_pltime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
         this.txtpinglun_hidden.Text = ReplaceString_Tszf(this.txtpinglun_hidden.Text);
         Hyoa_pinglun.hy_plbody = this.txtpinglun_hidden.Text;
         Hyoa_pinglun.hy_plip = HttpContext.Current.Request.UserHostAddress;
         Hyoa_pinglun.hy_plifshow = "";
         Hyoa_pinglun.Insert();
         Response.Write("<script>alert('评论成功!');window.location='" + this.Request.Url.ToString() + "'</script>");    //这个返回路径的页面,点返回按钮会有问题.已办转在办用的返回到了列表
     }
 }