本文整理汇总了C#中System.Web.UI.WebControls.CommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# CommandEventArgs类的具体用法?C# CommandEventArgs怎么用?C# CommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommandEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了CommandEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SaveShareButton_Command
protected void SaveShareButton_Command(Object sender, CommandEventArgs e)
{
SaveButton_Command(sender, e);
var patron = (Patron)Session["Patron"];
Response.Redirect(string.Format("~/Avatar/View.aspx?AvatarId={0}",
patron.AvatarState));
}
开发者ID:haraldnagel,项目名称:greatreadingadventure,代码行数:7,代码来源:MyAvatarControl.ascx.cs
示例2: Page_Command
protected void Page_Command(Object sender, CommandEventArgs e)
{
try
{
if (e.CommandName == "Edit")
{
Response.Redirect("edit.aspx?ID=" + gID.ToString());
}
else if (e.CommandName == "Cancel")
{
Response.Redirect("default.aspx");
}
else if (e.CommandName == "Delete")
{
SqlProcs.spTQLogisticsInvoice_Delete(gID);
Response.Redirect("default.aspx");
}
}
catch (Exception ex)
{
SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex);
ctlDynamicButtons.ErrorText = ex.Message;
}
}
开发者ID:huamouse,项目名称:Taoqi,代码行数:27,代码来源:DetailView.ascx.cs
示例3: Page_Command
protected void Page_Command(object sender, CommandEventArgs e)
{
try
{
switch ( e.CommandName )
{
case "Payments.Create":
Response.Redirect("~/Payments/edit.aspx?PARENT_ID=" + gID.ToString());
break;
case "Payments.Edit":
{
Guid gPAYMENT_ID = Sql.ToGuid(e.CommandArgument);
Response.Redirect("~/Payments/edit.aspx?ID=" + gPAYMENT_ID.ToString());
break;
}
case "Payments.Remove":
{
// 05/26/2007 Paul. Allow an invoice to be removed from a payment.
// The payment is not deleted.
Guid gINVOICE_PAYMENT_ID = Sql.ToGuid(e.CommandArgument);
SqlProcs.spINVOICES_PAYMENTS_Delete(gINVOICE_PAYMENT_ID);
Response.Redirect("~/Invoices/view.aspx?ID=" + gID.ToString());
break;
}
default:
throw(new Exception("Unknown command: " + e.CommandName));
}
}
catch(Exception ex)
{
SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex);
lblError.Text = ex.Message;
}
}
开发者ID:NALSS,项目名称:splendidcrm-99885,代码行数:34,代码来源:Payments.ascx.cs
示例4: Page_Command
protected void Page_Command(Object sender, CommandEventArgs e)
{
if ( e.CommandName == "Save" || e.CommandName == "SaveNew" )
{
if ( Page.IsValid )
{
try
{
SqlProcs.spTAX_RATES_Update(
ref gID
, txtNAME.Text
, lstSTATUS.SelectedValue
, Sql.ToDecimal(txtVALUE.Text)
, Sql.ToInteger(txtLIST_ORDER.Text)
);
Cache.Remove("vwTAXRATES_LISTBOX");
}
catch(Exception ex)
{
SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex.Message);
lblError.Text = ex.Message;
return;
}
if ( e.CommandName == "SaveNew" )
Response.Redirect("edit.aspx");
else
Response.Redirect("default.aspx");
}
}
}
开发者ID:NALSS,项目名称:splendidcrm-99885,代码行数:30,代码来源:EditView.ascx.cs
示例5: DoPrintReady
private void DoPrintReady(object sender, CommandEventArgs e)
{
const string METHOD_NAME = "DoPrintReady";
try {
WSCSecurity auth = Globals.SecurityState;
string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
string fileName = auth.UserID + "_" + ((HarvestReportTemplate)Master).ReportName.Replace(" ", "");
string contractNumber = Common.UILib.GetListText(lstCdsContract, ",");
// Check required fields: contract number
if (String.IsNullOrEmpty(contractNumber)) {
Common.CWarning warn = new Common.CWarning("You must select a Contract.");
throw (warn);
}
string cropYear = ((HarvestReportTemplate)Master).CropYear;
string pdf = WSCReports.rptContractDeliverySummary.ReportPackager(Convert.ToInt32(cropYear), Convert.ToInt32(contractNumber), fileName, logoUrl, pdfTempFolder);
if (pdf.Length > 0) {
// convert file system path to virtual path
pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
}
((HarvestReportTemplate)sender).LocPDF = pdf;
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((HarvestReportTemplate)Page.Master).ShowWarning(ex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:33,代码来源:ContractDeliverySummary.aspx.cs
示例6: lbtnRemoveCommand
protected void lbtnRemoveCommand(object sender, CommandEventArgs e)
{
int UserID = Convert.ToInt32(e.CommandName);
removeClient.DoWork(UserID);
Response.Write("删除成功~");
GetUsers();
}
开发者ID:rdzzg,项目名称:LearnningDemo,代码行数:7,代码来源:SearchAndRemove.aspx.cs
示例7: Button_Command
protected void Button_Command(object sender, CommandEventArgs e)
{
if (IsValid)
{
var objid = TableList.SelectedDataKeys.First();
var objids = TableList.SelectedDataKeys.ToArray();
switch (e.CommandName)
{
case "View":
Response.Redirect(Schema.Default.GetUrl(objid));
break;
//case "Edit":
// break;
case "Peek":
Response.Redirect(Schema.Peek.GetUrl(objid));
break;
case "Export":
Response.Redirect(MyDB.ExportTable.GetUrl(objid));
break;
case "Rename":
Response.Redirect(MyDB.RenameObject.GetUrl(objid));
break;
case "Drop":
Response.Redirect(MyDB.DropObject.GetUrl(objids));
break;
default:
throw new NotImplementedException();
}
}
}
开发者ID:horvatferi,项目名称:graywulf,代码行数:31,代码来源:Tables.aspx.cs
示例8: Page_Command
protected void Page_Command(Object sender, CommandEventArgs e)
{
if ( e.CommandName == "NewRecord" )
{
reqNAME .Enabled = true;
reqEND_DATE .Enabled = true;
valEND_DATE .Enabled = true;
reqNAME .Validate();
reqEND_DATE .Validate();
valEND_DATE .Validate();
if ( Page.IsValid )
{
Guid gID = Guid.Empty;
try
{
SqlProcs.spCAMPAIGNS_New(ref gID, txtNAME.Text, T10n.ToServerTime(ctlEND_DATE.Value), lstSTATUS.SelectedValue, lstCAMPAIGN_TYPE.SelectedValue);
}
catch(Exception ex)
{
SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex);
lblError.Text = ex.Message;
}
if ( !Sql.IsEmptyGuid(gID) )
Response.Redirect("~/Campaigns/view.aspx?ID=" + gID.ToString());
}
}
}
开发者ID:NALSS,项目名称:splendidcrm-99885,代码行数:27,代码来源:NewRecord.ascx.cs
示例9: Page_Command
protected void Page_Command(Object sender, CommandEventArgs e)
{
if ( e.CommandName == "Save" )
{
if ( Page.IsValid )
{
DbProviderFactory dbf = DbProviderFactories.GetFactory();
using ( IDbConnection con = dbf.CreateConnection() )
{
con.Open();
// 10/07/2009 We need to create our own global transaction ID to support auditing and workflow on SQL Azure, PostgreSQL, Oracle, DB2 and MySQL.
using ( IDbTransaction trn = Sql.BeginTransaction(con) )
{
try
{
SqlProcs.spSHORTCUTS_Update(ref gID, MODULE_NAME.SelectedValue, DISPLAY_NAME.Text, RELATIVE_PATH.Text, IMAGE_NAME.Text, SHORTCUT_ENABLED.Checked, Sql.ToInteger(SHORTCUT_ORDER.Text), SHORTCUT_MODULE.SelectedValue, SHORTCUT_ACLTYPE.SelectedValue);
trn.Commit();
}
catch(Exception ex)
{
trn.Rollback();
SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex);
ctlDynamicButtons.ErrorText = ex.Message;
return;
}
}
}
Response.Redirect("default.aspx");
}
}
else if ( e.CommandName == "Cancel" )
{
Response.Redirect("default.aspx");
}
}
开发者ID:huamouse,项目名称:Taoqi,代码行数:35,代码来源:EditView.ascx.cs
示例10: btn_Command
protected void btn_Command(object sender, CommandEventArgs e)
{
string listpage = "~/ControlRoom/Modules/Patrons/PatronPrizes.aspx";
if (e.CommandName.ToLower() == "back")
{
Response.Redirect(listpage);
}
if (e.CommandName.ToLower() == "add")
{
var pp = new DAL.PatronPrizes();
pp.PID = ((Patron) Session["Curr_Patron"]).PID;
pp.PrizeSource = 2;
pp.PrizeName = PrizeName.Text;
pp.RedeemedFlag = true;
pp.LastModUser = pp.AddedUser = ((SRPUser) Session[SessionData.UserProfile.ToString()]).Username;
pp.AddedDate = pp.LastModDate = DateTime.Now;
pp.Insert();
Response.Redirect(listpage);
}
}
开发者ID:haraldnagel,项目名称:greatreadingadventure,代码行数:26,代码来源:PatronPrizesAddEdit.aspx.cs
示例11: LinkButtonCreateCategory_Command
protected void LinkButtonCreateCategory_Command(object sender, CommandEventArgs e)
{
var categoryTitle = this.TextBoxAddCategory.Text;
if (!string.IsNullOrEmpty(categoryTitle))
{
var context = new ApplicationDbContext();
var newCategory = new Category()
{
Title = categoryTitle
};
try
{
context.Categories.Add(newCategory);
context.SaveChanges();
ErrorSuccessNotifier.AddSuccessMessage(string.Format("Category \"{0}\" created!", categoryTitle));
}
catch (Exception ex)
{
ErrorSuccessNotifier.AddErrorMessage(ex);
}
}
else
{
ErrorSuccessNotifier.AddErrorMessage("Category name can no be empty!");
}
Response.Redirect(Request.Url.AbsoluteUri);
}
开发者ID:VyaraGGeorgieva,项目名称:TelerikAcademy,代码行数:30,代码来源:EditCategories.aspx.cs
示例12: LinkButtonDeleteCategory_Command
protected void LinkButtonDeleteCategory_Command(object sender, CommandEventArgs e)
{
var context = new ApplicationDbContext();
var categoryId = Convert.ToInt32(e.CommandArgument);
var category = context.Categories.Include("Books").FirstOrDefault(x => x.CategoryId == categoryId);
if (category != null)
{
try
{
context.Books.RemoveRange(category.Books);
context.Categories.Remove(category);
context.SaveChanges();
ErrorSuccessNotifier.AddSuccessMessage(string.Format("Category {0} removed!", category.Title));
}
catch (Exception ex)
{
ErrorSuccessNotifier.AddErrorMessage(ex);
}
}
else
{
ErrorSuccessNotifier.AddErrorMessage("Can not remove category with id: " + categoryId);
}
Response.Redirect(Request.Url.AbsoluteUri);
}
开发者ID:VyaraGGeorgieva,项目名称:TelerikAcademy,代码行数:25,代码来源:EditCategories.aspx.cs
示例13: GerenciarFiltroLancamentos
//Opcoes de Filtro
protected void GerenciarFiltroLancamentos(object sender, CommandEventArgs e)
{
switch (e.CommandName)
{
case "filtrarPeriodo":
{
switch (e.CommandArgument.ToString())
{
case "confirmar":
{
upfiltroMesBox.Update();
}
break;
case "alterarOpcoes":
{ //altera os campos
filtroMesBoxOp1.Visible = !filtroMesBoxOp1.Visible;//altera opções
filtroMesBoxOp2.Visible = !filtroMesBoxOp2.Visible;//altera opções
//limpa os campos "De data até data2"
ttbDtFiltroDe.Text = "";
ttbDtFiltroAte.Text = "";
}
break;
}
} break;
case "filtrarTipo":
{
}
break;
case "filtrarCategoria":
{
}
break;
}
}
开发者ID:MoraesGil,项目名称:TERMO-4-2014,代码行数:36,代码来源:caixa.aspx.cs
示例14: lbDel_Click
/// <summary>
/// 删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbDel_Click(object sender, CommandEventArgs e)
{
int pwid = Convert.ToInt32(e.CommandArgument);
JumbotOA.Entity.PlanEntity model = new JumbotOA.Entity.PlanEntity();
model = new JumbotOA.BLL.PlanBLL().GetEntity(pwid);
string islock = model.Locked;
if (islock == "未锁定")
{
new JumbotOA.BLL.PlanBLL().Delete(Convert.ToInt32(e.CommandArgument));
string dirpath = Server.MapPath("~/Worddoc");
if (Directory.Exists(dirpath) == false)
{
Directory.CreateDirectory(dirpath);
}
string FileName = Path.GetFileName(model.Pwpath);
string lastpath = dirpath + @"\" + FileName;
File.Delete(lastpath);
Selectinfo(" and uid = " + UserId + "");
}
else
{
System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('该文件已锁定!');</script>");
}
}
开发者ID:huaminglee,项目名称:Cooperative--Office-Automation-System,代码行数:30,代码来源:My_Plan_List.aspx.cs
示例15: onAuthorizeOrder
protected void onAuthorizeOrder(object sender, CommandEventArgs e)
{
var client = new WorldpayRestClient(Configuration.ServiceKey);
string orderCode = (string)Session["orderCode"];
var responseCode = HttpContext.Current.Request.Form["PaRes"];
var httpRequest = HttpContext.Current.Request;
ThreeDSecureInfo threeDSInfo = new ThreeDSecureInfo()
{
shopperIpAddress = httpRequest.UserHostAddress,
shopperSessionId = HttpContext.Current.Session.SessionID,
shopperUserAgent = httpRequest.UserAgent,
shopperAcceptHeader = String.Join(";", httpRequest.AcceptTypes)
};
try
{
var response = client.GetOrderService().Authorize(orderCode, responseCode, threeDSInfo);
OrderResponse.Text = "Order code: <span id='order-code'>" + response.orderCode + "</span><br />Payment Status: " +
response.paymentStatus + "<br />Environment: " + response.environment;
}
catch (WorldpayException exc)
{
ErrorControl.DisplayError(exc.apiError);
}
catch (Exception exc)
{
throw new InvalidOperationException("Error sending request with order code " + orderCode, exc);
}
}
开发者ID:matthewcanty,项目名称:worldpay-lib-dotnet,代码行数:30,代码来源:AuthorizeOrder.aspx.cs
示例16: Page_Command
protected void Page_Command(object sender, CommandEventArgs e)
{
try
{
switch ( e.CommandName )
{
case "Opportunities.Create":
Response.Redirect("~/Opportunities/edit.aspx?PARENT_ID=" + gID.ToString());
break;
case "Opportunities.Edit":
{
Guid gOPPORTUNITY_ID = Sql.ToGuid(e.CommandArgument);
Response.Redirect("~/Opportunities/edit.aspx?ID=" + gOPPORTUNITY_ID.ToString());
break;
}
case "Opportunities.Remove":
{
Guid gOPPORTUNITY_ID = Sql.ToGuid(e.CommandArgument);
SqlProcs.spACCOUNTS_OPPORTUNITIES_Delete(gID, gOPPORTUNITY_ID);
Response.Redirect("view.aspx?ID=" + gID.ToString());
break;
}
default:
throw(new Exception("Unknown command: " + e.CommandName));
}
}
catch(Exception ex)
{
SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex.Message);
lblError.Text = ex.Message;
}
}
开发者ID:NALSS,项目名称:splendidcrm-99885,代码行数:32,代码来源:Opportunities.ascx.cs
示例17: OnCommand
protected virtual void OnCommand(CommandEventArgs e)
{
var handler = Events[EventCommand] as CommandEventHandler;
if (handler != null)
handler(this, e);
RaiseBubbleEvent(this, e);
}
开发者ID:rossspoon,项目名称:bvcms,代码行数:7,代码来源:CommandTextBox.cs
示例18: OnSearch
protected void OnSearch(object sender, CommandEventArgs args)
{
rptSearch.DataSource = Engine.Resolve<IContentSearcher>()
.Search(Query.For(txtSearch.Text))
.Hits.Where(h => h.Content.IsAuthorized(Page.User));
rptSearch.DataBind();
}
开发者ID:meixger,项目名称:n2cms,代码行数:7,代码来源:ManageIndex.ascx.cs
示例19: btnAdd_Command
// add
protected virtual void btnAdd_Command(object sender, CommandEventArgs args)
{
string[] selection = ddlTypes.SelectedValue.Split(':');
Wizard.AddLocation(Selection.SelectedItem, selection[0], selection.Length > 1 ? selection[1] : null, txtTitle.Text, string.Empty);
Response.Redirect("Default.aspx#" + tpType.ClientID);
}
开发者ID:sergheizagaiciuc,项目名称:n2cms,代码行数:8,代码来源:Default.aspx.cs
示例20: Page_Command
protected void Page_Command(object sender, CommandEventArgs e)
{
try
{
if ( e.CommandName == "Search" )
{
grdMain.CurrentPageIndex = 0;
grdMain.DataBind();
}
else if ( e.CommandName == "SortGrid" )
{
grdMain.SetSortFields(e.CommandArgument as string[]);
// 03/17/2011 We need to treat a comma-separated list of fields as an array.
arrSelectFields.AddFields(grdMain.SortColumn);
}
else if ( e.CommandName == "Rules.Delete" )
{
Guid gID = Sql.ToGuid(e.CommandArgument);
SqlProcs.spRULES_Delete(gID);
//Cache.Remove("vwCONTRACT_TYPES_LISTBOX");
Response.Redirect("default.aspx");
}
}
catch(Exception ex)
{
SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex);
lblError.Text = ex.Message;
}
}
开发者ID:huamouse,项目名称:Taoqi,代码行数:29,代码来源:ListView.ascx.cs
注:本文中的System.Web.UI.WebControls.CommandEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论