private void grdAttributeValues_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { int valueId = (int)this.grdAttributeValues.DataKeys[e.RowIndex].Value; if (ProductTypeHelper.DeleteAttribute(this.attributeId, valueId)) { this.BindData(); } }
private void grdAttributeValues_RowDeleting(object source, GridViewDeleteEventArgs e) { int valueId = (int)grdAttributeValues.DataKeys[e.RowIndex].Value; if (ProductTypeHelper.DeleteAttribute(attributeId, valueId)) { BindData(); } }
private void grdAttribute_RowDeleting(object source, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { int attriubteId = (int)this.grdAttribute.DataKeys[e.RowIndex].Value; if (ProductTypeHelper.DeleteAttribute(attriubteId)) { base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true); return; } this.BindAttribute(); }
private void Delete(HttpContext context) { int value = base.GetIntParam(context, "ids", false).Value; AttributeInfo attribute = ProductTypeHelper.GetAttribute(value); if (ProductTypeHelper.DeleteAttribute(value)) { base.ReturnSuccessResult(context, "删除成功!", 0, true); return; } throw new HidistroAshxException("有商品在使用此规格,无法删除,不允许包含脚本标签和\\\\(反斜杠),系统会自动过滤"); }
private void grdSKU_RowDeleting(object source, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { int num = (int)this.grdSKU.DataKeys[e.RowIndex].Value; AttributeInfo attribute = ProductTypeHelper.GetAttribute(num); if (ProductTypeHelper.DeleteAttribute(num)) { foreach (AttributeValueInfo current in attribute.AttributeValues) { StoreHelper.DeleteImage(current.ImageUrl); } base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true); return; } this.BindAttribute(); string str = string.Format("ShowMsg(\"{0}\", {1});", "有商品在使用此规格,无法删除", "false"); this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ServerMessageScript2", "<script language='JavaScript' defer='defer'>setTimeout(function(){" + str + "},300);</script>"); }
/// <summary> /// 行删除 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void grdSKU_RowDeleting(object source, GridViewDeleteEventArgs e) { int attributeId = (int)grdSKU.DataKeys[e.RowIndex].Value; AttributeInfo attribute = ProductTypeHelper.GetAttribute(attributeId); if (ProductTypeHelper.DeleteAttribute(attributeId)) { foreach (AttributeValueInfo info2 in attribute.AttributeValues) { StoreHelper.DeleteImage(info2.ImageUrl); } base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true); } else { BindAttribute(); string str = string.Format("ShowMsg(\"{0}\", {1});", "有商品在使用此规格,无法删除", "false"); Page.ClientScript.RegisterStartupScript(base.GetType(), "ServerMessageScript2", "<script language='JavaScript' defer='defer'>setTimeout(function(){" + str + "},300);</script>"); } }