Exemplo n.º 1
0
        public async Task <IActionResult> PutAgency(int id, Agency agency)
        {
            if (id != agency.id)
            {
                return(BadRequest());
            }

            _context.Entry(agency).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();

                Notification.sendNotification("Agency Detail has Updated", "Agency ID: " + agency.id);

                return(CreatedAtAction("DeletData", new { id = agency.id }, agency));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AgencyExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutUser([FromRoute] int id, [FromBody] User user)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != user.Id)
            {
                return(BadRequest());
            }

            _context.Entry(user).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 public ActionResult Edit(Applicant applicant)
 {
     if (ModelState.IsValid)
     {
         db.Entry(applicant).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(applicant));
 }
 public ActionResult Edit(Technology technology)
 {
     if (ModelState.IsValid)
     {
         db.Entry(technology).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(technology));
 }
 public ActionResult Edit([Bind(Include = "Id,Title,Description,StartDate,EndDate,Photo,Status")] About about)
 {
     if (ModelState.IsValid)
     {
         db.Entry(about).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(about));
 }
Exemplo n.º 6
0
 public ActionResult Edit([Bind(Include = "Id,Name,Photo,Ordering,Status")] Partner partner)
 {
     if (ModelState.IsValid)
     {
         db.Entry(partner).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(partner));
 }
 public ActionResult Edit([Bind(Include = "Id,ProjectName,SmallTitle,Photo,BigPhoto,Description,Date,Client,CategoryId,Status")] Portfolio portfolio)
 {
     if (ModelState.IsValid)
     {
         db.Entry(portfolio).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name", portfolio.CategoryId);
     return(View(portfolio));
 }
Exemplo n.º 8
0
 public void Update(Advertising book)
 {
     db.Entry(book).State = EntityState.Modified;
 }
Exemplo n.º 9
0
 public void Update(Order order)
 {
     db.Entry(order).State = EntityState.Modified;
 }