public Description(Product product) { this.Id = product._id.IdString; this.Name = product._name; this.CostRate = product._costRate; this.Price = product._price; this.IngredientsTable = product._ingredientsTable.ToDictionary(x => x.Key.IdString, x => x.Value); this.IsSellingYearRound = SalesPeriod.SellYearRound().SameValueAs(product._salesPeriod); this.SellingFromMonth = product._salesPeriod.From.Month; this.SellingFromDay = product._salesPeriod.From.RoughDay; this.SellingTillMonth = product._salesPeriod.Till.Month; this.SellingTillDay = product._salesPeriod.Till.RoughDay; }
public bool IsLaterThan(int month, RoughDay roughDay) { return(this._month > month || this._month == month && this._roughDay >= roughDay); }
public bool IsEarlierThan(int month, RoughDay roughDay) { return(this._month < month || this._month == month && this._roughDay <= roughDay); }
public RoughDate(int month, RoughDay roughDay) { this._month = month; this._roughDay = roughDay; }
public SalesPeriod PostponeTheEndOfSelling(int month, RoughDay day) { return(new SalesPeriod(this._from, new RoughDate(month, day))); }
public SalesPeriod StartSellingEarlier(int month, RoughDay day) { return(new SalesPeriod(new RoughDate(month, day), this._till)); }
public static SalesPeriod SellInLimitedTime(int fromMonth, RoughDay fromDay, int tillMonth, RoughDay tillDay) { return(new SalesPeriod(new RoughDate(fromMonth, fromDay), new RoughDate(tillMonth, tillDay))); }
public void PostponeTheEndOfSelling(int month, RoughDay day) { this._salesPeriod = this._salesPeriod.PostponeTheEndOfSelling(month, day); }
public void StartSellingEarlier(int month, RoughDay day) { this._salesPeriod = this._salesPeriod.StartSellingEarlier(month, day); }
public void SellInLimitedTime(int fromMonth, RoughDay fromDay, int tillMonth, RoughDay tillDay) { this._salesPeriod = SalesPeriod.SellInLimitedTime(fromMonth, fromDay, tillMonth, tillDay); }