private void Restore(RelacjaHandlowa rn, PozycjaDokHandlowego pb, ref IlośćWartość w, ref Quantity m) { throw new NotImplementedException("Enova.Handel.KontrolerRelacji.Restore(...)"); /* * foreach (PozycjaDokHandlowego handlowego in rn.Nadrzedny.Pozycje) * { * IlośćWartość wartość; * Quantity quantity; * PozycjaRelacjiHandlowej handlowej; * if (((handlowego.Towar == pb.Towar) && w.Ilość.IsPlus) && (m.IsPlus && this.Check(out quantity, out wartość, out handlowej, rn, handlowego, pb))) * { * if (handlowej == null) * { * handlowej = new PozycjaRelacjiHandlowej(rn, handlowego, pb, true); * this.Module.PozRelHandlowej.AddRow(handlowej); * } * IlośćWartość iw = (w.Ilość > wartość.Ilość) ? wartość : w; * Quantity im = (m > quantity) ? quantity : m; * iw = handlowego.IlośćWartość.Proporcja(iw.Ilość); * handlowej.Ustaw(iw, im, false); * w -= w.Proporcja(iw.Ilość); * m -= im; * } * } */ }
private void Restore() { while (this.ShouldRestore) { PozycjaDokHandlowego pb = this._restore.Dequeue(); IlośćWartość w = new IlośćWartość(pb.Ilosc, pb.WartoscCy); Quantity iloscMagazynu = pb.IloscMagazynu; int index = -1; while ((w.Ilość.IsPlus && iloscMagazynu.IsPlus) && (++index < this._relations.Length)) { this.Restore(this._relations[index], pb, ref w, ref iloscMagazynu); } } }
public static bool Equals(object iw1, object iw2) { if ((iw1 == null) && (iw2 == null)) { return(true); } if (iw1 == null) { IlośćWartość wartość = (IlośćWartość)iw2; return(wartość.IsZeroWithValue); } if (iw2 == null) { IlośćWartość wartość2 = (IlośćWartość)iw1; return(wartość2.IsZeroWithValue); } return(((IlośćWartość)iw1) == ((IlośćWartość)iw2)); }
private bool Check(out Quantity mp, out IlośćWartość wp, out PozycjaRelacjiHandlowej pozr, RelacjaHandlowa rn, PozycjaDokHandlowego pn, PozycjaDokHandlowego pb) { pozr = null; mp = pn.IloscMagazynu; wp = pn.IlośćWartość; foreach (PozycjaRelacjiHandlowej handlowej in this.Module.PozRelHandlowej.WgNadrzednyDok[pn.Dokument, pn.Ident]) { if (handlowej.Podrzedna == pb) { pozr = handlowej; } else if (handlowej.Relacja.Typ == rn.Typ) { mp -= handlowej.IloscMagazynu; wp -= handlowej.IlośćWartość; } } return(mp.IsPlus); }
static IlośćWartość() { Zero = new IlośćWartość(Quantity.Zero, Currency.Empty); SystemZero = new IlośćWartość(Quantity.Zero, new Currency(0M, Currency.SystemSymbol)); }