Beispiel #1
0
    public string fnUpdateAmountSql(MaterialStock materialStock)
    {
        MaterialStockTran materialStockTran = new MaterialStockTran();

        materialStockTran.WarehouseId(materialStock.warehouse_id)
        .MaterialId(materialStock.material_id)
        .Description("系統進出貨正常變更")
        .CreateId(materialStock.create_id);

        string sSql = fnInsertSql(materialStockTran);

        sSql +=
            "  UPDATE [dbo].[MNDTmaterial_stock]  " +
            "     SET [amount] = [amount] + " + materialStock.amount + "  " +
            "  WHERE [material_id] = '" + materialStock.material_id + "' " +
            "        AND [warehouse_id] = '" + materialStock.warehouse_id + "'  ";

        return(sSql);
    }
Beispiel #2
0
    public string fnUpdate(MaterialStock materialStock, string sDescription, string sIP)
    {
        MaterialStockTran materialStockTran = new MaterialStockTran();

        materialStockTran.WarehouseId(materialStock.warehouse_id)
        .MaterialId(materialStock.material_id)
        .Description(sDescription)
        .CreateId(materialStock.create_id);

        string sSql = fnInsertSql(materialStockTran);

        sSql +=
            "  UPDATE [dbo].[MNDTmaterial_stock]  " +
            "     SET [amount] = '" + materialStock.amount + "'  " +
            "        ,[safe_amount] =  '" + materialStock.safe_amount + "'  " +
            "  WHERE [material_id] = '" + materialStock.material_id + "' " +
            "        AND [warehouse_id] = '" + materialStock.warehouse_id + "'  ";

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