public ActionResult Add() { if (Session["Id"] != null) { var result = PersonTypeRepo.GetAll(); return(View(result)); } else { return(RedirectToAction("Index")); } }
public ActionResult AddType(PersonType model) { bool state = PersonTypeRepo.Add(model); if (state) { ViewBag.MessageTrue = model.Name + " Eklendi!"; } else { ViewBag.MessageFalse = model.Name + " Kayıtlı!"; } return(View()); }