Exemple #1
0
    protected void bt_Adjust_Click(object sender, EventArgs e)
    {
        int warehouse = 0;

        int.TryParse(ddl_WareHouse.SelectedValue, out warehouse);

        string ids = "";

        foreach (GridViewRow row in gv_List.Rows)
        {
            long     id  = (long)gv_List.DataKeys[row.RowIndex]["ID"];
            CheckBox cbx = (CheckBox)row.FindControl("cbx");
            if (cbx != null && cbx.Checked)
            {
                ids += id.ToString() + ",";
            }
        }
        if (ids.EndsWith(","))
        {
            ids = ids.Substring(0, ids.Length - 1);
        }
        if (warehouse == 0)
        {
            MessageBox.Show(this, "请指定要调整库存的仓库!");
            return;
        }
        if (ids == "")
        {
            MessageBox.Show(this, "请打勾选中要调整库存的产品!");
            return;
        }

        int deliveryid = PBM_DeliveryBLL.AdjustInit(warehouse, (int)Session["UserID"], ids);

        if (deliveryid > 0)
        {
            Response.Redirect("InventoryAdjustDetail.aspx?ID=" + deliveryid.ToString());
        }
    }
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        int warehouse = 0;

        int.TryParse(ddl_SupplierWareHouse.SelectedValue, out warehouse);

        if (warehouse == 0)
        {
            MessageBox.Show(this, "请正确选择供货出库仓库!");
            return;
        }

        int id = PBM_DeliveryBLL.AdjustInit(warehouse, (int)Session["UserID"]);

        if (id < 0)
        {
            MessageBox.Show(this, "创建盘点单失败!RET=" + id.ToString());
            return;
        }

        Response.Redirect("InventoryAdjustDetail.aspx?ID=" + id.ToString());
    }