protected void gvProductSpecificationAttributes_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "UpdateProductSpecificationAttribute") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = gvProductSpecificationAttributes.Rows[index]; HiddenField hfProductSpecificationAttributeID = row.FindControl("hfProductSpecificationAttributeID") as HiddenField; Literal lblSpecificationAttributeName = row.FindControl("lblSpecificationAttributeName") as Literal; DropDownList ddlSpecificationAttributeOption = row.FindControl("ddlSpecificationAttributeOption") as DropDownList; CheckBox chkAllowFiltering = row.FindControl("chkAllowFiltering") as CheckBox; CheckBox chkShowOnProductPage = row.FindControl("chkShowOnProductPage") as CheckBox; NumericTextBox txtProductSpecificationAttributeDisplayOrder = row.FindControl("txtProductSpecificationAttributeDisplayOrder") as NumericTextBox; int productSpecificationAttributeID = int.Parse(hfProductSpecificationAttributeID.Value); int saoID = int.Parse(ddlSpecificationAttributeOption.SelectedItem.Value); int displayOrder = txtProductSpecificationAttributeDisplayOrder.Value; ProductSpecificationAttribute productSpecificationAttribute = SpecificationAttributeManager.GetProductSpecificationAttributeByID(productSpecificationAttributeID); if (productSpecificationAttribute != null) { SpecificationAttributeManager.UpdateProductSpecificationAttribute( productSpecificationAttribute.ProductSpecificationAttributeID, productSpecificationAttribute.ProductID, saoID, chkAllowFiltering.Checked, chkShowOnProductPage.Checked, displayOrder); } BindData(); } }
protected void gvProductSpecificationAttributes_RowDeleting(object sender, GridViewDeleteEventArgs e) { int productSpecificationAttributeID = (int)gvProductSpecificationAttributes.DataKeys[e.RowIndex]["ProductSpecificationAttributeID"]; ProductSpecificationAttribute productSpecificationAttribute = SpecificationAttributeManager.GetProductSpecificationAttributeByID(productSpecificationAttributeID); if (productSpecificationAttribute != null) { SpecificationAttributeManager.DeleteProductSpecificationAttribute(productSpecificationAttribute.ProductSpecificationAttributeID); BindData(); } }