private void AddLpns(bool toLastLPN = false) { double addedQty = 0; double addedUnits = 0; double qty = 0; double units = 0; double qtyPerPlt = 0; double UnitPerPlt = 0; m_lastItem = Convert.ToInt32(itemLookUpEdit.EditValue); qty = Convert.ToDouble(QtyTextEdit.Text); //units = Convert.ToDouble(UnitsTextEdit.Text); qtyPerPlt = Convert.ToDouble(QtyPerPltTextEdit.Text); //UnitPerPlt = Convert.ToDouble(UnitsPerPltTextEdit.Text); while (!(addedQty >= qty)) { if (qty <= qtyPerPlt) { originalQtyTextEdit.EditValue = qty; newQtyTextEdit.EditValue = qty; } else if ((qty - addedQty) > qtyPerPlt) { originalQtyTextEdit.EditValue = qtyPerPlt; newQtyTextEdit.EditValue = qtyPerPlt; } else { originalQtyTextEdit.EditValue = qty - addedQty; newQtyTextEdit.EditValue = qty - addedQty; } int lpn = LPNLabel.GetNextLPNNumber(7); lpnLookUpEdit.EditValue = lpn; m_lastLPN = lpn; if (SaveRecord(null, false)) { addedQty += double.Parse(newQtyTextEdit.EditValue.ToString()); saveSimpleButton.Tag = null; } LPNTextEdit.Text = lpn.ToString(); } m_lastPalletQty = qtyPerPlt - double.Parse(newQtyTextEdit.EditValue.ToString()); PrepareNewRecord(); LotTextEdit.EditValue = null; ExprationDateEdit.EditValue = null; QtyTextEdit.EditValue = null; //UnitsTextEdit.EditValue = null; QtyPerPltTextEdit.EditValue = null; //UnitsPerPltTextEdit.EditValue = null; BulkEntryChanged(); }
private void AddLpnSimpleButton_Click(object sender, EventArgs e) { if (((int?)itemLookUpEdit.EditValue).HasValue && ((int?)locationLookUpEdit.EditValue).HasValue && !m_newLpn) { int lpn = LPNLabel.GetNextLPNNumber(7); ItemsBLL items = new ItemsBLL(); items.UpdateStock(Session.DefaultSession, Convert.ToInt32(itemLookUpEdit.EditValue), 0, false, Convert.ToInt32(locationLookUpEdit.EditValue), "", lpn); lpnXpView.Reload(); lpnLookUpEdit.EditValue = lpn; FilterLots(); m_newLpn = true; } }