示例#1
0
 protected void btn_back_Click(object sender, EventArgs e)
 {
     string sqlUpdate = "";
     HyoaClass.Hyoa_global hyoaGlobal = new Hyoa_global();
     string[] arryDocid = this.txtuids.Value.Split(',');
     string[] arryHtmlId = { "Tablesyyhfwxy_new", "Tableszdsywfwht_new", "Tablejwdscsxy_new", "Tablejwdsjm", "Tablesjcsfwht_new", "Tablekdjrht_new", "Tablegcsght", "Tablesjgdcsfwht_new", "Tablesjtxyyhzxy_new", "Tablesyyhfwxy", "Tablejdhazfwht", "TableVODfwxy", "Tableffpdfwht", "TableDVBazfwdght", "Tablejwdsjsxy", "Tablejwdscsxy", "Tablekdjrht", "Tablesjcsfwht", "Tablesjgdcsfwht", "Tablesjtxyyhzxy", "Tablezdyht", "Tableqtht", "Tablegxhzhht" };
     if (this.st_bdmc.Value != "")
     {
         for (int i = 0; i < arryDocid.Length; i++)
         {
             sqlUpdate += " update hyc_" + this.st_bdmc.Value + " set hy_iftx='' where docid ='" + arryDocid[i] + "' ";
             hyoaGlobal.ExcuteSQL(sqlUpdate);
         }
     }
     else
     {
         for (int j = 0; j < arryHtmlId.Length; j++)
         {
             for (int i = 0; i < arryDocid.Length; i++)
             {
                 sqlUpdate += " update hyc_" + arryHtmlId[j] + " ";
                 sqlUpdate += "set hy_iftx='' where docid ='" + arryDocid[i] + "' ";
                 hyoaGlobal.ExcuteSQL(sqlUpdate);
             }
         }
     }
     DataPlay();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     base.Response.Write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
     base.Response.Write("<html>");
     base.Response.Write("<head>");
     base.Response.Write("<style type=\"text/css\">");
     base.Response.Write("body { font-size:12px; line-height:22px; } a {color: #385ea2; text-decoration: none;} a:hover { text-decoration: underline; }");
     base.Response.Write("</style>");
     base.Response.Write("<script type=\"text/javascript\">");
     base.Response.Write("function js_hy_checked()");
     base.Response.Write("{");
     base.Response.Write("var tempstr=\"\";");
     base.Response.Write("var lisum=0;");
     base.Response.Write("for (var x=0; x<document.getElementsByName('hy_checkbox').length;x++)");
     base.Response.Write("{");
     base.Response.Write("if (document.getElementsByName('hy_checkbox')[x].checked)");
     base.Response.Write("{");
     base.Response.Write("if (tempstr==\"\"){tempstr=document.getElementsByName('hy_checkbox')[x].value;}");
     base.Response.Write("else{");
     base.Response.Write("tempstr+=\",\"+document.getElementsByName('hy_checkbox')[x].value;");
     base.Response.Write("}");
     base.Response.Write("lisum++;");
     base.Response.Write("}");
     base.Response.Write("}");
     base.Response.Write("if(lisum>parseInt(document.getElementById('hy_checklen').value))");
     base.Response.Write("{");
     base.Response.Write("alert('你的选项不能超过'+document.getElementById('hy_checklen').value+'项');return false;");
     base.Response.Write("}");
     base.Response.Write("var lsfilename=document.getElementById('hy_field').value;");
     base.Response.Write("window.parent.document.getElementById(lsfilename).value=tempstr");
     base.Response.Write("}");
     base.Response.Write("function js_hy_redio()");
     base.Response.Write("{");
     base.Response.Write("var tempstr=\"\";");
     base.Response.Write("for (var x=0; x<document.getElementsByName('hy_redio').length;x++)");
     base.Response.Write("{");
     base.Response.Write("if (document.getElementsByName('hy_redio')[x].checked)");
     base.Response.Write("if (tempstr==\"\"){tempstr=document.getElementsByName('hy_redio')[x].value;}");
     base.Response.Write("else{");
     base.Response.Write("tempstr+=\",\"+document.getElementsByName('hy_redio')[x].value;");
     base.Response.Write("}");
     base.Response.Write("}");
     base.Response.Write("var lsfilename=document.getElementById('hy_field').value;");
     base.Response.Write("window.parent.document.getElementById(lsfilename).value=tempstr");
     base.Response.Write("}");
     base.Response.Write("</script>");
     base.Response.Write("</head>");
     base.Response.Write("<body text=\"#000000\" bgcolor=\"#FFFFFF\" topmargin=\"0\" leftmargin=\"0\">");
     base.Response.Write("<form id=\"fm13\">");
     string a = "";
     string text = "";
     string a2 = "";
     string str = "";
     string str2 = "0";
     string text2 = "";
     if (base.Request.QueryString["op"] != null)
     {
         a = base.Request.QueryString["op"].ToString();
     }
     if (base.Request.QueryString["key"] != null)
     {
         text = base.Request.QueryString["key"].ToString();
     }
     if (base.Request.QueryString["type"] != null)
     {
         a2 = base.Request.QueryString["type"].ToString();
     }
     if (base.Request.QueryString["field"] != null)
     {
         str = base.Request.QueryString["field"].ToString();
     }
     if (base.Request.QueryString["checklen"] != null)
     {
         str2 = base.Request.QueryString["checklen"].ToString();
     }
     if (base.Request.QueryString["field_bz"] != null)
     {
         text2 = base.Request.QueryString["field_bz"].ToString();
     }
     if (a == "sql")
     {
         Hyoa_global hyoa_global = new Hyoa_global();
         DataTable dataTable = hyoa_global.GetDataTable(text);
         if (dataTable.Rows.Count > 0)
         {
             for (int i = 0; i < dataTable.Rows.Count; i++)
             {
                 string text3 = dataTable.Rows[i][0].ToString();
                 if (a2 == "rediotype")
                 {
                     base.Response.Write(string.Concat(new object[]
                     {
                         "&nbsp;<input onclick=\"js_hy_redio()\" type=\"radio\" id=\"hy_redio_",
                         i,
                         "\" name=\"hy_redio\" value=\"",
                         text3,
                         "\" /><label for=\"hy_redio_",
                         i,
                         "\">",
                         text3,
                         "&nbsp;</label><br/>"
                     }));
                 }
                 else
                 {
                     if (a2 == "checkedtype")
                     {
                         base.Response.Write(string.Concat(new object[]
                         {
                             "&nbsp;<input onclick=\"js_hy_checked()\"  type=\"checkbox\" id=\"hy_checkbox_",
                             i,
                             "\" name=\"hy_checkbox\" value=\"",
                             text3,
                             "\" /><label for=\"hy_checkbox_",
                             i,
                             "\">",
                             text3,
                             "&nbsp;</label><br/>"
                         }));
                     }
                 }
             }
         }
     }
     else
     {
         if (a == "sgpz")
         {
             string[] array = text.Split(new char[]
             {
                 '|'
             });
             for (int j = 0; j < array.Length; j++)
             {
                 string text4 = array[j];
                 if (a2 == "rediotype")
                 {
                     base.Response.Write(string.Concat(new object[]
                     {
                         "&nbsp;<input onclick=\"js_hy_redio()\" type=\"radio\" id=\"hy_redio_",
                         j,
                         "\" name=\"hy_redio\" value=\"",
                         text4,
                         "\" /><label for=\"hy_redio_",
                         j,
                         "\">",
                         text4,
                         "&nbsp;</label><br/>"
                     }));
                 }
                 else
                 {
                     if (a2 == "checkedtype")
                     {
                         base.Response.Write(string.Concat(new object[]
                         {
                             "&nbsp;<input onclick=\"js_hy_checked()\"  type=\"checkbox\" id=\"hy_checkbox_",
                             j,
                             "\" name=\"hy_checkbox\" value=\"",
                             text4,
                             "\" /><label for=\"hy_checkbox_",
                             j,
                             "\">",
                             text4,
                             "&nbsp;</label><br/>"
                         }));
                     }
                 }
             }
         }
         else
         {
             if (a == "search")
             {
                 Hyoa_global hyoa_global2 = new Hyoa_global();
                 string sql = text2 + " '%" + text + "%'";
                 DataTable dataTable2 = hyoa_global2.GetDataTable(sql);
                 if (dataTable2.Rows.Count > 0)
                 {
                     for (int k = 0; k < dataTable2.Rows.Count; k++)
                     {
                         string text5 = dataTable2.Rows[k][0].ToString();
                         if (a2 == "rediotype")
                         {
                             base.Response.Write(string.Concat(new object[]
                             {
                                 "&nbsp;<input onclick=\"js_hy_redio()\" type=\"radio\" id=\"hy_redio_",
                                 k,
                                 "\" name=\"hy_redio\" value=\"",
                                 text5,
                                 "\" /><label for=\"hy_redio_",
                                 k,
                                 "\">",
                                 text5,
                                 "&nbsp;</label><br/>"
                             }));
                         }
                         else
                         {
                             if (a2 == "checkedtype")
                             {
                                 base.Response.Write(string.Concat(new object[]
                                 {
                                     "&nbsp;<input onclick=\"js_hy_checked()\"  type=\"checkbox\" id=\"hy_checkbox_",
                                     k,
                                     "\" name=\"hy_checkbox\" value=\"",
                                     text5,
                                     "\" /><label for=\"hy_checkbox_",
                                     k,
                                     "\">",
                                     text5,
                                     "&nbsp;</label><br/>"
                                 }));
                             }
                         }
                     }
                 }
             }
         }
     }
     base.Response.Write("<div style=\"display:none\">");
     base.Response.Write("<input type=\"text\" id=\"hy_field\" name=\"hy_field\" value=\"" + str + "\" />");
     base.Response.Write("<input type=\"text\" id=\"hy_field_bz\" name=\"hy_field_bz\" value=\"" + text2 + "\" />");
     base.Response.Write("<input type=\"text\" id=\"hy_checklen\" name=\"hy_checklen\" value=\"" + str2 + "\" />");
     base.Response.Write("</div>");
     base.Response.Write("</form>");
     base.Response.Write("</body>");
     base.Response.Write("</html>");
 }
示例#3
0
    //需要导出的内容
    private string getExcelContent()
    {
        StringBuilder sb = new StringBuilder();
        sb.Append("<table width=\"99%\" height=\"35\" border=\"2\" cellpadding=\"0\" cellspacing=\"2\">");
        string[] lvcolname = new string[] { };
        string[] lvcolnameid = new string[] { };
        Hyoa_global Hyoa_global = new Hyoa_global();
        //得到所有数据
        DataTable dt = Hyoa_global.GetDataTable(this.strSQL.Value);
        DataTable dtgetsqlfield = new DataTable();
        Hyoa_flowfield Hyoa_flowfield = new Hyoa_flowfield();
        Hyoa_listconfig Hyoa_listconfig = new Hyoa_listconfig();
        DataTable dtlist = Hyoa_listconfig.Getlistconfig(this.txtlistid.Value);
        if (dtlist.Rows.Count > 0)
        {
            lvcolnameid = dtlist.Rows[0]["hy_columnshowid"].ToString().Split(',');
            lvcolname = dtlist.Rows[0]["hy_columnshow"].ToString().Split(',');
        }
        for (int i = 0; i < dt.Rows.Count; i++)
        {

            sb.Append("<tr>");
            for (int m = 0; m < lvcolnameid.Count(); m++)
            {
                dtgetsqlfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.txtmudelid.Value, lvcolnameid[m], this.txttableid.Value);
                if (dtgetsqlfield.Rows.Count > 0)
                {
                    //根据字段英文名,得到数据库中对应的字段
                    string lsgetsqlfield = "hyc_" + dtgetsqlfield.Rows[0]["hy_fieldid"].ToString();
                    if (i % System.Int32.Parse(PageSize.Text) == 0)
                    {
                        sb.Append("<td ><p align=\"center\">" + lvcolname[m] + "</p></td>");
                    }
                    //根据数据库中对应的字段,得到输出字段的值start (日期型根据格式进行了转换)
                    string lsgetputfiled = "";
                    if (dtgetsqlfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                    {
                        if (dt.Rows[i][lsgetsqlfield].ToString() != "")
                        {
                            lsgetputfiled = System.DateTime.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToShortDateString();
                        }
                    }
                    lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString();
                    if (lsgetputfiled == "")
                    {
                        lsgetputfiled = "&nbsp;";
                    }
                    if (i % System.Int32.Parse(PageSize.Text) != 0)
                    {
                        sb.Append("<td align=\"center\" >" + lsgetputfiled.ToString() + "</td>");
                    }
                }
            }

            sb.Append("</tr>");

        }
        sb.Append("</table>");
        Response.Write(sb.ToString());
        return sb.ToString();
    }
示例#4
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
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("login.aspx");

        if (this.Request.QueryString["mid"] != null)
        {
            //得到模块ID
            this.txtmudelid.Value = this.Request.QueryString["mid"].ToString();
        }
        else
        {
            this.Response.Write("<script>alert('模块ID没有传入,请联系管理员!');</script>");
            return;
        }
        if (this.Request.QueryString["tableid"] != null)
        {
            //表的ID
            this.txttableid.Value = this.Request.QueryString["tableid"].ToString();
            //得到表名
            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
            DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.txttableid.Value);
            if (dt_tableconfig.Rows.Count > 0)
                this.lblcurtachenameshow.Text = dt_tableconfig.Rows[0]["hy_name"].ToString();
        }
        else
        {
            this.Response.Write("<script>alert('表单ID没有传入,请联系管理员!');</script>");
            return;
        }
        if (this.Request.QueryString["listid"] != null)
        {
            //得到列表ID
            if (this.Request.QueryString["listid"].ToString() != "")
            {
                this.txtlistid.Value = this.Request.QueryString["listid"].ToString();
            }
        }
        else
        {
            this.Response.Write("<script>alert('列表ID没有传入,请联系管理员!');</script>");
            return;
        }
        //判断是否需要查询
        HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
        DataTable dt_listconfig = Hyoa_listconfig.Getlistconfig(this.txtlistid.Value);
        if (dt_listconfig.Rows.Count > 0)
        {
            if (dt_listconfig.Rows[0]["hy_ifsearch"].ToString() == "是")
            {
                GetSearchTableHtml();//查询表格动态生成
            }
            else
            {
                trsearch.Visible = false;
            }
        }
        if (!IsPostBack)
        {
            DataPlay(1);   //列表区动态生成
            PageListItem();
            EnabledWhatButton();
        }
        //Rolefplcgk
        HyoaClass.Hyoa_global Hyoa_global = new Hyoa_global();
        if (Hyoa_global.isHaveRole("Rolefplcgk", this.Session["hyuid"].ToString()) && this.txttableid.Value == "Tablefpbd")
        {
            this.Td5.Visible = true;
        }
    }