public async Task <IActionResult> PutReport(int id, Report report)
        {
            if (id != report.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 2
0
        public IHttpActionResult PutProduct(int id, Product product)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != product.ID)
            {
                return(BadRequest());
            }

            db.Entry(product).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProductExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IActionResult> PutParameter(int id, Parameter parameter)
        {
            if (id != parameter.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 4
0
        public async Task <IActionResult> PutGrupo(int id, Grupo grupo)
        {
            if (id != grupo.IdGrupo)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutMovie(int id, Movie movie)
        {
            if (id != movie.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutApplicationProgram(int id, ApplicationProgram applicationProgram)
        {
            if (id != applicationProgram.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 7
0
        public async Task <IActionResult> PutInstitucion(int id, Institucion institucion)
        {
            if (id != institucion.IdInstitucion)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutCategoriaSubCategoria(int id, CategoriaSubCategoria categoriaSubCategoria)
        {
            if (id != categoriaSubCategoria.IdCategoriaSubCategoria)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutViewapplicationData(int id, ViewapplicationData viewapplicationData)
        {
            if (id != viewapplicationData.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 10
0
 public ActionResult Edit([Bind(Include = "Branch_id,Branch_name,Branch_Address,Branch_Contact")] Branch branch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(branch).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(branch));
 }
Exemplo n.º 11
0
 public ActionResult Edit([Bind(Include = "user_id,UserName,Password,user_role,status")] Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(users));
 }
Exemplo n.º 12
0
 public ActionResult Edit([Bind(Include = "Teacher_id,Teacher_Name,Teacher_FatherName,Dateofjoin,Branch_id")] Teacher teacher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Branch_id = new SelectList(db.Branch, "Branch_id", "Branch_name", teacher.Branch_id);
     return(View(teacher));
 }
Exemplo n.º 13
0
 public ActionResult Edit(Branch branch_obj)
 {
     db.Entry(branch_obj).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }