本文整理汇总了C#中DataClasses1DataContext.CalcMRP方法的典型用法代码示例。如果您正苦于以下问题:C# DataClasses1DataContext.CalcMRP方法的具体用法?C# DataClasses1DataContext.CalcMRP怎么用?C# DataClasses1DataContext.CalcMRP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataClasses1DataContext
的用法示例。
在下文中一共展示了DataClasses1DataContext.CalcMRP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: calcButton_Click
private void calcButton_Click(object sender, EventArgs e)
{
try
{
//Get input data from text boxes
int minStock = Convert.ToInt32(minStockBox.Text);
int maxStock = Convert.ToInt32(maxStockBox.Text);
int day = Convert.ToInt32(daysBox.Text);
int endDay = Convert.ToInt32(endDayBox.Text);
//testing of input data
if (minStock < 0 || maxStock < 0 || endDay < 1 || day < 1 || maxStock <= minStock)
throw new Exception("Invalid data");
//Calc Purchase table and parse function return
DataClasses1DataContext dc = new DataClasses1DataContext();
switch (dc.CalcMRP(1, endDay, minStock, day, maxStock))
{
case 1:
throw new Exception("StOck overflow");
case 2:
throw new Exception("Very little stock");
}
this.purchaseTableAdapter.Fill(this.assyPartDS.Purchase);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}