public Watch WatchReceived(string guid, BasicApiValidationForm form)
 {
     if (ModelState.IsValid)
     {
         return(this.ContractService.WatchReceived(guid, form));
     }
     throw new ArgumentException("invalid submission");
 }
        public Watch MaterialsReceived(string guid, BasicApiValidationForm form)
        {
            this.setupWatchContractCall(guid);

            UserInfo vendor = this.ValidateUserWithDualAuthCode(form.UserName, form.DualAuthCode);

            watchContractService.MaterialsReceivedRequestAsync(new MaterialsReceivedFunction()
            {
                VendorAddress = vendor.BlockchainAddress,
                GUID          = GUID,
                GasPrice      = 0
            }).GetAwaiter().GetResult();

            return(GetWatch(guid));
        }
        public Watch WatchReceived(string guid, BasicApiValidationForm form)
        {
            this.setupWatchContractCall(guid);

            UserInfo vendor = this.ValidateUserWithDualAuthCode(form.UserName, form.DualAuthCode);

            watchContractService.WatchReceivedRequestAsync(new WatchReceivedFunction()
            {
                VendorAddress = vendor.BlockchainAddress,
                WatchGUID     = GUID,
                GasPrice      = 0
            }).GetAwaiter().GetResult();

            ShopItem item = this.context.ShopItems.First(s => s.GUID == guid);

            item.isAvailable = true;
            item.isSold      = false;
            this.context.SaveChanges();
            return(GetWatch(guid));
        }