?? addmodel_1.aspx.cs
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using com.unicafe.ui;
using com.unicafe.common;
using com.unicafe.security;
using com.ascs.plp.common;
using com.ascs.plp.cg;
using com.ascs.plp.publics;
namespace com.ascs.plp.publics
{
/// <summary>
/// AddModel_1 的摘要說明。
/// </summary>
public class AddModel_1 : com.unicafe.ui.UnicafePage
{
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此處放置用戶代碼以初始化頁面
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:該調用是 ASP.NET Web 窗體設計器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.ID = "AddModel_1";
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
/// *******************************************************************************
/// BEIGIN
/// <summary>
/// 將新增的內容提交數據庫
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// *******************************************************************************
private void Button1_Click(object sender, System.EventArgs e)
{
//生成返回的URL
string ReturnURL = CommonService.CreatReturnURL(this);
this.Response.Write("<script language=javascript>alert('" + ReturnURL + "');</script>");
//對表對象進行賦值
//代碼略
//調用新增方法向數據庫中增加記錄
//bool Flag = Add***(***);
bool Flag = true; //使用時用上一行語句代替
//執行完畢,提示后返回
if(Flag == true)
{
//使用時將下面代碼中的"MainModel_1.aspx"改到特定頁面的打開頁面的URL
Response.Write("<script language=javascript>alert('本記錄已經成功添加!');window.opener.location='" + ReturnURL + "';window.close();</script>");
}
else
{
//使用時將下面代碼中的"MainModel_1.aspx"改到特定頁面的打開頁面的URL
Response.Write("<script language=javascript>alert('本記錄未能成功添加!');window.opener.location='../Publics/Error.aspx?errmsg=該項未能成功修改。';window.close();</script>");
}
}
/// **************************************************************************
/// END
/// **************************************************************************
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -