Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,KayakTypeId,Name")] Kayak kayak)
        {
            if (id != kayak.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    var currentUser = await GetCurrentUserAsync();

                    kayak.UserId = currentUser.Id;
                    _context.Update(kayak);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KayakExists(kayak.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KayakTypeId"] = new SelectList(_context.KayakTypes, "Id", "Id", kayak.KayakTypeId);
            return(View(kayak));
        }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     cam        = Camera.main;
     cameraPath = (CPC_CameraPath)cam.GetComponent <CPC_CameraPath>();
     StartCoroutine(delayedStart(WaitTime));
     introPlayed   = false;
     introPanEnded = false;
     uiManager     = canvas.GetComponent <UIManager>();
     kayak         = Player.GetComponent <Kayak>();
 }
        public ActionResult YeniKayak(Kayak k)
        {
            if (!ModelState.IsValid)
            {
                return(View("YeniKayak"));
            }

            c.Kayaks.Add(k);
            c.SaveChanges();
            return(RedirectToAction("Kayak"));
        }
        public ActionResult KayakGuncelle(Kayak m)
        {
            var res = c.Kayaks.Find(m.ID);

            res.Baslik     = m.Baslik;
            res.Tarih      = m.Tarih;
            res.Aciklama   = m.Aciklama;
            res.KayakImage = m.KayakImage;
            res.Konum      = m.Konum;
            c.SaveChanges();
            return(RedirectToAction("Kayak"));
        }
Esempio n. 5
0
    IEnumerator ShowFinalCards()
    {
        UIManager uiManager = FindObjectOfType <UIManager>();

        uiManager.ShowFinishCard();
        audioManager.Play("Win", 0.25f);
        yield return(new WaitForSeconds(3));

        Kayak kayak = FindObjectOfType <Kayak>();

        audioManager.Stop(kayak.RiverSound, 2f);
        audioManager.SetBackgroundMusicVolume(0.025f);
        uiManager.ShowFinalCard();
    }
Esempio n. 6
0
        public void Test1(string input, string output)
        {
            var textWriter = new StringWriter();

            Console.SetOut(textWriter);
            var file = File.ReadAllText(input);

            Console.SetIn(new StringReader(file));
            Kayak.MyMain(null);

            var expected = File.ReadAllText(output).Replace("\r\n", "\n");

            if (!expected.EndsWith("\n"))
            {
                expected = expected + "\n";
            }
            var actual = textWriter.ToString().Replace("\r\n", "\n");

            Assert.Equal(expected, actual);
        }
Esempio n. 7
0
        public void OnRequest(HttpRequestHead head, Kayak.IDataProducer body, IHttpResponseDelegate response)
        {
            string[] components = head.Uri.Trim('/').Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);

            if (components.Length <= 1)
            {
                response.OnResponse(HttpErrorResponseHead.Get(), new HttpErrorDataProducer());
                return;
            }

            foreach (IOperation o in this.m_Operations)
            {
                if (o.Handles(components[1].ToLowerInvariant()))
                {
                    o.Handle(components[0], components.Where((value, row) => row >= 2).ToArray(), head, body, response);
                    return;
                }
            }

            // If all else fails..
            response.OnResponse(HttpErrorResponseHead.Get(), new HttpErrorDataProducer());
        }
        public ProductInterfaceGraphType(BootGraphType bootGraphType, BackpackGraphType backpackGraphType, KayakGraphType kayakGraphType)
        {
            Name = "product";

            Field(x => x.Id, type: typeof(GuidGraphType));
            Field(x => x.Description);
            Field(x => x.IntroduceAt);
            Field(x => x.Name).Description("The name of the product.");
            Field(x => x.PhotoUrl);
            Field(x => x.Price);
            Field(x => x.ProductType, type: typeof(ProductTypeGraphType));
            Field(x => x.Rating);
            Field(x => x.Stock);
            Field <ProductOptionEnumGraphType>("option");

            FieldAsync <ListGraphType <ReviewGraphType> >(
                name: "reviews",
                resolve: async context => await context
                .RequestServices.GetRequiredService <IDataLoaderContextAccessor>()
                .Context.GetOrAddCollectionBatchLoader <Guid, Review>(
                    loaderKey: "getLookupByProductIdsAsync",
                    fetchFunc: context.RequestServices
                    .GetRequiredService <IProductService>()
                    .GetLookupReviewsByProductIdsAsync)
                .LoadAsync(context.Source.Id));

            ResolveType = @object =>
            {
                return(@object switch
                {
                    Boot _ => bootGraphType,
                    Backpack _ => backpackGraphType,
                    Kayak _ => kayakGraphType,
                    _ => default
                });
            };
Esempio n. 9
0
 // Use this for initialization
 void Start()
 {
     rigidBody    = GetComponent <Rigidbody>();
     kayak        = GetComponent <Kayak>();
     currentSpeed = 0;
 }
Esempio n. 10
0
 public void OnRequest(HttpRequestHead head, Kayak.IDataProducer body, IHttpResponseDelegate response)
 {
     BufferedConsumer requestConsumer = new BufferedConsumer(bodyStream => RequestReadCompleted(head, bodyStream, response), RequestReadError);
     body.Connect(requestConsumer);
 }