public async Task <IActionResult> PutStoreClose(int id, StoreClose storeClose) { if (id != storeClose.StoreCloseId) { return(BadRequest()); } _context.Entry(storeClose).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StoreCloseExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <StoreClose> > PostStoreClose(StoreClose storeClose) { _context.StoreCloses.Add(storeClose); await _context.SaveChangesAsync(); return(CreatedAtAction("GetStoreClose", new { id = storeClose.StoreCloseId }, storeClose)); }
public static async System.Threading.Tasks.Task <int> AddStoreCloseAsync(eStoreDbContext db, int StoreId) { StoreClose sc = new StoreClose { IsReadOnly = true, StoreId = StoreId, UserId = "Admin", Remarks = "", ClosingDate = DateTime.Now }; //TODO: there should be store opening and Closing Date; //TODO: need to check system and brower type to verify for malpractice. await db.StoreCloses.AddAsync(sc); return(await db.SaveChangesAsync()); }