12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class UpdateData : System.Web.UI.Page
- {
- LYS.UserData1 mydata = new LYS.UserData1();
- protected void Page_Load(object sender, EventArgs e)
- {
- Session["ModifySQL"] = "Select * from TKJL";
- string myURL = mydata.GetAddressUrl();
- if (myURL.LastIndexOf("KeyF")<0)
- {
- Response.Write("<script>alert('错误!参数不正确!不能正常显示')</script>");
- Response.End();
- }
-
- string sql= Session["ModifySQL"] + " where ID= " + Request.QueryString["KeyF"];
- mydata.BuildModifyForm(Panel1, sql , 8);
- }
-
- protected void ModifyData_Click(object sender, EventArgs e)
- {
- try
- {
- string sql = Session["ModifySQL"] + " where ID= " + Request.QueryString["KeyF"];
- mydata.ModifyToDB(sql, Session["ModifyTableName"].ToString());
- Response.Write("<script>alert('数据修改成功!')</script>");
- }
- catch (Exception ex)
- { Response.Write("<script>alert('出现无法预料的错误!可能数据类型不一致或者有些数据输入不完整(日期数据不能为空)!"+ex.Message+"')</script>"); }
- finally
- { }
- }
- }
-
|