Exemple #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;
 }
Exemple #2
0
 public bool IsLaterThan(int month, RoughDay roughDay)
 {
     return(this._month > month || this._month == month && this._roughDay >= roughDay);
 }
Exemple #3
0
 public bool IsEarlierThan(int month, RoughDay roughDay)
 {
     return(this._month < month || this._month == month && this._roughDay <= roughDay);
 }
Exemple #4
0
 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)));
 }
Exemple #8
0
 public void PostponeTheEndOfSelling(int month, RoughDay day)
 {
     this._salesPeriod = this._salesPeriod.PostponeTheEndOfSelling(month, day);
 }
Exemple #9
0
 public void StartSellingEarlier(int month, RoughDay day)
 {
     this._salesPeriod = this._salesPeriod.StartSellingEarlier(month, day);
 }
Exemple #10
0
 public void SellInLimitedTime(int fromMonth, RoughDay fromDay, int tillMonth, RoughDay tillDay)
 {
     this._salesPeriod = SalesPeriod.SellInLimitedTime(fromMonth, fromDay, tillMonth, tillDay);
 }