Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,GameId,PersonId,PersonId1,PersonId2,PersonId3,FeeHD1,AlowenceHD1,TravelDistanceHD1,TravelCostHD1,LateMatchStartHD1,TotalPaymentHD1,FeeHD2,AlowenceHD2,TravelDistanceHD2,TravelCostHD2,LateMatchStartHD2,TotalPaymentHD2,FeeLD1,AlowenceLD1,TravelDistanceLD1,TravelCostLD1,LateMatchStartLD1,TotalPaymentLD1,FeeLD2,AlowenceLD2,TravelDistanceLD2,TravelCostLD2,LateMatchStartLD2,TotalPaymentLD2")] PaymentPost paymentPost)
        {
            if (id != paymentPost.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(paymentPost);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaymentPostExists(paymentPost.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GameId"]    = new SelectList(_context.Game, "Id", "GameName", paymentPost.GameId);
            ViewData["PersonId"]  = new SelectList(_context.Person, "Id", "FullName", paymentPost.PersonId);
            ViewData["PersonId1"] = new SelectList(_context.Person, "Id", "FullName", paymentPost.PersonId1);
            ViewData["PersonId2"] = new SelectList(_context.Person, "Id", "FullName", paymentPost.PersonId2);
            ViewData["PersonId3"] = new SelectList(_context.Person, "Id", "FullName", paymentPost.PersonId3);
            return(View(paymentPost));
        }
        public ActionResult DeleteConfirmed(string id)
        {
            PaymentPost paymentPost = db.PaymentPosts.Find(id);

            db.PaymentPosts.Remove(paymentPost);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "IdPaymentPost,Payment")] PaymentPost paymentPost)
 {
     if (ModelState.IsValid)
     {
         db.Entry(paymentPost).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(paymentPost));
 }
        public ActionResult Create([Bind(Include = "IdPaymentPost,Payment")] PaymentPost paymentPost)
        {
            if (ModelState.IsValid)
            {
                db.PaymentPosts.Add(paymentPost);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(paymentPost));
        }
        // GET: PaymentPosts/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PaymentPost paymentPost = db.PaymentPosts.Find(id);

            if (paymentPost == null)
            {
                return(HttpNotFound());
            }
            return(View(paymentPost));
        }
Example #6
0
        public async Task <IActionResult> Create([Bind("Id,GameId,PersonId,PersonId1,PersonId2,PersonId3,FeeHD1,AlowenceHD1,TravelDistanceHD1,TravelCostHD1,LateMatchStartHD1,TotalPaymentHD1,FeeHD2,AlowenceHD2,TravelDistanceHD2,TravelCostHD2,LateMatchStartHD2,TotalPaymentHD2,FeeLD1,AlowenceLD1,TravelDistanceLD1,TravelCostLD1,LateMatchStartLD1,TotalPaymentLD1,FeeLD2,AlowenceLD2,TravelDistanceLD2,TravelCostLD2,LateMatchStartLD2,TotalPaymentLD2")] PaymentPost paymentPost)
        {
            if (ModelState.IsValid)
            {
                _context.Add(paymentPost);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GameId"]    = new SelectList(_context.Game, "Id", "GameName", paymentPost.GameId);
            ViewData["PersonId"]  = new SelectList(_context.Person, "Id", "FullName", paymentPost.PersonId);
            ViewData["PersonId1"] = new SelectList(_context.Person, "Id", "FullName", paymentPost.PersonId1);
            ViewData["PersonId2"] = new SelectList(_context.Person, "Id", "FullName", paymentPost.PersonId2);
            ViewData["PersonId3"] = new SelectList(_context.Person, "Id", "FullName", paymentPost.PersonId3);
            return(View(paymentPost));
        }