示例#1
0
        public async Task <IActionResult> Create([Bind("userID,name,surname,email,phone_number,password")] Korisnik korisnik)
        {
            if (ModelState.IsValid)
            {
                _context.Add(korisnik);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(korisnik));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("householdID,address,code,description")] Household household)
        {
            if (ModelState.IsValid)
            {
                _context.Add(household);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(household));
        }
        public async Task <IActionResult> Create([Bind("strosekID,month,householdID,amount,paid,description")] Stroski stroski)
        {
            if (ModelState.IsValid)
            {
                _context.Add(stroski);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(stroski));
        }
示例#4
0
        public async Task <IActionResult> Create([Bind("postID,userID,householdID,content,timestamp")] ForumPost forumPost)
        {
            if (ModelState.IsValid)
            {
                _context.Add(forumPost);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(forumPost));
        }
        public async Task <IActionResult> Create([Bind("billID,userID,householdID,content,cost,paid")] Bill bill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bill);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bill));
        }
        public async Task <IActionResult> Create([Bind("itemID,householdID,categoryName,itemName,essential")] Inventory inventory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(inventory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(inventory));
        }
        public async Task <IActionResult> Create([Bind("tenantID,userID,householdID,role")] Tenant tenant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tenant);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tenant));
        }
        public async Task <IActionResult> Create([Bind("choreID,userID,householdID,choredesc,duration,repetition,finished")] Chore chore)
        {
            if (ModelState.IsValid)
            {
                _context.Add(chore);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(chore));
        }
        public async Task <IActionResult> Create([Bind("rentID,month,paid,amount,householdID")] Rent rent)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rent);
                await _context.SaveChangesAsync();

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