public ActionResult InsertDeliveryAsync() { var inserting = new DeliveryMethod(); if (TryUpdateModel(inserting)) { Repository.Data.Save(inserting); } return GetDeliveriesAsync(); }
public ActionResult UpdateDeliveryAsync() { var edited = new DeliveryMethod(); if (TryUpdateModel(edited)) { var current = Repository.Data.Get<DeliveryMethod>(edited.Id); current.Name = edited.Name; current.Cost = edited.Cost; current.Description = edited.Description; Repository.Data.Save(current); } return GetDeliveriesAsync(); }
public DeliveryMethod DeliveryMethodSaveTest() { var deliveryMethod = new DeliveryMethod { Name = "DeliveryMethod1", Description = "Description1", Cost = 12.05m }; Repository.Data.Save(deliveryMethod); Assert.True(deliveryMethod.Id != Guid.Empty); return deliveryMethod; }
public OrderModel() { OrderRows = new List<CartModel>(); DeliveryMethod = new DeliveryMethod(); }