?? prompt.cs
字號(hào):
using System;
using com.ascs.plp.publics;
namespace com.ascs.plp.publics
{
/// <summary>
/// Prompt 的摘要說明。
/// </summary>
public class Prompt
{
//信息提示類型,取值范圍為1、2、3、4
//取值為1時(shí),表示執(zhí)行成功,而且不需要提出提示
//取值為2時(shí),表示執(zhí)行成功,而且需要給出提示
//取值為3時(shí),表示不滿足繼續(xù)執(zhí)行的條件,不再繼續(xù)執(zhí)行,給出警告提示
//取值為4時(shí),表示執(zhí)行失敗,給出錯(cuò)誤提示,在交付用戶之前應(yīng)當(dāng)把此種情況減少到零
public int Flag;
//信息提示內(nèi)容
public string Info;
/// **************************************************************************
/// BEIGIN
/// <summary>
/// Prompt類構(gòu)造方法
/// </summary>
/// **************************************************************************
public Prompt()
{
Flag = 1;
Info = "";
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// Prompt類構(gòu)造方法
/// </summary>
/// **************************************************************************
public Prompt(int flag, string info)
{
Flag = flag;
Info = info;
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// Prompt類構(gòu)造方法
/// </summary>
/// <param name="thePage"></param>
/// <param name="flag"></param>
/// <param name="info"></param>
/// **************************************************************************
public Prompt(System.Web.UI.Page thePage, int flag, string info)
{
Flag = flag;
Info = info;
ShowPrompt(thePage);
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 處理Prompt對(duì)象,彈出提示窗口
/// </summary>
/// <param name="thePage">調(diào)用此方法的頁面對(duì)象</param>
/// **************************************************************************
public void ShowPrompt(System.Web.UI.Page thePage)
{
string ApplicationPath = thePage.Request.ApplicationPath;
if (Flag != 1)
{
if(ApplicationPath == "/")
{
ApplicationPath = "";
}
string Path = ApplicationPath + "/Publics/Prompt.aspx?Flag=" + Flag.ToString() + "&Info=" + Info;
thePage.Response.Write("<script language=javascript>window.open('" + Path + "','','width=450px,height=200px,resizable=no,left=' + (screen.availWidth-620)/2 + ',top=' + (screen.availHeight-470)/2 ); </script>");
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 彈出信息提示窗口
/// </summary>
/// <param name="thePage">調(diào)用此方法的Web頁面對(duì)象</param>
/// <param name="info">提示信息內(nèi)容</param>
/// **************************************************************************
public static void PromptMessage(System.Web.UI.Page thePage, string info)
{
Prompt prt = new Prompt(thePage, 2, info);
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 彈出警告提示窗口
/// </summary>
/// <param name="thePage">調(diào)用此方法的Web頁面對(duì)象</param>
/// <param name="info">警告信息內(nèi)容</param>
/// **************************************************************************
public static void PromptAlert(System.Web.UI.Page thePage, string info)
{
Prompt prt = new Prompt(thePage, 3, info);
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 彈出錯(cuò)誤提示窗口
/// </summary>
/// <param name="thePage">調(diào)用此方法的Web頁面對(duì)象</param>
/// <param name="info">錯(cuò)誤信息內(nèi)容</param>
/// **************************************************************************
public static void PromptError(System.Web.UI.Page thePage, string info)
{
Prompt prt = new Prompt(thePage, 4, info);
}
/// **************************************************************************
/// END
/// **************************************************************************
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -