Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("userID,name,surname,email,phone_number,password")] Korisnik korisnik)
        {
            if (id != korisnik.userID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(korisnik);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KorisnikExists(korisnik.userID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(korisnik));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("householdID,address,code,description")] Household household)
        {
            if (id != household.householdID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(household);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HouseholdExists(household.householdID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(household));
        }
        public async Task <IActionResult> Edit(int id, [Bind("strosekID,month,householdID,amount,paid,description")] Stroski stroski)
        {
            if (id != stroski.strosekID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stroski);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StroskiExists(stroski.strosekID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(stroski));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("postID,userID,householdID,content,timestamp")] ForumPost forumPost)
        {
            if (id != forumPost.postID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(forumPost);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ForumPostExists(forumPost.postID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(forumPost));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("billID,userID,householdID,content,cost,paid")] Bill bill)
        {
            if (id != bill.billID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bill);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BillExists(bill.billID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bill));
        }
        public async Task <IActionResult> Edit(int id, [Bind("itemID,householdID,categoryName,itemName,essential")] Inventory inventory)
        {
            if (id != inventory.itemID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(inventory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InventoryExists(inventory.itemID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(inventory));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Edit(int id, [Bind("tenantID,userID,householdID,role")] Tenant tenant)
        {
            if (id != tenant.tenantID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tenant);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TenantExists(tenant.tenantID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tenant));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> Edit(int id, [Bind("choreID,userID,householdID,choredesc,duration,repetition,finished")] Chore chore)
        {
            if (id != chore.choreID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(chore);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChoreExists(chore.choreID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(chore));
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> Edit(int id, [Bind("rentID,month,paid,amount,householdID")] Rent rent)
        {
            if (id != rent.rentID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rent);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RentExists(rent.rentID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(rent));
        }