Ejemplo n.º 1
0
        void DepartmanYukle(int DepartmanId)
        {
            List <SelectListItem> SelectList    = new List <SelectListItem>();
            List <Departman>      DepartmanList = DepartmanRepository.GetList().ToList();

            foreach (var item in DepartmanList)
            {
                bool state = false;
                if (DepartmanId == item.Id)
                {
                    state = true;
                }

                SelectList.Add(new SelectListItem {
                    Text = item.Ad, Value = item.Id.ToString(), Selected = state
                });
            }
            ViewBag.DepartmanID = SelectList;
        }
Ejemplo n.º 2
0
 public ActionResult Listele()
 {
     return(View(DepartmanRepository.GetList().ToList()));
 }