// GET: Home public ActionResult Index() { List <Calisan> liste = repository.GetList().ToList(); return(View(new CalisanViewModel { CalisanList = liste })); }
public ActionResult Edit() { int ID = Convert.ToInt32(RouteData.Values["id"]); Calisan c = CalisanRepository.FirstOrDefault(x => x.Id == ID); List <Calisan> liste = CalisanRepository.GetList().ToList(); DepartmanYukle(c.DepartmanId); YoneticiYukle((Int32)c.YoneticiBilgisiId); return(View(c)); }
void YoneticiYukle(int CalisanId) { List <SelectListItem> SelectList = new List <SelectListItem>(); List <Calisan> CalisanList = CalisanRepository.GetList().ToList(); foreach (var item in CalisanList) { bool state = false; if (CalisanId == item.Id) { state = true; } SelectList.Add(new SelectListItem { Text = item.Ad + " " + item.Soyad, Value = item.Id.ToString(), Selected = state }); } ViewBag.Yoneticiler = SelectList; }
// GET: Admin/Calisan public ActionResult Listele() { return(View(CalisanRepository.GetList())); }