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; * } * } */ }
public PozRelHandlowej this[RelacjaHandlowa relacja] { get { return(new PozRelHandlowej() { BaseQuery = GetQuery(Table.BaseQuery.Where(p => p.Relacja.ID == relacja.ID)) }); } }
public PozRelHandlowej this[RelacjaHandlowa relacja, int nadrzednaident] { get { return(new PozRelHandlowej() { BaseQuery = GetQuery(Table.BaseQuery .Where(p => p.Relacja.ID == relacja.ID && p.NadrzednaIdent == nadrzednaident)) }); } }
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); }