1
This commit is contained in:
@@ -215,11 +215,31 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var amount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.Amount ?? 0).Sum();
|
||||
var usingAmount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.UsingAmount ?? 0).Sum();
|
||||
var recycleAmount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.RecycleAmount ?? 0).Sum();
|
||||
decimal a = amount - usingAmount + recycleAmount;
|
||||
if (Funs.GetNewDecimal(this.txtAmount.Text.Trim()) > a)
|
||||
{
|
||||
Alert.ShowInTop("焊材库存仅剩"+a.ToString("0.##")+"根,领用数量不能超过库存数量!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
SaveData(false);
|
||||
}
|
||||
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var amount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.Amount ?? 0).Sum();
|
||||
var usingAmount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.UsingAmount ?? 0).Sum();
|
||||
var recycleAmount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.RecycleAmount ?? 0).Sum();
|
||||
decimal a = amount - usingAmount + recycleAmount;
|
||||
if (Funs.GetNewDecimal(this.txtAmount.Text.Trim()) > a)
|
||||
{
|
||||
Alert.ShowInTop("焊材库存仅剩" + a.ToString("0.##") + "根,领用数量不能超过库存数量!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
SaveData(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user