Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 public bool IsLaterThan(int month, RoughDay roughDay)
 {
     return(this._month > month || this._month == month && this._roughDay >= roughDay);
 }
Esempio n. 3
0
 public bool IsEarlierThan(int month, RoughDay roughDay)
 {
     return(this._month < month || this._month == month && this._roughDay <= roughDay);
 }
Esempio n. 4
0
 public RoughDate(int month, RoughDay roughDay)
 {
     this._month    = month;
     this._roughDay = roughDay;
 }
Esempio n. 5
0
 public SalesPeriod PostponeTheEndOfSelling(int month, RoughDay day)
 {
     return(new SalesPeriod(this._from, new RoughDate(month, day)));
 }
Esempio n. 6
0
 public SalesPeriod StartSellingEarlier(int month, RoughDay day)
 {
     return(new SalesPeriod(new RoughDate(month, day), this._till));
 }
Esempio n. 7
0
 public static SalesPeriod SellInLimitedTime(int fromMonth, RoughDay fromDay, int tillMonth, RoughDay tillDay)
 {
     return(new SalesPeriod(new RoughDate(fromMonth, fromDay), new RoughDate(tillMonth, tillDay)));
 }
Esempio n. 8
0
 public void PostponeTheEndOfSelling(int month, RoughDay day)
 {
     this._salesPeriod = this._salesPeriod.PostponeTheEndOfSelling(month, day);
 }
Esempio n. 9
0
 public void StartSellingEarlier(int month, RoughDay day)
 {
     this._salesPeriod = this._salesPeriod.StartSellingEarlier(month, day);
 }
Esempio n. 10
0
 public void SellInLimitedTime(int fromMonth, RoughDay fromDay, int tillMonth, RoughDay tillDay)
 {
     this._salesPeriod = SalesPeriod.SellInLimitedTime(fromMonth, fromDay, tillMonth, tillDay);
 }