private void BindDetailsPurchaseOrder() { BLL.PurchaseOrderDetails PoD = new PurchaseOrderDetails(); PoD.getPurchaseDetails(getQueryString_PurchaseOrder); grdPurchaseOrderDetails.DataSource = PoD.DefaultView; grdPurchaseOrderDetails.DataBind(); }
protected void GrdViewPurchaseOrders_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "editGeneralOrder") { int ID = int.Parse(e.CommandArgument.ToString()); Response.Redirect("PurchaseOrder.aspx?PurchaseOrderID=" + ID.ToString()); } else if (e.CommandName == "deleteGeneralOrder") { BLL.PurchaseOrder purdel = new BLL.PurchaseOrder(); PurchaseOrderDetails Purddel = new PurchaseOrderDetails(); purdel.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString())); Purddel.getPurchaseDetails(int.Parse(e.CommandArgument.ToString())); Purddel.DeleteAll(); Purddel.Save(); purdel.MarkAsDeleted(); purdel.Save(); } BindGeneralPurchaseOrder(); }