protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { hdnPKID.Value = e.CommandArgument.ToString(); if (e.CommandName == "IsActive") { objUser = new tblUser(); if (objUser.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value))) { if (objUser.AppIsActive == true) { objUser.AppIsActive = false; } else if (objUser.AppIsActive == false) { objUser.AppIsActive = true; } objUser.Save(); } objUser = null; LoadDataGrid(false, false, "", ""); } } }
public void UserActive(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "UserActive") { using (App_Data.DataClassesERPDataContext erpdb = new App_Data.DataClassesERPDataContext()) { int index = Convert.ToInt32(e.CommandArgument); string userstmp = GridView1.DataKeys[index].Value.ToString(); LblID.Text = userstmp; var UserData = from u in erpdb.aspnet_Users join m in erpdb.aspnet_Memberships on u.UserId equals m.UserId where u.UserId.ToString() == userstmp select new { user_code = u.UserName, email = m.Email, last_login_date = m.LastLoginDate, register_date = m.CreateDate, active_flag = u.MobileAlias }; foreach (var ud in UserData) { txtLoginName.Text = ud.user_code; txtEmail.Text = ud.email; } } MultiView1.ActiveViewIndex = 1; } }
protected void grdRoles_RowCommand(object sender, GridViewCommandEventArgs e) { _wrapperError.Style.Add("display", "none"); try { int id = Convert.ToInt32(grdRoles.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Value.ToString()); switch (e.CommandName.ToString()) { case "comandoEdicion": txtNombre.Text = _controladora.BuscarPorId(id).Nombre; idEdicion.Value = id.ToString(); ScriptManager.RegisterStartupScript(this, this.GetType(), "none", "<script>$('#carga').modal('show');</script>", false); break; case "comandoBorrado": _controladora.Desactivar(id); this.Bind(); break; case "comandoRestitucion": _controladora.Reactivar(id); this.Bind(); break; } } catch (Exception ex) { this.MostrarError(ex.Message); } }
private void grdAttributeValues_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int attributeValueId = (int)this.grdAttributeValues.DataKeys[rowIndex].Value; int displaySequence = int.Parse((this.grdAttributeValues.Rows[rowIndex].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None); int replaceAttributeValueId = 0; int replaceDisplaySequence = 0; if (e.CommandName == "Fall") { if (rowIndex < this.grdAttributeValues.Rows.Count - 1) { replaceAttributeValueId = (int)this.grdAttributeValues.DataKeys[rowIndex + 1].Value; replaceDisplaySequence = int.Parse((this.grdAttributeValues.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None); } } else { if (e.CommandName == "Rise" && rowIndex > 0) { replaceAttributeValueId = (int)this.grdAttributeValues.DataKeys[rowIndex - 1].Value; replaceDisplaySequence = int.Parse((this.grdAttributeValues.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None); } } if (replaceAttributeValueId > 0) { ProductTypeHelper.SwapAttributeValueSequence(attributeValueId, replaceAttributeValueId, displaySequence, replaceDisplaySequence); this.BindData(); } }
private void grdHotKeywords_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "Fall" || e.CommandName == "Rise") { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int int_ = (int)this.grdHotKeywords.DataKeys[rowIndex].Value; int displaySequence = int.Parse((this.grdHotKeywords.Rows[rowIndex].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text); int num = 0; int replaceDisplaySequence = 0; if (e.CommandName == "Fall") { if (rowIndex + 1 != this.grdHotKeywords.Rows.Count) { num = (int)this.grdHotKeywords.DataKeys[rowIndex + 1].Value; replaceDisplaySequence = int.Parse((this.grdHotKeywords.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text); } } else { if (e.CommandName == "Rise" && rowIndex != 0) { num = (int)this.grdHotKeywords.DataKeys[rowIndex - 1].Value; replaceDisplaySequence = int.Parse((this.grdHotKeywords.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text); } } if (num != 0) { StoreHelper.SwapHotWordsSequence(int_, num, displaySequence, replaceDisplaySequence); this.BindData(); } } }
protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { objCommon = new clsCommon(); hdnPKID.Value = e.CommandArgument.ToString(); if (e.CommandName == "IsActive") { objPinCode = new tblPinCode(); if (objPinCode.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value))) { if (objPinCode.s_AppIsActive != "") { if (objPinCode.AppIsActive == true) { objPinCode.AppIsActive = false; } else if (objPinCode.AppIsActive == false) { objPinCode.AppIsActive = true; } } else { objPinCode.AppIsActive = true; } objPinCode.Save(); LoadDataGrid(false, false); } objPinCode = null; } } }
protected void gvwDatos_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { try { int inIndice = Convert.ToInt16(e.CommandArgument); if (e.CommandName.Equals("Editar")) { lblOpcion.Text = "2"; txtCodigo.Text = ((Label)gvwDatos.Rows[inIndice].FindControl("lblCodigo")).Text; txtDescripcion.Text = String.IsNullOrEmpty(gvwDatos.Rows[inIndice].Cells[1].Text) ? String.Empty : gvwDatos.Rows[inIndice].Cells[1].Text; } else if (e.CommandName.Equals("Eliminar")) { lblOpcion.Text = "3"; logica.Models.clsTipodeGastronomia obclsTipodeGastronomia = new logica.Models.clsTipodeGastronomia { lgCodigo = Convert.ToInt32(((Label)gvwDatos.Rows[inIndice].FindControl("lblCodigo")).Text), stDescripcion = String.Empty, }; Controllers.TipodeGastronomiaControllers obTipodeGastronomiaControllers = new Controllers.TipodeGastronomiaControllers(); ClientScript.RegisterStartupScript(this.GetType(), "Mesaje", "<Script> swal('MENSAJE!', '" + obTipodeGastronomiaControllers.setAdministrarTipodeGastronomiaController(obclsTipodeGastronomia, Convert.ToInt32(lblOpcion.Text)) + "!', 'success')</Script>"); lblOpcion.Text = txtCodigo.Text = txtDescripcion.Text = String.Empty; getTipodeGastronomia(); } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "Mesaje", "<Script> swal('ERROR!', '" + ex.Message + "!', 'ERROR')</Script>"); } }
private void grdMenu_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int menuId = (int)this.grdMenu.DataKeys[rowIndex].Value; if (e.CommandName == "Fall") { VShopHelper.SwapMenuSequence(menuId, false); } else { if (e.CommandName == "Rise") { VShopHelper.SwapMenuSequence(menuId, true); } else { if (e.CommandName == "DeleteMenu") { if (VShopHelper.DeleteMenu(menuId)) { this.ShowMsg("成功删除了指定的分类", true); } else { this.ShowMsg("分类删除失败,未知错误", false); } } } } this.BindData(ClientType.AliOH); }
//protected void lstShippingProvider_SelectedIndexChanged(object sender, System.EventArgs e) //{ // LoadServiceCodes(); //} //private void LoadServiceCodes() //{ // this.lstServiceCode.Items.Clear(); // IShippingService p = MerchantTribe.Commerce.Shipping.AvailableServices.FindById(this.lstShippingProvider.SelectedValue); // if (p != null) { // foreach (IServiceCode li in p.ListAllServiceCodes()) // { // this.lstServiceCode.Items.Add(new System.Web.UI.WebControls.ListItem(li.DisplayName, li.Code)); // } // } // if (this.lstServiceCode.Items.Count > 0) { // this.lstServiceCode.Visible = true; // } // else { // this.lstServiceCode.Visible = false; // } // this.lstShippingProvider.UpdateAfterCallBack = true; // this.lstServiceCode.UpdateAfterCallBack = true; //} protected void PackagesGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "TrackingNumberUpdate") { if (e.CommandSource is System.Web.UI.Control) { Order o = MTApp.OrderServices.Orders.FindForCurrentStore(Request.QueryString["id"]); GridViewRow row = (GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer; TextBox trackingNumberTextBox = (TextBox)row.FindControl("TrackingNumberTextBox"); if (trackingNumberTextBox != null) { string idstring = (string)e.CommandArgument; long pid = 0; long.TryParse(idstring, out pid); OrderPackage package = o.Packages.Where(y => y.Id == pid).SingleOrDefault(); if (package != null) { package.TrackingNumber = trackingNumberTextBox.Text; MTApp.OrderServices.Orders.Update(o); } } } } LoadOrder(); }
private void grdBalanceDrawRequest_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { System.Web.UI.WebControls.GridViewRow gridViewRow = (System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer; int userId = (int)this.grdBalanceDrawRequest.DataKeys[gridViewRow.RowIndex].Value; if (e.CommandName == "UnLineReCharge") { if (MemberHelper.DealBalanceDrawRequest(userId, true)) { this.BindBalanceDrawRequest(); } else { this.ShowMsg("预付款提现申请操作失败", false); } } if (e.CommandName == "RefuseRequest") { if (MemberHelper.DealBalanceDrawRequest(userId, false)) { this.BindBalanceDrawRequest(); return; } this.ShowMsg("预付款提现申请操作失败", false); } }
protected void TransactionsTable_OnRowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName != "DeleteTransaction") return; try { var connString = ConfigurationManager.ConnectionStrings["CineQuilla"].ConnectionString; using (SqlConnection connection = new SqlConnection(connString)) { connection.Open(); using (SqlCommand command = new SqlCommand(null, connection)) { command.CommandText = "DELETE FROM transactions WHERE id = @id"; SqlParameter idParam = new SqlParameter("@id", SqlDbType.Int); idParam.Value = e.CommandArgument; command.Parameters.Add(idParam); command.Prepare(); command.ExecuteNonQuery(); } } } catch (SqlException ex) { ErrorLabel.Visible = true; return; } Response.Redirect(Request.RawUrl); }
private void grdHeaderMenu_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "SetYesOrNo") { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int num = (int)this.grdHeaderMenu.DataKeys[rowIndex].Value; string filename = System.Web.HttpContext.Current.Request.MapPath(Globals.ApplicationPath + string.Format("/Templates/master/{0}/config/HeaderMenu.xml", this.themName)); System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument(); xmlDocument.Load(filename); System.Xml.XmlNodeList childNodes = xmlDocument.SelectSingleNode("root").ChildNodes; foreach (System.Xml.XmlNode xmlNode in childNodes) { if (xmlNode.Attributes["Id"].Value == num.ToString()) { if (xmlNode.Attributes["Visible"].Value == "true") { xmlNode.Attributes["Visible"].Value = "false"; break; } xmlNode.Attributes["Visible"].Value = "true"; break; } } xmlDocument.Save(filename); this.BindHeaderMenu(); } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (Page.IsValid) { if (e.CommandName == "Select") { Users newUser; dbHelper helper = new dbHelper(); newUser = helper.GetUserbyName(TextBoxUser.Text); if (newUser == null) { newUser = new Users(); newUser.UserName = TextBoxUser.Text; newUser.UserType = "local"; newUser.SNUserId = "local" + TextBoxUser.Text; helper.AddToModel(newUser); } Session["user"] = newUser; WebControl wc = e.CommandSource as WebControl; GridViewRow row = wc.NamingContainer as GridViewRow; Session["UseCaseStartTime"] = DateTime.Now; Session["UseCaseNumber"] = row.RowIndex + 1; Session["UseCaseText"] = row.Cells[1].Text; Server.Transfer("Design.aspx"); } } }
protected void gvAmortizations_RowCommand(object sender, GridViewCommandEventArgs e) { //GridViewRow gvr = (GridViewRow)((e.CommandArgument)); //int RowIndex; //int.TryParse(e.CommandArgument.ToString(),out RowIndex); //((CheckBox)gvAmortizations.Rows[RowIndex].FindControl("ckPaid")).Enabled = true; }
protected void uiGridViewSupps_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditSupp") { IStock.BLL.Suppliers objData = new IStock.BLL.Suppliers(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxName.Text = objData.Name; uiTextBoxDesc.Text = objData.Description; uiPanelAllSupp.Visible = false; uiPanelEditSupplier.Visible = true; CurrentSupplier = objData; BindSupplier(); } else if (e.CommandName == "DeleteSupp") { try { IStock.BLL.Suppliers objData = new IStock.BLL.Suppliers(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); CurrentSupplier = null; BindSupplier(); } catch (Exception ex) { uipanelError.Visible = true; } } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToString().Equals("viewImage")) { Response.Redirect("ImageHome.aspx?imageId=" + Convert.ToString(e.CommandArgument), true); } }
protected void gvContactType_RowCommand(object sender, GridViewCommandEventArgs e) { LeadContactType contactType = null; int contactTypeID = Convert.ToInt32(e.CommandArgument); if (e.CommandName == "DoEdit") { contactType = LeadContactTypeManager.Get(contactTypeID); if (contactType != null) { txtContactType.Text = contactType.Description; showContactTypePanel(); } } else if (e.CommandName == "DoDelete") { contactType = LeadContactTypeManager.Get(contactTypeID); if (contactType != null) { contactType.isActive = false; LeadContactTypeManager.Save(contactType); DoBind(); } } }
protected void gvSemester_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "lbEdit") { int id = int.Parse(e.CommandArgument.ToString()); //DataKey key = gvSemester.DataKeys[id]; //int ID =int.Parse(key.Value.ToString());//取出ID Response.Redirect("Edit.aspx?ID="+id); } else if (e.CommandName == "lbDel") { int id = int.Parse(e.CommandArgument.ToString()); LabMS.BLL.Semester BS = new LabMS.BLL.Semester(); try { BS.Delete(id); Common.JShelper.JSAlert(this.Page, "", "删除成功!"); InitBind(); } catch { Common.JShelper.JSAlert(this.Page, "", "删除失败!"); } } }
protected void GridView1_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "Click") { pnlOInfo.Visible = true; int rowID = Convert.ToInt16(e.CommandArgument); SqlCommand cmd = new SqlCommand("Booksp", cn); cn.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@action", "ViewOInfo"); cmd.Parameters.AddWithValue("@session", rowID); cmd.Parameters.AddWithValue("@bookname", txtSearch.Text); SqlDataReader dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); cn.Close(); if (dt.Rows.Count > 0) { lblAC.Text = dt.Rows[0]["PresentCopies"].ToString(); lblAddress.Text = dt.Rows[0]["Locality"].ToString() + ',' + dt.Rows[0]["City"].ToString() + ',' + dt.Rows[0]["State"].ToString(); lblAuthor.Text = dt.Rows[0]["BookAuthor"].ToString(); lblEdition.Text = dt.Rows[0]["BookEdition"].ToString(); lblEmail.Text = dt.Rows[0]["Email"].ToString(); lblHeading.Text = dt.Rows[0]["BookName"].ToString(); lblMobNo.Text = dt.Rows[0]["MobileNo"].ToString(); lblOName.Text = dt.Rows[0]["OrganisationName"].ToString(); } } }
private void AddOneToPriority(GridViewCommandEventArgs e) { Func<int, bool> func = (int _issueId) => issueController.AddOneToPriority(_issueId); ModifyIssue(e, func); }
protected void GridView2_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int codigo = 0; switch (e.CommandName) { case "Alterar": codigo = Convert.ToInt32(e.CommandArgument); Session["ID"] = codigo; Response.Redirect("Alterar.aspx"); break; case "Deletar": codigo = Convert.ToInt32(e.CommandArgument); ClienteBD bd = new ClienteBD(); bd.Delete(codigo); Carrega(); break; default: break; } }
protected void PermisosGridView_RowCommand(object sender, GridViewCommandEventArgs e) { int item = Convert.ToInt32(e.CommandArgument); List<Entidades.Permiso> lista = (List<Entidades.Permiso>)ViewState["Permisos"]; Entidades.Permiso permiso = lista[item]; switch (e.CommandName) { case "CambiarEstado": if (permiso.WF.Estado == "Vigente" || permiso.WF.Estado == "DeBaja") { TituloConfirmacionLabel.Text = "Confirmar " + (permiso.WF.Estado == "Vigente" ? "Baja" : "Anulación Baja"); AccionLabel.Text = permiso.Accion.Tipo + " nº " + permiso.Accion.Nro; CuitLabel.Text = permiso.Cuit; IdTipoPermisoLabel.Text = permiso.TipoPermiso.Id; EstadoLabel.Text = permiso.WF.Estado; FechaFinVigenciaLabel.Text = permiso.FechaFinVigencia.ToString("dd/MM/yyyy"); UNLabel.Text = permiso.IdUN.ToString(); UsuarioLabel.Text = permiso.Usuario.Id; UsuarioSolicitanteLabel.Text = permiso.UsuarioSolicitante.Id; ViewState["Permiso"] = permiso; ModalPopupExtender1.Show(); } else { MensajeLabel.Text = "El cambio de estado sólo puede usarse para Bajas o Anulaciones de bajas."; } break; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete") { } else if (e.CommandName == "Edit") { DetailsView1.ChangeMode(DetailsViewMode.Edit); } else if(e.CommandName == "Select") { DetailsView1.ChangeMode(DetailsViewMode.Edit); } else if(e.CommandName== "New") { DetailsView1.ChangeMode(DetailsViewMode.Insert); } else { string cmdname = e.CommandName.ToString(); } }
protected void gvClaims_RowCommand(object sender, GridViewCommandEventArgs e) { string[] ids = e.CommandArgument.ToString().Split(new char[] {'|'}); int claimID = Convert.ToInt32(ids[0]); int policyID = Convert.ToInt32(ids[1]); Claim claim = null; if (e.CommandName == "DoEdit") { Session["ClaimID"] = claimID; Session["policyID"] = policyID; Response.Redirect("~/Protected/ClaimEdit.aspx"); } else if (e.CommandName == "DoDelete") { try { claim = ClaimsManager.Get(claimID); if (claim != null) { // make claim as deleted claim.IsActive = false; ClaimsManager.Save(claim); // refresh claim list bindData(claim.PolicyID); } } catch (Exception ex) { Core.EmailHelper.emailError(ex); } } }
protected void uiGridViewItems_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteDetail") { IStock.BLL.ClientReturnDetails objData = new IStock.BLL.ClientReturnDetails(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); decimal price = 0; if (!objData.IsColumnNull("Discount") && objData.Discount != 0) { price = objData.ItemPrice * objData.Quantity * (objData.Discount / 100); } else { price = objData.ItemPrice * objData.Quantity; } IStock.BLL.Clients client = new IStock.BLL.Clients(); IStock.BLL.ClientReturns returns = new IStock.BLL.ClientReturns (); returns.LoadByPrimaryKey(objData.ClientReturnID); client.LoadByPrimaryKey(returns.ClientID); client.StartCredit += price; client.Save(); IStock.BLL.Items item = new IStock.BLL.Items(); item.LoadByPrimaryKey(objData.ItemID); if(!objData.IsColumnNull("Valid")) item.Quantity -= objData.Valid; item.Save(); objData.MarkAsDeleted(); objData.Save(); BindItems(); } }
protected void gvCourses_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete") { string id = Convert.ToString(e.CommandArgument); if (id == this.Id) { viewForm.Visible = false; } try { ISelection select = SelectionMgr.Get(id, LoginUser.Id); if (select == null) { lblMessage.Text = "选课已取消!"; return; } BLL.SelectionMgr.Delete(select.Id); lblMessage.Text = "选课取消成功!"; } catch (Exception ex) { lblMessage.Text = ex.Message; } } }
protected void grdStates_OnRowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditRow") { var row = ((Control)e.CommandSource).NamingContainer as GridViewRow; if (row != null) { txtStateName.Text = ((Label)(row.FindControl("lblStateName"))).Text; ddlcountryName.SelectedValue = ((Label)(row.FindControl("lblCountryId"))).Text; _stateId = Convert.ToInt32(((Label)(row.FindControl("lblStateId"))).Text); } } else if (e.CommandName == "Del") { var row = ((Control)e.CommandSource).NamingContainer as GridViewRow; if (row != null) { var oState = new States(); var stateId = Convert.ToInt32(((Label)(row.FindControl("lblStateId"))).Text); MasterDataMethods.DeleteState(stateId); FillGrid(); } } }
protected void gvTrash_RowCommand(object sender, GridViewCommandEventArgs e) { int itemIndex = Convert.ToInt32(e.CommandArgument); int itemID = Convert.ToInt32(gvTrash.DataKeys[itemIndex].Value); ContentItem item = Engine.Persister.Get(itemID); if (e.CommandName == "Restore") { try { Trash.Restore(item); this.gvTrash.DataBind(); } catch (N2.Integrity.NameOccupiedException) { cvRestore.IsValid = false; } RegisterRefreshNavigationScript(item); } else if (e.CommandName == "Purge") { if (Trash.TrashContainer != null && Trash.TrashContainer.AsyncTrashPurging) { Engine.Resolve<AsyncTrashPurger>().BeginPurge(item.ID); Response.Redirect(Request.RawUrl.ToUrl().SetQueryParameter("showStatus", "true")); } else Engine.Persister.Delete(item); } else { RegisterRefreshNavigationScript(CurrentItem); } }
protected void gvEmploymentType_RowCommand(object sender, GridViewCommandEventArgs e) { int id = Convert.ToInt32(e.CommandArgument); string cmdName = e.CommandName; if (cmdName.Equals("cmdDelete")) { // Perform Delete Operation TRNEmploymentType type = new TRNEmploymentType(); type.EmployeeTypeID = id; type.ModifiedBy = 1; type.Status = 0; int result = new TRNEmploymentTypeBO().DeleteTrainingAgency(type); LoadEmployemntType(); } if (cmdName.Equals("cmdEdit")) { // Show data to TextBoses and controls DataView dvRecord = new TRNEmploymentTypeBO().GetTrainingAgencyByID(id); if (dvRecord.Count > 0) { lblID.Text = dvRecord.Table.Rows[0]["ID"].ToString(); txtEmploymentType.Text = dvRecord.Table.Rows[0]["EmploymentType"].ToString(); collapse = 0; btnSave.Text = "Update"; } } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { //GridViewRow gvr = (GridViewRow)((Control)e.CommandSource).Parent.Parent User u = (User)Session["UserEntity"]; if (u.RoleId != 4) { Response.Redirect("../Security.aspx"); } purchase s = (purchase)Session["purchaseitem"]; int index=Convert.ToInt32(e.CommandArgument); string k =GridView1.Rows[index].Cells[0].Text; index = Convert.ToInt32(k); DropDownList dp = (DropDownList)GridView1.Rows[0].Cells[0].FindControl("choosesupplier"); string sp = dp.Text; if (e.CommandName == "ChangeSupplier") { pl.changesupplier(index, s.purchaserId, sp,u.UserId); Response.Redirect("Purchaseitems.aspx"); }; if (e.CommandName == "DeleteItem") { pl.delete(index, s.supplierId, s.purchaserId); Response.Redirect("Purchaseitems.aspx"); } }
protected void GridView_stuff_list_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Del_Btn") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = GridView_stuff_list.Rows[index]; TableCell SID = selectedRow.Cells[0]; Session["SID"] = SID.Text; string ConnectionString = @"DATA SOURCE=127.0.0.1:1521/XE;PERSIST SECURITY INFO=True;USER ID=TAHMID; Password=anik"; string cmdQuery = "delete from STUFF where STUFF_ID = '" +Session["SID"]+"'"; OracleDataAdapter a = new OracleDataAdapter(cmdQuery, ConnectionString); OracleCommandBuilder builder = new OracleCommandBuilder(a); DataSet ds = new DataSet(); a.Fill(ds, "STUFF_delete"); Response.Redirect("stuff_list.aspx"); } else if (e.CommandName == "edit_Btn") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = GridView_stuff_list.Rows[index]; TableCell SID = selectedRow.Cells[0]; Session["U_SID"] = SID.Text; Response.Redirect("edit_stuff.aspx"); } }
protected void uiGridViewCats_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditCat") { MainCat objData = new MainCat(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxEnName.Text = objData.NameEng; uiTextBoxArName.Text = objData.NameAr; uiPanelAllCats.Visible = false; uiPanelEditCat.Visible = true; CurrentMainCat = objData; BindCats(); } else if (e.CommandName == "DeleteCat") { try { MainCat objData = new MainCat(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); CurrentMainCat = null; BindCats(); } catch (Exception ex) { uipanelError.Visible = true; } } }
protected void gvProductVariantAttributeValues_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "UpdateProductVariantAttributeValue") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = gvProductVariantAttributeValues.Rows[index]; HiddenField hfProductVariantAttributeValueId = row.FindControl("hfProductVariantAttributeValueId") as HiddenField; SimpleTextBox txtName = row.FindControl("txtName") as SimpleTextBox; DecimalTextBox txtPriceAdjustment = row.FindControl("txtPriceAdjustment") as DecimalTextBox; DecimalTextBox txtWeightAdjustment = row.FindControl("txtWeightAdjustment") as DecimalTextBox; CheckBox cbIsPreSelected = row.FindControl("cbIsPreSelected") as CheckBox; NumericTextBox txtDisplayOrder = row.FindControl("txtDisplayOrder") as NumericTextBox; int productVariantAttributeValueId = int.Parse(hfProductVariantAttributeValueId.Value); string name = txtName.Text; decimal priceAdjustment = txtPriceAdjustment.Value; decimal weightAdjustment = txtWeightAdjustment.Value; bool isPreSelected = cbIsPreSelected.Checked; int displayOrder = txtDisplayOrder.Value; ProductVariantAttributeValue productVariantAttributeValue = ProductAttributeManager.GetProductVariantAttributeValueById(productVariantAttributeValueId); if (productVariantAttributeValue != null) { productVariantAttributeValue = ProductAttributeManager.UpdateProductVariantAttributeValue(productVariantAttributeValue.ProductVariantAttributeValueId, productVariantAttributeValue.ProductVariantAttributeId, name, priceAdjustment, weightAdjustment, isPreSelected, displayOrder); SaveLocalizableContentGrid(productVariantAttributeValue); } BindData(); } }
protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName != "Page") //Paginação { int iIndice = grdMain.PageIndex * grdMain.PageSize + int.Parse(e.CommandArgument.ToString()); if (e.CommandName == "Alterar") { DataTable lTable = (DataTable)ViewState["WRK_TABLE"]; if (lTable.Rows.Count > 0) { txtDESCCENTES_APRESENTACAO.Text = lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_APRESENTACAO.Name].ToString(); txtDESCCENTES_OBJETIVO.Text = lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_OBJETIVO.Name].ToString(); txtDESCCENTES_CONTATO.Text = lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_CONTATO.Name].ToString(); hidDESCCENTES_ID.Value = lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_ID.Name].ToString(); } } else if (e.CommandName == "Excluir") { DataTable lTable = (DataTable)ViewState["WRK_TABLE"]; InterfaceUpdate(decimal.Parse(lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_ID.Name].ToString()), "I"); } } } catch (Exception err) { (new UnknownException(err)).TratarExcecao(true); } }
protected void property_RowCommand(object sender, GridViewCommandEventArgs e) { // If multiple ButtonField column fields are used, use the // CommandName property to determine if "Insert" button was clicked. if (e.CommandName.Equals("Insert")) { //fetch the values of the new product TextBox city = propertie.FooterRow.FindControl("cityBox") as TextBox; TextBox street = propertie.FooterRow.FindControl("streetBox") as TextBox; TextBox port = propertie.FooterRow.FindControl("portBox") as TextBox; TextBox value = propertie.FooterRow.FindControl("valueBox") as TextBox; //insert the new product InsertProduct(city.Text, street.Text, port.Text, value.Text); //hide the footer propertie.ShowFooter = false; // rebind the data DataBind(); } if (e.CommandName.Equals("Edit")) { } }
protected void grdMessages_RowCommand(object sender, GridViewCommandEventArgs e) { Control control = null; switch (e.CommandName) { case "AddFromFooter": control = grdMessages.FooterRow; break; default: control = grdMessages.Controls[0].Controls[0]; break; } if (control != null) { var textBox = control.FindControl("txtMessage") as TextBox; if (textBox != null) { string message = textBox.Text; var db = new ApplicationDbContext(); db.Messages.Add(new MessageModel() { Message = message, UserId = User.Identity.GetUserId() }); db.SaveChanges(); grdMessages.DataBind(); } } }
private void grdArticleCategories_RowCommand(object sender, GridViewCommandEventArgs e) { int rowIndex = ((GridViewRow) ((Control) e.CommandSource).NamingContainer).RowIndex; int categoryId = (int) this.grdArticleCategories.DataKeys[rowIndex].Value; int displaySequence = int.Parse((this.grdArticleCategories.Rows[rowIndex].FindControl("lblDisplaySequence") as Literal).Text); int replaceCategoryId = 0; int replaceDisplaySequence = 0; if (e.CommandName == "Fall") { if (rowIndex < (this.grdArticleCategories.Rows.Count - 1)) { replaceCategoryId = (int) this.grdArticleCategories.DataKeys[rowIndex + 1].Value; replaceDisplaySequence = int.Parse((this.grdArticleCategories.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as Literal).Text); } } else if ((e.CommandName == "Rise") && (rowIndex > 0)) { replaceCategoryId = (int) this.grdArticleCategories.DataKeys[rowIndex - 1].Value; replaceDisplaySequence = int.Parse((this.grdArticleCategories.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as Literal).Text); } if (replaceCategoryId > 0) { SubsiteCommentsHelper.SwapArticleCategorySequence(categoryId, replaceCategoryId, displaySequence, replaceDisplaySequence); this.BindArticleCategory(); } }
protected void listOrders_ItemCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { OrderInfo orderInfo = TradeHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { if (TradeHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); this.ShowMessage("成功的完成了该订单", true); } else { this.ShowMessage("完成订单失败", false); } } if (e.CommandName == "CLOSE_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_CLOSE)) { if (TradeHelper.CloseOrder(orderInfo.OrderId)) { this.BindOrders(); this.ShowMessage("成功的关闭了该订单", true); } else { this.ShowMessage("关闭订单失败", false); } } } }
protected void dgvCart_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "UpdateQuantity": { GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int productID = int.Parse(((Label)row.Cells[0].FindControl("lblProductID")).Text); double productPrice = double.Parse(((Label)row.Cells[0].FindControl("lblProductPrice")).Text); double userPrice = double.Parse(((Label)row.Cells[0].FindControl("lblUserPrice")).Text); int quantity; if (!int.TryParse(((TextBox)row.Cells[0].FindControl("txtQuantity")).Text, out quantity)) { Response.Write("<SCRIPT LANGUAGE='JavaScript'>alert('wrong')</SCRIPT>"); break; } else { CartBL cartBL = new CartBL(); cartBL.UpdateCartProduct(Session["cartID"].ToString(), productID, quantity, productPrice, userPrice); calculateItem(row.RowIndex, userPrice * quantity); calculateTotal(); } break; } } }
protected void Action_gridview_RowCommand(object sender, GridViewCommandEventArgs e) { GridView _gridView = (GridView)sender; GridViewRow row = Action_gridview.SelectedRow; // Get the selected index and the command name string _commandName = e.CommandName; if (_commandName == "DoubleClick") { int id = Int32.Parse(e.CommandArgument.ToString()); try { if (id >= 0) { Response.Redirect("~/Detail/DetailAction2.aspx?id=" + id); //Page.ClientScript.RegisterStartupScript(this.GetType(), "OpenWindow", "window.open('~/Detail/DetailRole2.aspx?id='" + id + ",'_newtab');", true); } } catch { Response.Write(Action_gridview.SelectedIndex + " " + id); } } }
protected void GridInventarioCarros_RowCommand(object sender, GridViewCommandEventArgs e) { List<Carro> lstCarro = new List<Carro>(); if (Session["Carros"] != null) { lstCarro = ((List<Carro>)Session["Carros"]); } string codigo = GridInventarioCarros.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString(); Carro CarroEncontrado = lstCarro.SingleOrDefault(s => s.Codigo == Convert.ToInt32(codigo)); if (e.CommandName == "Editar") { txtNombreMarca.Text = CarroEncontrado.NombreMarca; txtModelo.Text = CarroEncontrado.Modelo.ToString(); } /* if (e.CommandName == "Eliminar") { lstMatri.Remove(MatriculaEncontrada); //int indice = lstFactu.IndexOf(factuEncontrada); //lstFactu.RemoveAt(indice); }*/ GridInventarioCarros.DataSource = lstCarro; GridInventarioCarros.DataKeyNames = new string[] { "Codigo" }; GridInventarioCarros.DataBind(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { String s = GridView1.Rows[Convert.ToInt16(e.CommandArgument)].Cells[1].Text; Session["passing"] = s; // the show entire items for respective row Response.Redirect("HistoryDisbursementListDetails.aspx"); }
private void grdAttribute_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int attributeId = (int)this.grdAttribute.DataKeys[rowIndex].Value; int displaySequence = int.Parse((this.grdAttribute.Rows[rowIndex].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None); int num = 0; int replaceDisplaySequence = 0; if (e.CommandName == "saveAttributeName") { System.Web.UI.WebControls.TextBox textBox = this.grdAttribute.Rows[rowIndex].FindControl("txtAttributeName") as System.Web.UI.WebControls.TextBox; AttributeInfo attribute = ProductTypeHelper.GetAttribute(attributeId); string attributeName = Globals.StripHtmlXmlTags(Globals.StripScriptTags(textBox.Text).Replace("\\", "")); if (string.IsNullOrEmpty(textBox.Text.Trim()) || textBox.Text.Trim().Length > 15) { string str = string.Format("ShowMsg(\"{0}\", {1});", "属性名称限制在1-15个字符以内,不允许包含html字符和\\,系统会自动过滤", "false"); this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ServerMessageScript2", "<script language='JavaScript' defer='defer'>setTimeout(function(){" + str + "},300);</script>"); return; } attribute.AttributeName = attributeName; ProductTypeHelper.UpdateAttributeName(attribute); base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true); } if (e.CommandName == "SetYesOrNo") { AttributeInfo attribute2 = ProductTypeHelper.GetAttribute(attributeId); if (attribute2.IsMultiView) { attribute2.UsageMode = AttributeUseageMode.View; } else { attribute2.UsageMode = AttributeUseageMode.MultiView; } ProductTypeHelper.UpdateAttributeName(attribute2); base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true); } if (e.CommandName == "Fall") { if (rowIndex < this.grdAttribute.Rows.Count - 1) { num = (int)this.grdAttribute.DataKeys[rowIndex + 1].Value; replaceDisplaySequence = int.Parse((this.grdAttribute.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None); } } else { if (e.CommandName == "Rise" && rowIndex > 0) { num = (int)this.grdAttribute.DataKeys[rowIndex - 1].Value; replaceDisplaySequence = int.Parse((this.grdAttribute.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None); } } if (num > 0) { ProductTypeHelper.SwapAttributeSequence(attributeId, num, displaySequence, replaceDisplaySequence); this.BindAttribute(); } }
protected void grdData_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "Unsubscribe") { ExecuteUnsubscribe(e.CommandArgument.ToString()); gridRefresh(); } }
//public event GridViewCommandEventHandler GridviewCommand; protected void GridviewVehiclesLease_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { string serial = null; switch (e.CommandName) { case "EditSerial": serial = Convert.ToString(e.CommandArgument); List <MappingsVehiclesLease.VehiclesLeaseList> results = MappingsVehiclesLease.SelectVehiclesLeaseBySerial(serial); if ((results != null)) { //There should be only 1 row foreach (MappingsVehiclesLease.VehiclesLeaseList item in results) { this.MappingVehiclesLeaseDetails.Serial = item.Serial; this.MappingVehiclesLeaseDetails.Country_Owner = item.Country_Owner; this.MappingVehiclesLeaseDetails.Country_Rent = item.Country_Rent; this.MappingVehiclesLeaseDetails.StartDate = item.StartDate; } SessionHandler.MappingVehiclesLeaseDefaultMode = (int)App.BLL.Mappings.Mode.Edit; SessionHandler.MappingVehiclesLeaseValidationGroup = "VehiclesLeaseEdit"; this.MappingVehiclesLeaseDetails.LoadDetails(); this.MappingVehiclesLeaseDetails.ModalExtenderMapping.Show(); this.UpdatePanelMappingGridview.Update(); } break; case "DeleteSerial": serial = Convert.ToString(e.CommandArgument); int result = MappingsVehiclesLease.DeleteVehicleLease(serial); if (result == 0) { this.GridviewSortingAndPaging(null); this.LabelMessage.Text = Resources.lang.MessageDeleteVehiclesLease; } else if (result == -2) { this.LabelMessage.Text = Resources.lang.DeleteErrorMessageConstraint; } else { this.LabelMessage.Text = Resources.lang.ErrorMessageAdministrator; } this.UpdatePanelMappingGridview.Update(); break; } }
/// <summary> /// Se ejecuta al seleccionar un registro de la grilla. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewCommandEventArgs"/> instance containing the event data.</param> /// <remarks> /// Autor: Iván José Pimienta Serrano - INTERGRUPO\Ipimienta /// FechaDeCreacion: 26/04/2013 /// UltimaModificacionPor: (Nombre del Autor de la modificación - Usuario del dominio) /// FechaDeUltimaModificacion: (dd/MM/yyyy) /// EncargadoSoporte: (Nombre del Autor - Usuario del dominio) /// Descripción: Descripción detallada del metodo, procure especificar todo el metodo aqui /// </remarks> protected void GrvExclusiones_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { RecargarModal(); if (e.CommandName == Global.SELECCIONAR) { var indiceFila = Convert.ToInt32(e.CommandArgument); var identificadorCubrimiento = Convert.ToInt32(grvExclusiones.DataKeys[indiceFila].Value); CheckBox chkEsActivo = (CheckBox)grvExclusiones.Rows[indiceFila].Cells[1].FindControl("chkActivo"); Label lblExclusion = (Label)grvExclusiones.Rows[indiceFila].Cells[2].FindControl("lblIdExclusion"); Label lblTipoProducto = (Label)grvExclusiones.Rows[indiceFila].Cells[3].FindControl("lblIdTipoProducto"); Label lblGrupoProducto = (Label)grvExclusiones.Rows[indiceFila].Cells[5].FindControl("lblIdGrupoProducto"); Label lblProducto = (Label)grvExclusiones.Rows[indiceFila].Cells[7].FindControl("lblIdProducto"); Label lblVenta = (Label)grvExclusiones.Rows[indiceFila].Cells[12].FindControl("lblIdVenta"); Label lblNumeroVenta = (Label)grvExclusiones.Rows[indiceFila].Cells[13].FindControl("lblNumeroVenta"); Label lblManual = (Label)grvExclusiones.Rows[indiceFila].Cells[14].FindControl("lblIdManual"); Paginacion <ExclusionContrato> paginador = new Paginacion <ExclusionContrato>() { LongitudPagina = Properties.Settings.Default.Paginacion_CantidadRegistrosPagina, PaginaActual = 0, Item = new ExclusionContrato() { CodigoEntidad = Settings.Default.General_CodigoEntidad, IndicadorContratoActivo = chkEsActivo.Checked ? (short)1 : (short)0, Id = Convert.ToInt32(lblExclusion.Text), IdTipoProducto = Convert.ToInt16(lblTipoProducto.Text), TipoProducto = new TipoProducto() { IdTipoProducto = Convert.ToInt16(lblTipoProducto.Text), Nombre = grvExclusiones.Rows[indiceFila].Cells[4].Text }, GrupoProducto = new GrupoProducto() { IdGrupo = Convert.ToInt32(lblGrupoProducto.Text), Nombre = Server.HtmlDecode(grvExclusiones.Rows[indiceFila].Cells[6].Text) }, Producto = new Producto() { IdProducto = Convert.ToInt32(lblProducto.Text), Nombre = Server.HtmlDecode(grvExclusiones.Rows[indiceFila].Cells[8].Text) }, Componente = grvExclusiones.Rows[indiceFila].Cells[9].Text, IdManual = Convert.ToInt32(lblManual.Text), VigenciaTarifa = Convert.ToDateTime(grvExclusiones.Rows[indiceFila].Cells[11].Text), IdVenta = Convert.ToInt32(lblVenta.Text), NumeroVenta = Convert.ToInt32(lblNumeroVenta.Text), NombreManual = grvExclusiones.Rows[indiceFila].Cells[10].Text } }; RecargarModal(); ucCrearExclusion.LimpiarCampos(); ucCrearExclusion.CargarTiposdeProducto(); ucCrearExclusion.lblTitulo.Text = Resources.DefinirExclusiones.DefinirExclusiones_Actualizar; ucCrearExclusion.CargarInformacionExclusion(paginador.Item); mltvDE.SetActiveView(vCrearModificarDE); } }
protected void gvwDatos_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { try { int inIndice = Convert.ToInt32(e.CommandArgument); if (e.CommandName.Equals("Editar")) { LblOpcion.Text = "2"; //accede a un contro web dentro de un grid txtidentificacion.Text = ((Label)gvwDatos.Rows[inIndice].FindControl("lblIdentificacion")).Text; txtEmpresa.Text = gvwDatos.Rows[inIndice].Cells[1].Text.Equals(" ") ? string.Empty : gvwDatos.Rows[inIndice].Cells[1].Text; txtPrimerNombre.Text = gvwDatos.Rows[inIndice].Cells[2].Text.Equals(" ") ? string.Empty : gvwDatos.Rows[inIndice].Cells[2].Text; txtSegundoNombre.Text = gvwDatos.Rows[inIndice].Cells[3].Text.Equals(" ") ? string.Empty : gvwDatos.Rows[inIndice].Cells[3].Text; txtPrimerApellido.Text = gvwDatos.Rows[inIndice].Cells[4].Text.Equals(" ") ? string.Empty : gvwDatos.Rows[inIndice].Cells[4].Text; txtSegundoApellido.Text = gvwDatos.Rows[inIndice].Cells[5].Text.Equals(" ") ? string.Empty : gvwDatos.Rows[inIndice].Cells[5].Text; txtDireccion.Text = gvwDatos.Rows[inIndice].Cells[6].Text.Equals(" ") ? string.Empty : gvwDatos.Rows[inIndice].Cells[6].Text; txtTelefono.Text = gvwDatos.Rows[inIndice].Cells[7].Text.Equals(" ") ? string.Empty : gvwDatos.Rows[inIndice].Cells[7].Text; txtCorreo.Text = gvwDatos.Rows[inIndice].Cells[8].Text.Equals(" ") ? string.Empty : gvwDatos.Rows[inIndice].Cells[8].Text; } else if (e.CommandName.Equals("Eliminar")) { LblOpcion.Text = "3"; logica.Models.clsPosiblesClientes obclsPosiblesClientes = new logica.Models.clsPosiblesClientes { inIdentificacion = Convert.ToInt64(((Label)gvwDatos.Rows[inIndice].FindControl("lblIdentificacion")).Text), stEmpresa = string.Empty, stprimerNombre = string.Empty, stSegundoNombre = string.Empty, stprimerApellido = string.Empty, stSegundoApellido = string.Empty, stDireccion = string.Empty, stTelefono = string.Empty, stCorreo = string.Empty, }; Controllers.clsPosiblesClientesController obclsPosiblesClientesController = new Controllers.clsPosiblesClientesController(); ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script> swal('Mensaje','" + obclsPosiblesClientesController.setAdministrarPosiblesClientesController(obclsPosiblesClientes, Convert.ToInt32(LblOpcion.Text)) + "!', 'success') </Script>"); LblOpcion.Text = string.Empty; getPosiblesCliente(); } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script> swal('error!','" + ex.Message + "!', 'error') </Script>"); } }
protected void grid_show_orders_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "show_forms") { int rowIndex = int.Parse(e.CommandArgument.ToString()); OrderId.Value = grid_show_orders.DataKeys[rowIndex]["id"].ToString(); grid_show_order_forms.DataBind(); } }
protected void GridView1_Command(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName.Equals("SelectCustomer")) { string id = e.CommandArgument.ToString(); InitializeBaseInf(id); InitialPage(id); } }
protected void grdAnalMethod_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int AnalIDX = e.CommandArgument.ToString().ConvertOrDefault <int>(); if (e.CommandName == "Deletes") { db_Ref.InsertOrUpdateT_WQX_REF_ANAL_METHOD(AnalIDX, null, null, null, null, false); } }
protected void grdRef_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int RefID = e.CommandArgument.ToString().ConvertOrDefault <int>(); if (e.CommandName == "Deletes") { db_Ref.UpdateT_WQX_REF_DATAByIDX(RefID, null, null, false); } }
protected void grdChar_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { string charName = e.CommandArgument.ToString(); if (e.CommandName == "Deletes") { db_Ref.InsertOrUpdateT_WQX_REF_CHARACTERISTIC(charName, null, null, null, false, null, null); } }
protected void GridAC_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "cmdEdit") { string[] arg = new string[2]; arg = e.CommandArgument.ToString().Split(';'); Response.Redirect("EditMainAC.aspx?acid=" + arg[0] + "&DNo=" + arg[1]); } }
protected void gvwDatos_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { try { int inIndice = Convert.ToInt32(e.CommandArgument); if (e.CommandName.Equals("Editar")) { lblOpcion.Text = "2"; txtIdentificacion.Enabled = false; //ACCEDE A UN CONTROL WEB DENTRO DE UN GRID txtIdentificacion.Text = ((Label)gvwDatos.Rows[inIndice].FindControl("lblIdentificacion")).Text; //ACCEDE A UNA CELDE DENTRO DE UN GRID txtEmpresa.Text = gvwDatos.Rows[inIndice].Cells[1].Text.Replace(" ", ""); txtPrimerNombre.Text = gvwDatos.Rows[inIndice].Cells[2].Text.Replace(" ", ""); txtSegundoNombre.Text = gvwDatos.Rows[inIndice].Cells[3].Text.Replace(" ", ""); txtPrimerApellido.Text = gvwDatos.Rows[inIndice].Cells[4].Text.Replace(" ", ""); txtSegundoApellido.Text = gvwDatos.Rows[inIndice].Cells[5].Text.Replace(" ", ""); txtDirecion.Text = gvwDatos.Rows[inIndice].Cells[6].Text.Replace(" ", ""); txtTelefono.Text = gvwDatos.Rows[inIndice].Cells[7].Text.Replace(" ", ""); txtCorreo.Text = gvwDatos.Rows[inIndice].Cells[8].Text.Replace(" ", ""); } else if (e.CommandName.Equals("Eliminar")) { lblOpcion.Text = "3"; Logica.Models.clsPosiblesClientes obclsPosiblesClientes = new Logica.Models.clsPosiblesClientes { lnIdentificacion = Convert.ToInt64(((Label)gvwDatos.Rows[inIndice].FindControl("lblIdentificacion")).Text), stEmpresa = string.Empty, stPrimerNombre = string.Empty, stSegundoNombre = string.Empty, stPrimerApellido = string.Empty, stSegundoApellido = string.Empty, stDireccion = string.Empty, stTelefono = string.Empty, stCorreo = string.Empty }; Controllers.PosiblesClientesControllers obposiblesClientesControllers = new Controllers.PosiblesClientesControllers(); ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script>swal('Mensaje!', '" + obposiblesClientesControllers.setAdministrarPosiblesClientesController(obclsPosiblesClientes, Convert.ToInt32(lblOpcion.Text)) + "', 'success')</script>"); getPosiblesClientess(); LimpiaCampos(); txtIdentificacion.Enabled = true; } } catch (Exception ex) { Logica.BL.clsGeneral obclsGeneral = new Logica.BL.clsGeneral(); string stError = obclsGeneral.Log(ex.Message.ToString()); ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script>swal('Error!', '" + stError + "', 'error')</script>"); } }
protected void GridView1_Command(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName.Equals("Handle")) { string id = e.CommandArgument.ToString(); string cmd = "<script>winPW('Search.aspx?CustomerID=" + id + "&Onlyview=false','',1000,700)</script>"; ClientScript.RegisterStartupScript(ClientScript.GetType(), "winPW", cmd); } }
protected void Gridview1_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { //HyperLink btnRow = new HyperLink(); //btnRow.Text = "View Details"; //if(btnRow.Enabled) //{ // Response.Redirect("Families_List.aspx"); //} }
protected void grd_OnRowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName != "Sort") { System.Web.UI.WebControls.GridViewCommandEventArgs EventArgument = (System.Web.UI.WebControls.GridViewCommandEventArgs)e; int RowIndexOfEditButtonClicked = int.Parse(EventArgument.CommandArgument.ToString()); int Id = int.Parse(grd.Rows[RowIndexOfEditButtonClicked].Cells[0].Text); Response.Redirect("EditVekalet.aspx?ID=" + Id); } }
protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { if (e.CommandName == "InvoiceShow") { //UcInvoice.InvoiceDetails(e.CommandArgument.ToString()); } } }
protected void gvRestaurantList_RowCommand(Object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int rowIndex = int.Parse(e.CommandArgument.ToString()); String restaurantNum = ((Label)gvRestaurantList.Rows[rowIndex].FindControl("lblRestaurantID")).Text; Session["Restaurant"] = restaurantNum; Response.Redirect(lh.RestaurantMenu); } }
private void grdExpressTemplates_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (e.CommandName == "SetYesOrNo") { System.Web.UI.WebControls.GridViewRow gridViewRow = (System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer; int expressIsUse = (int)this.grdExpressTemplates.DataKeys[gridViewRow.RowIndex].Value; SalesHelper.SetExpressIsUse(expressIsUse); this.BindExpressTemplates(); } }