private void grdOrderItems_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
            string skuId = e.CommandArgument.ToString();

            if (e.CommandName == "UPDATE_ITEMS")
            {
                PurchaseOrderInfo purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(this.purchaseOrderId);
                if (purchaseOrder.PurchaseOrderItems.Count <= 1)
                {
                    this.ShowMsg("采购单的最后一件商品不允许删除", false);
                    return;
                }
                SubsiteSalesHelper.DeletePurchaseOrderItem(this.purchaseOrderId, skuId);
            }
            else
            {
                if (e.CommandName == "UPDATE_QUANTITY")
                {
                    int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex;
                    System.Web.UI.WebControls.TextBox textBox = (System.Web.UI.WebControls.TextBox) this.grdOrderItems.Rows[rowIndex].Cells[3].FindControl("txtItemNumber");
                    int num;
                    if (!int.TryParse(textBox.Text.Trim(), out num))
                    {
                        this.ShowMsg("商品数量填写错误", false);
                        return;
                    }
                    int skuStock = SubsiteSalesHelper.GetSkuStock(skuId);
                    if (num > skuStock)
                    {
                        this.ShowMsg("此商品库存不够", false);
                        return;
                    }
                    if (num <= 0)
                    {
                        this.ShowMsg("商品购买数量不能小于等于0", false);
                        return;
                    }
                    SubsiteSalesHelper.UpdatePurchaseOrderItemQuantity(this.purchaseOrderId, skuId, num);
                }
            }
            this.UpdatePurchaseOrder();
            this.BindOrderItems();
            this.ShowMsg("商品数量更新成功!", true);
            Pager arg_13A_0 = this.pager1;

            this.pager.TotalRecords = 0;
            arg_13A_0.TotalRecords  = 0;
            this.grdAuthorizeProducts.DataSource = null;
            this.grdAuthorizeProducts.DataBind();
        }
        private void grdOrderItems_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string skuId = e.CommandArgument.ToString();

            if (e.CommandName == "UPDATE_ITEMS")
            {
                if (SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId).PurchaseOrderItems.Count <= 1)
                {
                    ShowMsg("采购单的最后一件商品不允许删除", false);
                    return;
                }
                SubsiteSalesHelper.DeletePurchaseOrderItem(purchaseOrderId, skuId);
            }
            else if (e.CommandName == "UPDATE_QUANTITY")
            {
                int     num;
                Grid    grid     = (Grid)sender;
                int     rowIndex = ((GridViewRow)((Control)e.CommandSource).NamingContainer).RowIndex;
                TextBox box      = (TextBox)grdOrderItems.Rows[rowIndex].Cells[3].FindControl("txtItemNumber");
                if (!int.TryParse(box.Text.Trim(), out num))
                {
                    ShowMsg("商品数量填写错误", false);
                    return;
                }
                int skuStock = SubsiteSalesHelper.GetSkuStock(skuId);
                if (num > skuStock)
                {
                    ShowMsg("此商品库存不够", false);
                    return;
                }
                if (num <= 0)
                {
                    ShowMsg("商品购买数量不能小于等于0", false);
                    return;
                }
                SubsiteSalesHelper.UpdatePurchaseOrderItemQuantity(purchaseOrderId, skuId, num);
            }
            UpdatePurchaseOrder();
            BindOrderItems();
            ShowMsg("商品数量更新成功!", true);
            pager1.TotalRecords             = pager.TotalRecords = 0;
            grdAuthorizeProducts.DataSource = null;
            grdAuthorizeProducts.DataBind();
        }