我正在设计一个销售点应用程序,该应用程序从阵列中读取库存水平,如果库存水平足够,则接受预订。
当按下应用程序上的退出按钮时,应保存新的库存量。
这是我用于数组的代码,我有一个临时库存数组,以便如果取消订单,库存可以恢复为原始值。
readonly static int[,] Stock =
{
{23,4,6,8,12,12,8,4,0,3,6,9 },
{3,4,5,6,45,8,5,2,7,8,9,10 },
{32,7,10,13,34,19,12,5,4,6,8,10 },
{12,13,11,12,23,12,4,7,10,8,6,4 },
{6,2,4,2,4,6,3,4,5,6,7,8 }
};
//Create an Array for temporary Stock
readonly static int[,] TempStock =
{
{23,4,6,8,12,12,8,4,0,3,6,9 },
{3,4,5,6,45,8,5,2,7,8,9,10 },
{32,7,10,13,34,19,12,5,4,6,8,10 },
{12,13,11,12,23,12,4,7,10,8,6,4 },
{6,2,4,2,4,6,3,4,5,6,7,8 }
};
库存水平也位于excel文件中。从中而不是从阵列中读取库存水平会更容易吗?