Example #1
0
        public ActionResult UpdateLine(LineVm line)
        {
            if (!ModelState.IsValid)
            {
                SetStationsViewBag();
                return(View(line));
            }

            var lineSer = new LineService();

            lineSer.UpdateLine(line);

            return(RedirectToAction("Index"));
        }
Example #2
0
        // PUT api/<controller>/5
        public IHttpActionResult Put(Line line)
        {
            IHttpActionResult result  = null;
            LineService       service = new LineService();

            if (service.GetLine(line.Id) != null)
            {
                service.UpdateLine(line);
                result = Ok(line);
            }
            else
            {
                result = NotFound();
            }

            return(result);
        }
        public LineVM Put(LineVM updateLine)
        {
            var result = _lineService.UpdateLine(updateLine);

            return(result);
        }