public TrainingProductViewModel()
 {
     EventCommand        = ViewModels.EventCommand.List.ToString();
     IsSearchAreaVisible = true;
     IsListAreaVisible   = true;
     IsValid             = true;
     Mode = "List";
     ProductForCreation = new TrainingProduct
     {
         ProductName      = "",
         Price            = 0,
         IntroductionDate = DateTime.Today,
         Url = ""
     };
 }
Esempio n. 2
0
        public void Update(TrainingProduct product)
        {
            var entry = db.Entry(product);

            entry.State = EntityState.Modified;

            /*
             *      var r = Get(product.ProductId);
             *      r.ProductName = product.ProductName;
             *      r.Price = product.Price;
             *      r.IntroductionDate = product.IntroductionDate;
             *      r.Url = product.Url;
             */

            db.SaveChanges();
        }
Esempio n. 3
0
 public void Add(TrainingProduct product)
 {
     db.TrainingProducts.Add(product);
     db.SaveChanges();
 }