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; } }
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)); }
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); } }
protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "AddNew": pnlAddCategory.Visible = true; BindVersionCategory(); BindVersion(); break; case "Cancel": pnlAddCategory.Visible = false; txtTitle.Text = ""; ddlCategory.SelectedValue = ""; break; case "Add": if (Page.IsValid) { CSFactory.SaveVersion(CommonHelper.fixquotesAccents(txtTitle.Text), CommonHelper.fixquotesAccents(txtShortName.Text), cbVisible.Checked, Convert.ToInt32(ddlCategory.SelectedValue)); } pnlAddCategory.Visible = false; txtTitle.Text = ""; ddlCategory.SelectedValue = ""; BindVersion(); break; case "Back": Response.Redirect("Main.aspx"); break; } }
protected void btnSave_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { if (e.CommandName == "Save") { displayValues = (List <CSBusiness.Country>)ViewState["Items"]; if (displayValues.Count > 0) { List <CSBusiness.Country> MasterList = CountryManager.GetAllMasterCountries(); foreach (CSBusiness.Country item in displayValues) { CSBusiness.Country existItem = MasterList.FirstOrDefault(x => x.CountryId == item.CountryId); if (existItem != null) { item.Code = existItem.Code; item.OrderNo = existItem.OrderNo; } } CountryManager.CreateCountry(displayValues); CountryManager.ResetCountryCache(); } } Response.Redirect("CountryList.aspx"); }
protected void Page_Command(Object sender, CommandEventArgs e) { if ( e.CommandName == "Save" || e.CommandName == "SaveNew" ) { if ( Page.IsValid ) { try { // 06/02/2006 Paul. Can't be your own parent. Just clear parent value. Guid gPARENT_ID = Sql.ToGuid(txtPARENT_ID.Value); if ( gPARENT_ID == gID ) gPARENT_ID = Guid.Empty; SqlProcs.spPRODUCT_CATEGORIES_Update( ref gID , gPARENT_ID , txtNAME.Text , txtDESCRIPTION.Text , Sql.ToInteger(txtLIST_ORDER.Text) ); Cache.Remove("vwPRODUCT_CATEGORIES_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"); } } }
protected void CommandBtn_Click(Object sender, CommandEventArgs e) { var sessionId = Guid.Parse(e.CommandArgument.ToString()); var dynamicModuleManager = DynamicModuleManager.GetManager(); var myType = TypeResolutionService.ResolveType(SessionsType); var masterItem = dynamicModuleManager.GetDataItem(myType, sessionId); var liveItem = dynamicModuleManager.GetDataItems(myType).FirstOrDefault(item => item.OriginalContentId == sessionId && item.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live); if (e.CommandName == "Attend") { liveItem.CreateRelation(SecurityManager.CurrentUserId, null, typeof(User).FullName, "Attendees"); var currentAttendeesCount = liveItem.GetValue<decimal>("CurrentAttendees"); liveItem.SetValue("CurrentAttendees", currentAttendeesCount + 1); masterItem.SetValue("CurrentAttendees", currentAttendeesCount + 1); } else { liveItem.DeleteRelation(SecurityManager.CurrentUserId, null, typeof(User).FullName, "Attendees"); var currentAttendeesCount = liveItem.GetValue<decimal>("CurrentAttendees"); if (currentAttendeesCount > 0) { liveItem.SetValue("CurrentAttendees", currentAttendeesCount - 1); masterItem.SetValue("CurrentAttendees", currentAttendeesCount - 1); } } dynamicModuleManager.SaveChanges(); }
protected void Page_Command(object sender, CommandEventArgs e) { try { if ( e.CommandName == "AdvancedSearch" ) { Response.Redirect("default.aspx?Advanced=1"); } else if ( e.CommandName == "BasicSearch" ) { Response.Redirect("default.aspx?Advanced=0"); } else if ( e.CommandName == "Clear" ) { ctlSearch.ClearForm(); Server.Transfer("default.aspx?Advanced=" + nAdvanced.ToString()); } else if ( e.CommandName == "Search" ) { // 10/13/2005 Paul. Make sure to clear the page index prior to applying search. grdMain.CurrentPageIndex = 0; grdMain.ApplySort(); grdMain.DataBind(); } else if ( e.CommandName == "MassUpdate" ) { string[] arrID = Request.Form.GetValues("chkMain"); if ( arrID != null ) { string sIDs = Utils.ValidateIDs(arrID); sIDs = Utils.FilterByACL(m_sMODULE, "edit", arrID, "OPPORTUNITIES"); if ( !Sql.IsEmptyString(sIDs) ) { // 07/09/2006 Paul. The date conversion was moved out of the MassUpdate control. SqlProcs.spOPPORTUNITIES_MassUpdate(sIDs, ctlMassUpdate.ASSIGNED_USER_ID, ctlMassUpdate.ACCOUNT_ID, ctlMassUpdate.OPPORTUNITY_TYPE, ctlMassUpdate.LEAD_SOURCE, T10n.ToServerTime(ctlMassUpdate.DATE_CLOSED), ctlMassUpdate.SALES_STAGE); Response.Redirect("default.aspx"); } } } else if ( e.CommandName == "MassDelete" ) { string[] arrID = Request.Form.GetValues("chkMain"); if ( arrID != null ) { string sIDs = Utils.ValidateIDs(arrID); sIDs = Utils.FilterByACL(m_sMODULE, "delete", arrID, "OPPORTUNITIES"); if ( !Sql.IsEmptyString(sIDs) ) { SqlProcs.spOPPORTUNITIES_MassDelete(sIDs); Response.Redirect("default.aspx"); } } } } catch(Exception ex) { SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex.Message); lblError.Text = ex.Message; } }
protected void Page_Command(object sender, CommandEventArgs e) { try { switch ( e.CommandName ) { case "Leads.Create": Response.Redirect("~/Leads/edit.aspx?PARENT_ID=" + gID.ToString()); break; case "Leads.Edit": { Guid gLEAD_ID = Sql.ToGuid(e.CommandArgument); Response.Redirect("~/Leads/edit.aspx?ID=" + gLEAD_ID.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; } }
protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "AddNew": pnlAddCategory.Visible = true; BindProviders(); break; case "Cancel": pnlAddCategory.Visible = false; txtTitle.Text = ""; txtConfig.Text = ""; break; case "Add": if (Page.IsValid) { PaymentProviderManger.SaveProvider(0, CommonHelper.fixquotesAccents(txtTitle.Text), txtConfig.Text); } pnlAddCategory.Visible = false; txtTitle.Text = ""; txtConfig.Text = ""; BindProviders(); break; } }
public void Zip(object sender, System.Web.UI.WebControls.CommandEventArgs e) { string s = "\uFFFD"; for (int i1 = 1; i1 < (dMailbox.Controls.Count - 1); i1++) { if (((System.Web.UI.WebControls.CheckBox)dMailbox.Controls[i1].FindControl("select\uFFFD")).Checked) { int i2 = dMailbox.Controls.Count - 1 - i1; s = s + i2.ToString() + ",\uFFFD"; } } if (s.Length > 0) { string[] sArr = new string[8]; sArr[0] = "DownloadZip.aspx?t=i&s=\uFFFD"; sArr[1] = (string)Application["server\uFFFD"]; sArr[2] = "&u=\uFFFD"; char[] chArr1 = new char[] { '|' }; sArr[3] = Page.User.Identity.Name.Split(chArr1)[0]; sArr[4] = "&b=\uFFFD"; sArr[5] = MailboxName; sArr[6] = "&m=\uFFFD"; char[] chArr2 = new char[] { ',' }; sArr[7] = s.TrimEnd(chArr2); Response.Redirect(System.String.Concat(sArr)); } }
public void ModifyFolders(object sender, System.Web.UI.WebControls.CommandEventArgs e) { iMailboxName.Text = (string)e.CommandArgument; iId.Value = (string)e.CommandArgument; iFoldersSubmit.Value = ((Language)Session["language\uFFFD"]).Words[16].ToString(); pFoldersForm.Visible = true; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void uploadButton_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { if (Helpers.IOHelper.CreateDirectory(Server.MapPath(_imageFolder))) { if (uploadfile.PostedFile.FileName != string.Empty) { try { string virtualPath = _imageFolder + "/" + System.IO.Path.GetFileName(uploadfile.PostedFile.FileName); string phyiscalPath = Server.MapPath(virtualPath); uploadfile.PostedFile.SaveAs(phyiscalPath); uploadmessage.Text = _uploadSuccessMessage; } catch (Exception exe) { uploadmessage.Text = (exe.Message); } } else { uploadmessage.Text = ("_noFileMessage"); } } else { uploadmessage.Text = _noFolderSpecifiedMessage; } DisplayImages(); }
private void BarraBotao_Click(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "Salvar": if (this.Salvar()) { Mensagem.Aviso("Atualização do cadastro do Aluno realizado com sucesso!"); } break; case "Imprimir": this.Imprimir(); break; case "Limpar": this.Limpar(); break; case "Voltar": Response.Redirect("../Geral/index.aspx"); break; default: break; } }
protected void Menu_ActionPerformed(object sender, System.Web.UI.WebControls.CommandEventArgs e) { if (e.CommandName.EqualsCSafe("Continue", true)) { string errorMessage = null; // Ensure the page template PageTemplateInfo pti = selTemplate.EnsureTemplate(null, Guid.Empty, ref errorMessage); if (!String.IsNullOrEmpty(errorMessage)) { ShowError(errorMessage); } else { // Get the template ID int templateId = 0; if (pti != null) { templateId = pti.PageTemplateId; } URLHelper.Redirect("~/CMSModules/Content/CMSDesk/Edit/edit.aspx" + URLHelper.Url.Query + "&templateid=" + templateId); } } }
private void LinkButtonMeta_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { LinkButton tmpLinkButton; if ((tmpLinkButton = sender as LinkButton) == null) { return; } switch (e.CommandName) { case "Download": { string CommandArgument = Convert.ToString(e.CommandArgument); if (CommandArgument == "Download") { string scriptString = "<script type=\"text/javascript\">\n<!--\n"; scriptString += "var AutoDownload=true;"; scriptString += "\n// -->\n"; scriptString += "<"; scriptString += "/"; scriptString += "script>"; Response.Write(scriptString); } break; } } }
private void BarraBotao_Click(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "Novo": Response.Redirect("../Cadastros/frmCadastrarPlanejamentoClinico.aspx"); break; case "Pesquisar": this.Selecionar(); break; case "Salvar": break; case "Limpar": this.Limpar(); break; case "Voltar": Response.Redirect("../Geral/index.aspx"); break; default: break; } }
protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "AddNew": pnlAddCategory.Visible = true; //LanguageControl.Bind(); BindCustomFields(); break; case "Cancel": pnlAddCategory.Visible = false; txtCustomField.Text = ""; break; case "Add": if (Page.IsValid) { CustomFieldDAL.SaveField(txtCustomField.Text); } pnlAddCategory.Visible = false; txtCustomField.Text = ""; BindCustomFields(); break; } }
// 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); }
private void LinkbuttonNext_Command(object source, System.Web.UI.WebControls.CommandEventArgs e) { IPaginatedList productList = this.WebLocalSingleton.CurrentList; productList.NextPage(); this.CurrentController.NextView = WebViews.PRODUCTS_BY_CATEGORY; }
protected void RunFlow(object sender, CommandEventArgs e) { var dto = new EmailDto() { Subject = txtEmailTitle.Text, Content = txtEmailContent.Text, From = "", To = txtEmailAddress.Text }; var validator = ServiceLocator.Current.GetInstance<IValidator<EmailDto>>(); var result = validator.Validate(dto); // need to output something there var flowInput = new WorkFlowInput() { Email = dto, IsNewRequest = true }; var workflow = new FlowHost(); workflow.OnWfCompleted += workflow_OnWfCompleted; workflow.OnWfError += workflow_OnWfError; workflow.OnIdle += workflow_OnIdle; var workflowId = workflow.CreateOrResume(flowInput); if (workflowId.HasValue) instanceId.Value = workflowId.Value.ToString(); }
protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "AddNew": pnlAddCategory.Visible = true; BindProviders(); ScriptManager.RegisterStartupScript(pnlAddCategory, this.GetType(), "scrolltobottom", "window.scrollTo(0,document.body.scrollHeight);", true); break; case "Cancel": pnlAddCategory.Visible = false; txtTitle.Text = ""; txtConfig.Text = ""; break; case "Add": if (Page.IsValid) { PaymentProviderManger.SaveProvider(0, CommonHelper.fixquotesAccents(txtTitle.Text), txtConfig.Text); } pnlAddCategory.Visible = false; txtTitle.Text = ""; txtConfig.Text = ""; BindProviders(); break; } }
protected virtual void OnCommand(CommandEventArgs e) { var handler = Events[EventCommand] as CommandEventHandler; if (handler != null) handler(this, e); RaiseBubbleEvent(this, e); }
public void MarkAsUnread(object sender, System.Web.UI.WebControls.CommandEventArgs e) { try { ActiveUp.Net.Mail.Mailbox mailbox = ((ActiveUp.Net.Mail.Imap4Client)Session["imapobject\uFFFD"]).SelectMailbox(MailboxName); ActiveUp.Net.Mail.FlagCollection flagCollection = new ActiveUp.Net.Mail.FlagCollection(); flagCollection.Add("Seen\uFFFD"); EnvelopeCollection envelopeCollection = EnvelopeCollection.Load(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString() + Session["login\uFFFD"] + "_\uFFFD" + Server.UrlEncode(mailbox.Name) + ".xml\uFFFD")); if (mailbox.Fetch.Flags(MessageId).Merged.IndexOf("\\seen\uFFFD") != -1) { mailbox.RemoveFlagsSilent(MessageId, flagCollection); envelopeCollection[envelopeCollection.Count - MessageId].Read = false; } else { mailbox.AddFlagsSilent(MessageId, flagCollection); envelopeCollection[envelopeCollection.Count - MessageId].Read = true; } envelopeCollection.Save(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString() + Session["login\uFFFD"] + "_\uFFFD" + Server.UrlEncode(mailbox.Name) + ".xml\uFFFD")); //BoundMailboxContent.MailboxName = mailbox.Name; //BoundMailboxContent.LoadMailbox(envelopeCollection, true); } catch (System.Exception e1) { Page.RegisterStartupScript("ShowError\uFFFD", "<script>ShowErrorDialog('\uFFFD" + ((Language)Session["language\uFFFD"]).Words[94].ToString() + "','\uFFFD" + System.Text.RegularExpressions.Regex.Escape(e1.Message + e1.StackTrace).Replace("'\uFFFD", "\\'\uFFFD") + "');</script>\uFFFD"); } }
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; } }
protected void editor_save(object sender, System.Web.UI.WebControls.CommandEventArgs e) { if (string.Compare(e.CommandName, "Save", true) == 0) { String text = Editor123.Text; //check if text has some texts if (!(text.Length > 0)) { Response.Write("<script> alert ('Nothing to save')</script>"); return; } //get the note title String title = titleBox.Text; if (title.Length < 1) { return; } //save note in database note.setTitle(title); note.setText(text); //get the UID from session note.setUID((int)Session["UID"]); if (note.saveNote()) { Editor123.Text = ""; Response.Write("<script> alert ('Note successfully saved.');</script>"); } else { Response.Write("<script> alert ('Cannot save note! there is an error.');</script>"); } } }
protected void DeleteTask(object sender, CommandEventArgs args) { try { using (TaskrCoreProxy service = new TaskrCoreProxy()) { if (service.DeleteTask(new Guid(args.CommandArgument.ToString()))) { new StatusPresenter().Success("Task deleted."); } else { throw new Exception("Could not delete the task."); } } } catch (FaultException<NotAuthorizedDetail> fault) { new StatusPresenter().Error(fault.Message); } catch (FaultException<LimiterExhaustedDetail> fault) { new StatusPresenter().Error(fault.Message); } catch (Exception) { new StatusPresenter().Error("An unknown error ocurred, please try again."); } finally { BindTaskList(); } }
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); }
public void Move(object sender, System.Web.UI.WebControls.CommandEventArgs e) { try { ActiveUp.Net.Mail.Mailbox mailbox = ((ActiveUp.Net.Mail.Imap4Client)Session["imapobject\uFFFD"]).SelectMailbox(MailboxName); // if (!System.IO.File.Exists(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString() + Session["login\uFFFD"] + "_\uFFFD" + Server.UrlEncode(this._boundTopNav.DBoxesItem) + ".xml\uFFFD"))) //this._boundMailboxContent.Cache(this._boundTopNav.DBoxesItem); EnvelopeCollection envelopeCollection1 = EnvelopeCollection.Load(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString() + Session["login\uFFFD"] + "_\uFFFD" + Server.UrlEncode(mailbox.Name) + ".xml\uFFFD")); //EnvelopeCollection envelopeCollection2 = EnvelopeCollection.Load(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString() + Session["login\uFFFD"] + "_\uFFFD" + Server.UrlEncode(this._boundTopNav.DBoxesItem + ".xml\uFFFD"))); //mailbox.CopyMessage(MessageId, this._boundTopNav.DBoxesItem); Envelope envelope = new Envelope(envelopeCollection1[envelopeCollection1.Count - MessageId]); //envelope.Mailbox = this._boundTopNav.DBoxesItem; //envelope.Id = envelopeCollection2.Count + 1; //if (envelopeCollection2.Count != 0) // envelopeCollection2.Insert(envelope, 0); //else // envelopeCollection2.Add(envelope); // envelopeCollection2.Save(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString() + Session["login\uFFFD"] + "_\uFFFD" + Server.UrlEncode(this._boundTopNav.DBoxesItem) + ".xml\uFFFD")); LoadMessage((string)Application["server\uFFFD"], (string)Application["user\uFFFD"], mailbox.Name, MessageId, true); } catch (System.Exception e1) { Page.RegisterStartupScript("ShowError\uFFFD", "<script>ShowErrorDialog('\uFFFD" + ((Language)Session["language\uFFFD"]).Words[87].ToString() + "','\uFFFD" + System.Text.RegularExpressions.Regex.Escape(e1.Message + e1.StackTrace).Replace("'\uFFFD", "\\'\uFFFD") + "');</script>\uFFFD"); } }
/* */ public void ImageButton_Click(Object sender, System.Web.UI.WebControls.CommandEventArgs e) { string qryString; qryString = string.Empty; if (e.CommandName == "imgBtnSearch") { if (e.CommandArgument.ToString() != "0") { qryString += "iCat=1&bt=" + e.CommandArgument; } else { qryString += "iCat=1"; } //if (txtKeywords.Text.Length > 0) //{ // desc = HttpUtility.UrlEncode(Global.CheckString(txtKeywords.Text)); // qryString += "&desc=" + desc; //} string redirHere = "Surfboardsforsale.aspx?" + qryString; Response.Redirect(redirHere, true); } }
//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; } }
protected void UpdateCancelButton_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { if (e.CommandName == "Cancel") { Response.Redirect(e.CommandArgument.ToString(), true); } }
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); }
protected void Button10_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)//移出黑名单 { try { conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ToString()); string str = string.Format("update Friends set FriendClassification = '白名单' where FriAutoID = '" + e.CommandArgument.ToString() + "'; "); SqlCommand cmd = new SqlCommand(str, conn); if (conn != null && conn.State != ConnectionState.Open) { conn.Open(); } SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); dr.Read(); Response.Write("<script>alert('成功')</script>"); dr.Close(); } catch (Exception ex) { //throw ex; Response.Write("<script>alert('失败!')</script>"); } finally { if (conn.State != ConnectionState.Closed) { conn.Close(); } Response.Redirect("Friends.aspx"); } }
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"); } }
protected void PagerCommand(object sender, System.Web.UI.WebControls.CommandEventArgs e) { var curPageIndex = PageIndex; var newPageIndex = 0; switch (e.CommandName) { case "First": newPageIndex = 0; break; case "Previous": if (curPageIndex > 0) { newPageIndex = curPageIndex - 1; } break; case "Next": if (!(curPageIndex == PageCount)) { newPageIndex = curPageIndex + 1; } break; case "Last": newPageIndex = PageCount; break; } OnPageIndexChanging(new GridViewPageEventArgs(newPageIndex)); }
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(); }
/// <summary> /// Handles header actions' events. /// </summary> protected void HeaderActions_ActionPerformed(object sender, System.Web.UI.WebControls.CommandEventArgs e) { if (e.CommandName.Equals(SEND_CMND_NAME, StringComparison.InvariantCultureIgnoreCase)) { Send(); } }
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 = txtFileName.Text; // Get File Name if (fileName.Length == 0) { Common.CWarning warn = new Common.CWarning("Please enter a file name."); throw (warn); } string pdf = ""; string cropYear = ((MasterReportTemplate)Master).CropYear; pdf = WSCReports.rptBeet1099.ReportPackager(cropYear, fileName, logoUrl, pdfTempFolder); if (pdf.Length > 0) { // convert file system path to virtual path pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/"); } ((MasterReportTemplate)sender).LocPDF = pdf; } catch (System.Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); ((MasterReportTemplate)Page.Master).ShowWarning(ex); } }
private void Pager1_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { int currnetPageIndx = Convert.ToInt32(e.CommandArgument); Pager1.CurrentIndex = currnetPageIndx; BuildSql(currnetPageIndx); }
protected void Save_Command(object sender, CommandEventArgs e) { var context = new ConquistadorEntities(); int questionId = Convert.ToInt32(Request.Params["id"]); if (questionId == 0) { isNewQuestion = true; } if (!isNewQuestion) { question = context.Questions.Find(questionId); } else { question = new Question(); context.Questions.Add(question); } question.TextContent = this.TextBoxEdit.Text; question.IsApproved = this.CheckBoxApproved.Checked; try { context.SaveChanges(); Response.Redirect("EditQuestions.aspx", false); } catch (Exception ex) { ErrorSuccessNotifier.AddErrorMessage(ex.Message); return; } }
protected void BtnDel_Click(object sender, System.Web.UI.WebControls.CommandEventArgs e) { int num = System.Convert.ToInt32(e.CommandName); Methods.Supplier_aspnet_UserRegionDelete(num); this.GetRegionData(this.userId); }
protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "AddNew": pnlAddCategory.Visible = true; BindVersion(); break; case "Cancel": pnlAddCategory.Visible = false; txtCategory.Text = ""; break; case "Add": if (Page.IsValid) { CSFactory.SaveVersionCategory(0, CommonHelper.fixquotesAccents(txtCategory.Text)); } pnlAddCategory.Visible = false; txtCategory.Text = ""; BindVersion(); break; case "Back": Response.Redirect("VersionList.aspx"); break; } }
protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { if (Page.IsValid) { ShippingOptionType shippingType = ShippingOptionType.TotalAmount; if (e.CommandName == "OrderWeight") { shippingType = ShippingOptionType.Weight; } using (CSCommerceDataContext context = new CSCommerceDataContext(ConfigHelper.GetDBConnection())) { CSData.ShippingOrderValue cat = new CSData.ShippingOrderValue { OrderTotal = 0, Cost = 0, TypeId = (int)shippingType, IncludeRushShipping = false, PrefId = PrefId }; context.ShippingOrderValues.InsertOnSubmit(cat); context.SubmitChanges(); } BindAll(shippingType, false, PrefId); } }
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; } }
private void BarraBotao_Click(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "Novo": break; case "Pesquisar": break; case "Salvar": Permissao objPermissa = ((principal)this.Master).Permissao("frmCadastrarParametro"); if (objPermissa.Inclui == true) { if (Salvar()) { Mensagem.Aviso(ConfigurationManager.AppSettings["01_Inclusao"].ToString()); } } else { Mensagem.Aviso(ConfigurationManager.AppSettings["09_Permissao_Inclusao"].ToString()); } break; case "Voltar": Response.Redirect("../Geral/index.aspx"); break; default: break; } }
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()); } } }
protected void btnRushAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { if (Page.IsValid) { ShippingOptionType shippingType = ShippingOptionType.TotalAmount; if (e.CommandName == "RushOrderWeight") { shippingType = ShippingOptionType.Weight; } using (CSCommerceDataContext context = new CSCommerceDataContext(ConfigHelper.GetDBConnection())) { CSData.ShippingOrderValue cat = new CSData.ShippingOrderValue { OrderTotal = 0, Cost = 0, TypeId = (int)shippingType, IncludeRushShipping = true, PrefId = DefaultSitePrefereceId }; context.ShippingOrderValues.InsertOnSubmit(cat); context.SubmitChanges(); } BindAll(shippingType, true); //CategoryDAL.UpdateCategory(0, txtCategory.Text, true); } }
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(); } } }
protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "AddNew": pnlAddCategory.Visible = true; ScriptManager.RegisterStartupScript(dlItemList, this.GetType(), "scrolltobottom", "window.scrollTo(0,document.body.scrollHeight);", true); break; case "Cancel": pnlAddCategory.Visible = false; txtKeyName.Text = ""; txtValueName.Text = ""; break; case "Add": if (Page.IsValid) { AdminDAL.UpdateResource(0, CommonHelper.fixquotesAccents(txtKeyName.Text.Trim()), CommonHelper.fixquotesAccents(txtValueName.Text.Trim())); } pnlAddCategory.Visible = false; txtKeyName.Text = ""; txtValueName.Text = ""; BindResources(); break; } }
protected void lbtnRemoveCommand(object sender, CommandEventArgs e) { int UserID = Convert.ToInt32(e.CommandName); removeClient.DoWork(UserID); Response.Write("删除成功~"); GetUsers(); }
protected void LinkbuttonNext_Command(object source, System.Web.UI.WebControls.CommandEventArgs e) { IPaginatedList productList = this.NPetshopState.CurrentList; productList.NextPage(); DataBind(); }
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); } }
protected void CommandBtn_Click(Object sender, CommandEventArgs e) { switch (e.CommandName) { case "Update": DeviceObjectDataSource.Update(); UpdateButton.Visible = false; InsertButton.Visible = true; DeleteButton.Visible = false; break; case "Insert": DeviceObjectDataSource.Insert(); break; case "Delete": DeviceObjectDataSource.Delete(); break; case "SelectBuildingID": Msg.Text = "Нажаата кнопка Выбора"; ModalPopupExtender1.Show(); break; default: Msg.Text = "Command name not recogized."; break; } }
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"); } } }
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; } }
protected void Page_Command(object sender, CommandEventArgs e) { try { switch ( e.CommandName ) { case "Quotes.Edit": { Guid gQUOTE_ID = Sql.ToGuid(e.CommandArgument); Response.Redirect("~/Quotes/edit.aspx?ID=" + gQUOTE_ID.ToString()); break; } case "Quotes.Remove": { Guid gQUOTE_ID = Sql.ToGuid(e.CommandArgument); SqlProcs.spPROJECT_RELATION_Delete(gID, gQUOTE_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; } }
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); } }
/// <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>"); } }
/* */ public void ImageButton_Click(Object sender, System.Web.UI.WebControls.CommandEventArgs e) { string desc; string qryString; qryString = string.Empty; //build query string //if (cboLocation.SelectedItem.Text == "All") //{ // qryString = "loc=all"; //} //else //{ // qryString = "loc=" + cboLocation.SelectedItem.Value; //} if (e.CommandName == "ImageBtn") { qryString += "iCat=1&bt=" + e.CommandArgument;; //if (txtKeywords.Text.Length > 0) //{ // desc = HttpUtility.UrlEncode(Global.CheckString(txtKeywords.Text)); // qryString += "&desc=" + desc; //} string redirHere = "Surfboardsforsale.aspx?" + qryString; Response.Redirect(redirHere, false); } }