Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,GiftCertId,PurchaseDate,LastModifiedBy,CreatedDate,ModifiedDate,Active,Remarks,PaymentMode,CcNumber,ExpirationDate,CardType")] GcPurchase gcPurchase)
        {
            if (id != gcPurchase.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(gcPurchase);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GcPurchaseExists(gcPurchase.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GiftCertNo"] = new SelectList(_context.GiftCert, "GiftCertNo", "GiftCertNo", gcPurchase.GiftCertNo);
            return(View(gcPurchase));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,LastModifiedBy,CreatedDate,ModifiedDate,Name,Active")] GcType gcType)
        {
            if (id != gcType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(gcType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GcTypeExists(gcType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(gcType));
        }
        public async Task <IActionResult> Edit(int id, int giftCertNo, [Bind("Id,Name,LastModifiedBy,CreatedDate,ModifiedDate,Active")] Outlet outlet)
        {
            if (id != outlet.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(outlet);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OutletExists(outlet.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                //   return RedirectToAction(nameof(Index));
                return(RedirectToAction("Edit", "GiftCert", new { id = giftCertNo }));
            }
            return(View(outlet));
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,GcTypeId,Value,IssuanceDate,DtiPermitNo,ExpirationDate,LastModifiedBy,CreatedDate,ModifiedDate,QrCode,Active,GiftCertNo,Note,Status")] GiftCert giftCert)
        {
            if (id != giftCert.GiftCertNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(giftCert);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GiftCertExists(giftCert.GiftCertNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GcTypeId"] = new SelectList(_context.GcType, "Id", "Id", giftCert.GcTypeId);
            return(View(giftCert));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,GiftCertId,RedemptionDate,LastModifiedBy,CreatedDate,ModifiedDate,Active,Remarks")] GcRedemption gcRedemption)
        {
            if (id != gcRedemption.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(gcRedemption);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GcRedemptionExists(gcRedemption.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GiftCertId"] = new SelectList(_context.GiftCert, "Id", "Id", gcRedemption.GiftCertId);
            return(View(gcRedemption));
        }