public async Task <IActionResult> Edit(int id, [Bind("Id,CustomerName,Phone,Adress,Email,Deleted")] Customer customer)
        {
            if (id != customer.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerExists(customer.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Exemple #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,BusinessName,Time,Status,Explanation,TaskExplanation,StartDate,EndDate,CreatorPersonel,CreationDate,PersonelId,Deleted,CustomerId,ProjectDescriptionId,BusinessPriority,StatusId,IsApproved,LastDateStudied")] BusinessList businessList)
        {
            if (id != businessList.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(businessList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BusinessListExists(businessList.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(businessList));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Email,Mission,Phone,Adress,UserName,Password,Deleted")] Personel personel)
        {
            if (id != personel.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(personel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonelExists(personel.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(personel));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,StartTime,FinishTime,Area,PersonelId,Deleted,WorkConfirmation,Explanation")] Work work)
        {
            if (id != work.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(work);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WorkExists(work.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PersonelId"] = new SelectList(_context.Personel, "Id", "Adress", work.PersonelId);
            return(View(work));
        }
Exemple #5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ProjectName,CustomerId,Deleted")] ProjectDescription projectDescription)
        {
            if (id != projectDescription.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(projectDescription);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProjectDescriptionExists(projectDescription.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerId"] = new SelectList(_context.Customer, "Id", "Adress", projectDescription.CustomerId);
            return(View(projectDescription));
        }
Exemple #6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CreateUser,PersonelId,Explanation,UpdateDate,UpdateUser,Status,BusinessId,Deleted,CreateDate,StartTime,EndTime,Time,EndDate,StatusId,TotalTime")] Activity activity)
        {
            if (id != activity.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(activity);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ActivityExists(activity.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BusinessId"] = new SelectList(_context.BusinessList, "Id", "BusinessName", activity.BusinessId);
            return(View(activity));
        }