public async Task <IActionResult> PutGctype([FromRoute] int id, [FromBody] Gctype gctype) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != gctype.Id) { return(BadRequest()); } _context.Entry(gctype).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GctypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutOutlet([FromRoute] int id, [FromBody] Outlet outlet) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != outlet.Id) { return(BadRequest()); } outlet.ModifiedDate = DateTime.Now; outlet.LastModifiedBy = "leila"; _context.Entry(outlet).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OutletExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAspNetUsers([FromRoute] string id, [FromBody] AspNetUsers aspNetUsers) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != aspNetUsers.Id) { return(BadRequest()); } _context.Entry(aspNetUsers).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AspNetUsersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create([Bind("Id,LastModifiedBy,CreatedDate,ModifiedDate,Name")] ServicesType servicesType) { if (ModelState.IsValid) { _context.Add(servicesType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(servicesType)); }
public async Task <IActionResult> Create([Bind("Id,Name,LastModifiedBy,CreatedDate,ModifiedDate")] Outlet outlet) { if (ModelState.IsValid) { _context.Add(outlet); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(outlet)); }
public async Task <IActionResult> Create([Bind("Id,AccessFailedCount,ConcurrencyStamp,Email,EmailConfirmed,LockoutEnabled,LockoutEnd,NormalizedEmail,NormalizedUserName,PasswordHash,PhoneNumber,PhoneNumberConfirmed,SecurityStamp,TwoFactorEnabled,UserName")] AspNetUsers aspNetUsers) { if (ModelState.IsValid) { _context.Add(aspNetUsers); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(aspNetUsers)); }
public async Task <IActionResult> Create([Bind("Id,GiftCertificateId,RedemptionDate,LastModifiedBy,CreatedDate,ModifiedDate")] Gcredemption gcredemption) { if (ModelState.IsValid) { _context.Add(gcredemption); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GiftCertificateId"] = new SelectList(_context.GiftCertificate, "Id", "Id", gcredemption.GiftCertificateId); return(View(gcredemption)); }
public async Task <IActionResult> Create([Bind("Id,GcTypeId,Value,IssuanceDate,DtipermitNo,ExpirationDate,LastModifiedBy,CreatedDate,ModifiedDate,Qrcode,Active")] GiftCert GiftCert) { if (ModelState.IsValid) { _context.Add(GiftCert); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GcTypeId"] = new SelectList(_context.GcType, "Id", "Id", GiftCert.GcTypeId); return(View(GiftCert)); }