62,046
社区成员
发帖
与我相关
我的任务
分享
protected void btn_BaoCun_Click(object sender, EventArgs e)
{
//接受数据
int P_Id = int.Parse(Request.Form["F_Id"]);
string P_ProvinceId = this.regionDaiMa.Text.Trim();
string P_ProvinceName = this.name.Text.Trim();
string P_Simplified = this.Simplified.Text.Trim();
string P_Alias = this.alias.Text.Trim();
string P_Codefor = this.codefor.Text.Trim();
string P_Zipcode = this.zipcode.Text.Trim();
string str = TruckRules.TruckChinaProvinceRules.UpdateProvince(P_ProvinceId, P_ProvinceName, P_Simplified, P_Alias, P_Codefor, P_Zipcode, P_Id);
if (str != null)
{
Response.Write("<script language=javascript>alert('修改省份成功!')</script>");
}
else
{
Response.Write("<script language=javascript>alert('修改省份失败!')</script>");
}
}
ClientScript.RegisterStartupScript(GetType(), "success", "alert('修改省份成功!');location.href=location.href;", true);
ClientScript.RegisterStartupScript(GetType(), "success", "alert('修改省份成功!');localtion.href=localtion.href;", true);
/// <summary>
/// 弹出对话框并且重定向至其他页面
/// </summary>
/// <param name="msg">消息内容</param>
/// <param name="url">页面地址</param>
public static void AlertMsg(string msg, string url)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write(string.Concat("<script>alert('", msg, "');self.window.location.href='", url, "';</script>"));
HttpContext.Current.Response.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();
HttpContext.Current.Response.End();
}