コード例 #1
0
        public async Task <IActionResult> Create([Bind("PaymentTypeId,DateCreated,AccNum,UserId")] PaymentType paymentType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(paymentType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(paymentType));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("CategoryId,Title")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("CheckId,UserId,OpenTime,Closed,PaymentTypeId,Room")] Check check)
        {
            if (ModelState.IsValid)
            {
                _context.Add(check);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(check));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("ItemId,Title,Quantity,CategoryId,ImagePath")] Item item)
        {
            if (ModelState.IsValid)
            {
                _context.Add(item);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(item));
        }
コード例 #5
0
        public async Task <IActionResult> Create([Bind("ChecklistId,Runner,Completed,TimeCreated")] CheckList checkList)
        {
            if (ModelState.IsValid)
            {
                _context.Add(checkList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(checkList));
        }