コード例 #1
0
        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());
        }
コード例 #2
0
        public async Task <ActionResult <StoreClose> > PostStoreClose(StoreClose storeClose)
        {
            _context.StoreCloses.Add(storeClose);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetStoreClose", new { id = storeClose.StoreCloseId }, storeClose));
        }
コード例 #3
0
        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());
        }