This commit is contained in:
2025-11-12 09:39:12 +08:00
parent 1906687242
commit b2d7264768
2 changed files with 57 additions and 1 deletions
@@ -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);
}