コード例 #1
0
        public ActionResult InsertDeliveryAsync()
        {
            var inserting = new DeliveryMethod();

            if (TryUpdateModel(inserting))
            {
                Repository.Data.Save(inserting);
            }

            return GetDeliveriesAsync();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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;
        }
コード例 #4
0
ファイル: OrderModel.cs プロジェクト: andriybilas/MasterM
 public OrderModel()
 {
     OrderRows = new List<CartModel>();
     DeliveryMethod = new DeliveryMethod();
 }