protected void dvCurrPoll_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { DeselectPoll(); } }
protected void JobForm_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { Response.Redirect("Default.aspx"); } }
protected void ContactDetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { Response.Redirect("ContactList.aspx"); } }
protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == DataControlCommands.CancelCommandName) { Response.Redirect(table.ListActionPath); } }
protected void accountsDetailsView_ItemCommand(Object sender,DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { Response.Redirect("AccountList.aspx"); } }
protected void dvwShippingMethod_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { gvwShippingMethods.SelectedIndex = -1; gvwShippingMethods.DataBind(); } }
protected void AccountDetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { AccountDetailsView.DataBind(); AccountDetailsView.ChangeMode(DetailsViewMode.Insert); } }
protected void dvCategory_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { gvCategories.SelectedIndex = -1; gvCategories.DataBind(); } }
protected void opportunityDetailsView_ItemCommand(Object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { Response.Redirect("OpportunityList.aspx"); } }
protected void CompanyDetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { Label1.Text = "Submission cancelled <br/> <p>Your changes have been discarded</p>"; UpdatePanel1.Update(); } }
//preusmeravanje na stranicu Zakljucnice preko dugmeta OtvoriZakljucnicu protected void dvMusterijeDetalji_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "btnOtvoriZakljucnicu") { IDMusterije = e.CommandArgument.ToString(); } }
protected void dvwOrderStatus_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { gvwOrderStatuses.SelectedIndex = -1; gvwOrderStatuses.DataBind(); } }
protected void dvCurrComment_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { gvAllComments.SelectedIndex = -1; gvAllComments.DataBind(); } }
protected void inviaMail(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "inviaMail") { //pagina invio mail Response.Redirect("~/Admin/InviaMail.aspx" + "?ID=" + idSocieta); } }
/// <internalonly/> /// <devdoc> /// </devdoc> protected override bool OnBubbleEvent(object source, EventArgs e) { if (e is CommandEventArgs) { DetailsViewCommandEventArgs args = new DetailsViewCommandEventArgs(source, (CommandEventArgs)e); RaiseBubbleEvent(this, args); return true; } return false; }
protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "ReturnCommand") { DataGridView.Attributes["class"] = "Display"; DataDetailView.Attributes["class"] = "DisplayNone"; RecordsReturned.Attributes["class"] = "Display"; PartialReturned.Attributes["class"] = "Display"; } }
protected void DetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { InfoList.Items.Clear(); switch (e.CommandName) { case "TestWeb": try { IBaseDriver drv = null; switch (mm.DbServer) { case DbServer.MySql: drv = new BaseDriverMySql(((TextBox)(DetailsView.Rows[1].Cells[1].Controls[0])).Text); break; case DbServer.MsSql: drv = new BaseDriverMsSql(((TextBox)(DetailsView.Rows[1].Cells[1].Controls[0])).Text); break; } drv.TestConnection(); InfoList.Items.Add("Connection successful"); } catch (Exception ew) { InfoList.Items.Add(ew.Message); } break; case "TestIS": try { IBaseDriver drv = null; switch (mm.DbServer) { case DbServer.MySql: drv = new BaseDriverMySql(((TextBox)(DetailsView.Rows[3].Cells[1].Controls[0])).Text); break; case DbServer.MsSql: drv = new BaseDriverMsSql(((TextBox)(DetailsView.Rows[3].Cells[1].Controls[0])).Text); break; } drv.TestConnection(); InfoList.Items.Add("Connection successful"); } catch (Exception ei) { InfoList.Items.Add(ei.Message); } break; case "Cancel": Response.RedirectToRoute("ProjectsRoute"); break; case "Edit": DetailsView.ChangeMode(DetailsViewMode.Edit); break; } }
protected void CampaignDetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { Session["EditCampaignID"] = 0; MessageLiteral.Text = "Changes discarded <br /> <br /> <p>Your changes have been discarded</p>"; CampaignDetailsView.DataBind(); CampaignDetailsView.ChangeMode(DetailsViewMode.Insert); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "ShowAlertModal();", true); } }
protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if(e.CommandName == "Update") { ClientScript.RegisterStartupScript(Page.GetType(), "rejecting", "CloseAndRebind();", true); } else { ClientScript.RegisterStartupScript(Page.GetType(), "rejecting", "CancelEdit()", true); } }
//cancel invoice protected void InvoiceDetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { //stay current tab MsgLiteral.Text = "Submission cancelled"; alertLabel.Text = "Your changes have been discarded"; InvoiceDetailsView.DataBind(); InvoiceDetailsView.ChangeMode(DetailsViewMode.Insert); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "ShowAlertModal();", true); //Move to View Tab //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "GoToTab(2);", true); } }
protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (!string.IsNullOrEmpty(_urlReferrer)) { switch (e.CommandName.ToUpper()) { case "NEW": { // Tee up postback to hosting form (if this one is in iframe) on the next Post event (Insert or Cancel in this case) ClientScript.RegisterOnSubmitStatement(this.GetType(), "Refresh", "Javascript:window.parent.Redirect();"); break; } } } }
public void NewUserCommand(object sender, DetailsViewCommandEventArgs a) { if (a.CommandName.Equals("InsertNewUser")) { NetTelcoUserRepository NewUser = new NetTelcoUserRepository(); NewUser.CreateUser( (UsersDetailGridView.FindControl("FIRST_NAMETextBox") as TextBox).Text.ToString(), //FirstNameTextBox.Text, (UsersDetailGridView.FindControl("LAST_NAMETextBox") as TextBox).Text.ToString(), //LastNameTextBox.Text, (UsersDetailGridView.FindControl("LOGINTextBox") as TextBox).Text.ToString(), //LoginTextBox.Text, (UsersDetailGridView.FindControl("PASSWORDTextBox") as TextBox).Text.ToString(), //PasswordTextBox.Text, null ); UsersEditGridView.DataBind(); } }
protected void HitDetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Clone") { } if (e.CommandName == "Upload") { } if (e.CommandName == "Extend") { } if (e.CommandName == "Expire") { } }
protected void UsersDetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Edit") { //Response.Redirect("~/Users/Users.aspx"); UsersDetailsView.ChangeMode(DetailsViewMode.Edit); } if (e.CommandName == "Update") { //Response.Redirect("~/Users/Users.aspx"); UsersDetailsView.ChangeMode(DetailsViewMode.Edit); } if (e.CommandName == "Cancel") { Response.Redirect("~/Users/UserList.aspx"); } }
// Deletes a given user from the database. protected void DeleteUser(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName.Equals("Delete")) { try { // Connects to the database int userID = int.Parse(Request.QueryString["userID"]); string connect = "Data Source=BPPLRY1;Initial Catalog=\"StoreFrontDB v1.1\";Integrated Security=True"; SqlConnection connection = new SqlConnection(connect); connection.Open(); SqlCommand command = new SqlCommand("EXEC spDeleteUser @UserID = " + userID.ToString() + ";", connection); command.ExecuteNonQuery(); connection.Close(); } // Redirects to admin page before error propogates. finally { Response.Redirect("CustomerAdmin.aspx"); } } }
protected void dvNetworkTariff_ItemCommand(object sender, DetailsViewCommandEventArgs e) { switch (e.CommandName) { case "Insert": var dvTariff = (DetailsView)sender; var txtCode = (TextBox)dvTariff.FindControl("txtNewCode"); var txtTariff = (TextBox) dvTariff.FindControl("txtNewTariff"); var chkHasFlagfall = (CheckBox)dvTariff.FindControl("chkNewHasFlagfall"); var chkFreeCall = (CheckBox)dvTariff.FindControl("chkNewFreeCall"); var code = txtCode.Text; var tariff = txtTariff.Text; var freeCall = chkFreeCall.Checked; var hasFlagfall = chkHasFlagfall.Checked; var networkId = int.Parse(e.CommandArgument.ToString()); InsertNetworkTariff(code, tariff, freeCall, hasFlagfall, networkId); break; } }
protected void TaskDetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) { if (e.CommandName == "Cancel") { Session["EditTaskID"] = 0; Session.Remove("ReceiverName"); Session.Remove("ReceiverEmail"); Session.Remove("TaskSubject"); Session.Remove("AssignedUserID"); Session.Remove("EditParentID"); Session.Remove("TaskParentName"); Session.Remove("NotifyUser"); MessageLiteral.Text = "Changes discarded !</br></br> <p> Your changes have been discarded.</p>"; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "ShowAlertModal();", true); TaskDetailsView.DataBind(); TaskDetailsView.ChangeMode(DetailsViewMode.Insert); } }
protected void DetailsView2_ItemCommand(object sender, DetailsViewCommandEventArgs e) { GridView2.DataSourceID = "LinqDataSource2"; GridView2.DataBind(); }
void dv_ItemCommand (object sender, DetailsViewCommandEventArgs e) { itemCommand = true; }
public void DetailsView_BubbleEvents () { ResetEvents (); DetailsViewCommandEventArgs com; PokerDetailsView dv = new PokerDetailsView (); dv.DataSource = TableObject.CreateDataTable (); Page page = new Page (); Button bt = new Button (); dv.AllowPaging = true; dv.DataSource = myds; page.Controls.Add (dv); dv.DataBind (); dv.ItemCommand += new DetailsViewCommandEventHandler (dv_ItemCommand ); dv.ItemDeleted += new DetailsViewDeletedEventHandler (dv_ItemDeleted ); //Delete dv.ItemDeleting += new DetailsViewDeleteEventHandler (dv_ItemDeleting ); com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Delete", null)); Assert.AreEqual (false, itemCommand, "BeforeDeleteCommandBubbleEvent"); Assert.AreEqual (false, itemDeleting, "BeforeDeleteBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Delete"); Assert.AreEqual (true, itemDeleting, "AfterDeleteBubbleEvent"); Assert.AreEqual (true, itemCommand, "AfterDeleteCommandBubbleEvent"); //Insert itemCommand = false; dv.ItemInserting += new DetailsViewInsertEventHandler (dv_ItemInserting); dv.ChangeMode (DetailsViewMode.Insert); com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Insert", null)); Assert.AreEqual (false, itemCommand, "BeforeInsertCommandBubbleEvent"); Assert.AreEqual (false, itemInserting, "BeforeInsertBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Insert"); Assert.AreEqual (true, itemCommand, "AfterInsertCommandBubbleEvent"); Assert.AreEqual (true, itemInserting, "AfterInsertBubbleEvent"); //Update itemCommand = false; dv.ItemUpdating += new DetailsViewUpdateEventHandler (dv_ItemUpdating); dv.ChangeMode (DetailsViewMode.Edit); com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Update", null)); Assert.AreEqual (false, itemUpdating, "BeforeUpdateEvent"); Assert.AreEqual (false, itemCommand, "BeforeUpdateCommandEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Update"); Assert.AreEqual (true, itemCommand, "AfterUpdateCommandBubbleEvent"); Assert.AreEqual (true, itemUpdating, "AfterUpdateBubbleEvent"); //Cancel itemCommand = false; dv.ModeChanging += new DetailsViewModeEventHandler (dv_ModeChanging); com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Cancel", null)); Assert.AreEqual (false, itemCommand, "BeforeCancelCommandBubbleEvent"); Assert.AreEqual (false, modeChanging, "BeforeCancelBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Cancel"); Assert.AreEqual (true, itemCommand, "AfterCancelCommandBubbleEvent"); Assert.AreEqual (true, modeChanging, "AfterCancelBubbleEvent"); //Edit itemCommand = false; modeChanging = false; com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Edit", null)); Assert.AreEqual (false, itemCommand, "BeforeEditCommandBubbleEvent"); Assert.AreEqual (false, modeChanging, "BeforeEditBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Edit"); Assert.AreEqual (true, itemCommand, "AfterEditCommandBubbleEvent"); Assert.AreEqual (true, modeChanging, "AfterEditBubbleEvent"); //New itemCommand = false; modeChanging = false; com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("New", null)); Assert.AreEqual (false, itemCommand, "BeforeNewCommandBubbleEvent"); Assert.AreEqual (false, modeChanging, "BeforeNewBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - New"); Assert.AreEqual (true, itemCommand, "AfterNewCommandBubbleEvent"); Assert.AreEqual (true, modeChanging, "AfterNewBubbleEvent"); //Page Index default itemCommand = false; dv.PageIndexChanging += new DetailsViewPageEventHandler (dv_PageIndexChanging ); com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Page", null)); Assert.AreEqual (false, itemCommand, "BeforePageCommandBubbleEvent"); Assert.AreEqual (false, pageIndexChanging, "BeforePageBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Page Index default"); Assert.AreEqual (true, itemCommand, "AfterPageCommandBubbleEvent"); Assert.AreEqual (true, pageIndexChanging, "AfterPageBubbleEvent"); Assert.AreEqual (-1, newPageIndex, "PageIndex"); //Next Page itemCommand = false; pageIndexChanging = false; com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Page", "Next")); Assert.AreEqual (false, itemCommand, "BeforeNextPageCommandBubbleEvent"); Assert.AreEqual (false, pageIndexChanging, "BeforeNextPageBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Next Page"); Assert.AreEqual (true, itemCommand, "AfterNextPageCommandBubbleEvent"); Assert.AreEqual (true, pageIndexChanging, "AfterNextPageBubbleEvent"); Assert.AreEqual (1, newPageIndex, "NextPageIndex"); //Prev Page itemCommand = false; pageIndexChanging = false; com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Page", "Prev")); Assert.AreEqual (false, itemCommand, "BeforePrevPageCommandBubbleEvent"); Assert.AreEqual (false, pageIndexChanging, "BeforePrevPageBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Prev Page"); Assert.AreEqual (true, itemCommand, "AfterPrevPageCommandBubbleEvent"); Assert.AreEqual (true, pageIndexChanging, "AfterPrevPageBubbleEvent"); Assert.AreEqual (-1, newPageIndex, "PrevPageIndex"); //First Page itemCommand = false; pageIndexChanging = false; com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Page", "First")); Assert.AreEqual (false, itemCommand, "BeforeFirstPageCommandBubbleEvent"); Assert.AreEqual (false, pageIndexChanging, "BeforeFirstPageBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - First Page"); Assert.AreEqual (true, itemCommand, "AfterFirstPageCommandBubbleEvent"); Assert.AreEqual (true, pageIndexChanging, "AfterFirstPageBubbleEvent"); Assert.AreEqual (0, newPageIndex, "FirstPageIndex"); //Last Page itemCommand = false; pageIndexChanging = false; com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Page", "Last")); Assert.AreEqual (false, itemCommand, "BeforeLastPageCommandBubbleEvent"); Assert.AreEqual (false, pageIndexChanging, "BeforeLastPageBubbleEvent"); Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Last Page"); Assert.AreEqual (true, itemCommand, "AfterLastPageCommandBubbleEvent"); Assert.AreEqual (true, pageIndexChanging, "AfterLastPageBubbleEvent"); Assert.AreEqual (5, newPageIndex, "FirstPageIndex"); }
protected virtual new void OnItemCommand(DetailsViewCommandEventArgs e) { }