Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Phone,Address,State,CountryId")] Model.Model.Person person)
 {
     if (ModelState.IsValid)
     {
         _PersonService.Update(person);
         return(RedirectToAction("Index"));
     }
     ViewBag.CountryId = new SelectList(_CountryService.GetAll(), "Id", "Name", person.CountryId);
     return(View(person));
 }
Exemplo n.º 2
0
 // GET: /Person/Delete/5
 public ActionResult Delete(long?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     Model.Model.Person person = _PersonService.GetById(id.Value);
     if (person == null)
     {
         return(HttpNotFound());
     }
     return(View(person));
 }
Exemplo n.º 3
0
 // GET: /Person/Edit/5
 public ActionResult Edit(long?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     Model.Model.Person person = _PersonService.GetById(id.Value);
     if (person == null)
     {
         return(HttpNotFound());
     }
     ViewBag.CountryId = new SelectList(_CountryService.GetAll(), "Id", "Name", person.CountryId);
     return(View(person));
 }
Exemplo n.º 4
0
 public ActionResult DeleteConfirmed(long id)
 {
     Model.Model.Person person = _PersonService.GetById(id);
     _PersonService.Delete(person);
     return(RedirectToAction("Index"));
 }