public string fnUpdateAmountSql(ProductStock productStock)
    {
        ProductStockTran productStockTran = new ProductStockTran();

        productStockTran.WarehouseId(productStock.warehouse_id)
        .ProductId(productStock.product_id)
        .Description("系統進出貨正常變更")
        .CreateId(productStock.create_id);

        string sSql = fnInsertSql(productStockTran);

        sSql +=
            "  UPDATE [dbo].[MNDTproduct_stock]  " +
            "     SET [amount] = [amount] + " + productStock.amount + "  " +
            "  WHERE [product_id] = '" + productStock.product_id + "' " +
            "        AND [warehouse_id] = '" + productStock.warehouse_id + "'  ";

        return(sSql);
    }
    public string fnUpdate(ProductStock productStock, string sDescription, string sIP)
    {
        ProductStockTran productStockTran = new ProductStockTran();

        productStockTran.WarehouseId(productStock.warehouse_id)
        .ProductId(productStock.product_id)
        .Description(sDescription)
        .CreateId(productStock.create_id);

        string sSql = fnInsertSql(productStockTran);

        sSql +=
            "  UPDATE [dbo].[MNDTproduct_stock]  " +
            "     SET [amount] = '" + productStock.amount + "'  " +
            "        ,[safe_amount] =  '" + productStock.safe_amount + "'  " +
            "  WHERE [product_id] = '" + productStock.product_id + "' " +
            "        AND [warehouse_id] = '" + productStock.warehouse_id + "'  ";

        return(PublicApi.fnExecuteSQL(sSql, "MNDT"));
    }