Example #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));
 }
Example #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));
 }
Example #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));
 }
Example #4
0
 public ActionResult DeleteConfirmed(long id)
 {
     Model.Model.Person person = _PersonService.GetById(id);
     _PersonService.Delete(person);
     return(RedirectToAction("Index"));
 }