protected void dlSKU_ItemCommand(object sender, DataListCommandEventArgs e) { int skuId = (int)dlSkuList.DataKeys[e.Item.ItemIndex]; switch (e.CommandName) { case "Delete": SKUDAL.RemoveSku(Sku.objectName, skuId); BindSkuList(1, true); break; case "Edit": Response.Redirect("SKUItem.aspx?skuid=" + skuId); break; case "Copy": new SkuManager().CopySku(skuId); BindSkuList(1, true); break; } }
protected void dlSKU_ItemCommand(object sender, DataListCommandEventArgs e) { int skuId = (int)dlSkuList.DataKeys[e.Item.ItemIndex]; int pageNum = 1; switch (e.CommandName) { case "Delete": SKUDAL.RemoveSku(Sku.objectName, skuId); if (ViewState["PageNo"] != null) { pageNum = (int)ViewState["PageNo"]; } BindSkuList(pageNum, true); lblSuccess.Visible = false; lblCancel.Visible = true; break; case "Edit": Response.Redirect("SKUItem.aspx?skuid=" + skuId); break; case "Copy": new SkuManager().CopySku(skuId); //int pageNum=1; if (ViewState["PageNo"] != null) { pageNum = (int)ViewState["PageNo"]; } BindSkuList(pageNum, true); lblSuccess.Visible = true; lblCancel.Visible = false; break; } }