Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("StaffId,IndividualId,DesignationId")] Staffs staffs)
        {
            if (id != staffs.StaffId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(staffs);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StaffsExists(staffs.StaffId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DesignationId"] = new SelectList(_context.Designations, "DesignationId", "DesignationDetails", staffs.DesignationId);
            ViewData["IndividualId"]  = new SelectList(_context.Individuals, "IndividualId", "Address", staffs.IndividualId);
            return(View(staffs));
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("IndividualId,Nicnumber,PassportNumber,FullName,DateofBirth,GenderId,Address")] Individuals individuals)
        {
            if (id != individuals.IndividualId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(individuals);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!IndividualsExists(individuals.IndividualId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GenderId"] = new SelectList(_context.Gender, "GenderId", "Gender1", individuals.GenderId);
            return(View(individuals));
        }
Пример #3
0
        public async Task <IActionResult> Edit(int id, [Bind("DesignationId,DesignationName,DesignationDetails,IsActive")] Designations designations)
        {
            if (id != designations.DesignationId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(designations);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DesignationsExists(designations.DesignationId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(designations));
        }
Пример #4
0
        public async Task <IActionResult> Edit(int id, [Bind("CallId,CallerIndividualId,CallAttendeeId,CallStateId,Date")] Calls calls)
        {
            if (id != calls.CallId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(calls);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CallsExists(calls.CallId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CallAttendeeId"]     = new SelectList(_context.Staffs, "StaffId", "StaffId", calls.CallAttendeeId);
            ViewData["CallStateId"]        = new SelectList(_context.States, "StateId", "Details", calls.CallStateId);
            ViewData["CallerIndividualId"] = new SelectList(_context.Individuals, "IndividualId", "Address", calls.CallerIndividualId);
            return(View(calls));
        }