コード例 #1
0
        /// <summary>
        /// Attempts to add the item based on id and date. In case of an invalid item a prompt is displayed
        /// </summary>
        /// <param name="id">Id of the item</param>
        /// <param name="date">Expiry date</param>
        private void AddItem(long id, DateTime date)
        {
            ProductBase prodB = db.GetProduct(id);

            if (prodB == null)
            {
                MessageBox.Show("The specified product does not exist");
            }
            else
            {
                Product prod = new Product(prodB, date);
                AddItem(prod);
            }
        }
コード例 #2
0
 public Product(ProductBase p, int daysUntilExpiry) : this(p, DateTime.Today.AddDays(daysUntilExpiry))
 {
 }
コード例 #3
0
 public Product(ProductBase p, DateTime expiryDate) : this(p.Id, p.ImageName, p.Label, p.Category, p.IsDiary, p.Limit, p.Price, p.Facing, expiryDate)
 {
 }
コード例 #4
0
 /// <summary>
 /// Creates a copy of the ProductBase
 /// </summary>
 /// <param name="p">The object to be copied</param>
 public ProductBase(ProductBase p) : this(p.Id, p.ImageName, p.Label, p.Category, p.IsDiary, p.Limit, p.Price, p.Facing)
 {
 }