public ActionResult Index() { List <OnayDTO> Uyeler = new List <OnayDTO>(); foreach (var item in _uyeService.GetAll()) { if (item.OnayliMi == false && item.IsDeleted == false) { if (item.Type) { Uyeler.Add(new OnayDTO { Isim = item.Hasta.Isim, ID = item.ID, OlusturulmaTarihi = item.OlusturulmaTarihi, Soyisim = item.Hasta.Soyisim }); } else { Uyeler.Add(new OnayDTO { Isim = item.Donor.Isim, ID = item.ID, OlusturulmaTarihi = item.OlusturulmaTarihi, Soyisim = item.Donor.Soyisim }); } } } return(View(Uyeler)); }
public static int TotalHasta() { IKernel kernel = new StandardKernel(new YasamIcin.BLL.IoC.Ninject.CustomDALModule()); IUyeService uyeService = kernel.Get <UyeService>(); return(uyeService.GetAll().Where(x => x.Type == true && x.OnayliMi == true).Count()); }
public ActionResult AramaSonuc(ProfilDTO profilDTO) { List <ProfilDTO> Uyeler = new List <ProfilDTO>(); #region foreach //foreach (var item in _uyeService.GetAll()) //{ // if (item.OnayliMi == true) // { // if (profilDTO.Hasta) // { // if (item.Type && item.Hasta.BagisTuru.BagisTipi==profilDTO.BagisTuru) // { // Uyeler.Add(new ProfilDTO // { // Isim = item.Hasta.Isim, // ID = item.ID, // Ulke = item.Hasta.Ulke.UlkeAdi, // BagisTuru = item.Hasta.BagisTuru.BagisTipi, // OlusturulmaTarihi = item.OlusturulmaTarihi, // Hasta = item.Type, // Soyisim = item.Hasta.Soyisim // }); // } // } // if(profilDTO.Donor) // { // if(!item.Type && item.Donor.BagisTuru.BagisTipi == profilDTO.BagisTuru) // { // Uyeler.Add(new ProfilDTO // { // Isim = item.Donor.Isim, // ID = item.ID, // Ulke = item.Donor.Ulke.UlkeAdi, // BagisTuru = item.Donor.BagisTuru.BagisTipi, // OlusturulmaTarihi = item.OlusturulmaTarihi, // Donor = item.Type, // Soyisim = item.Donor.Soyisim // }); // } // } // } //} #endregion var UyeList = _uyeService.GetAll(); ICollection <Uye> tempUyeler = new List <Uye>(); if ((!profilDTO.Donor && !profilDTO.Hasta) || (profilDTO.Donor && profilDTO.Hasta)) { tempUyeler = UyeList; } else if (profilDTO.Donor && !profilDTO.Hasta) { tempUyeler = UyeList.Where(x => x.Type == false).ToList(); } else if (!profilDTO.Donor && profilDTO.Hasta) { tempUyeler = UyeList.Where(x => x.Type == true).ToList(); } if (profilDTO.Ulke != null) { if (profilDTO.Donor && profilDTO.Hasta) { tempUyeler = tempUyeler.Where(x => (x.Donor.Ulke.UlkeAdi == profilDTO.Ulke) || (x.Hasta.Ulke.UlkeAdi == profilDTO.Ulke)).ToList(); } else if (!profilDTO.Donor && profilDTO.Hasta) { tempUyeler = tempUyeler.Where(x => x.Hasta.Ulke.UlkeAdi == profilDTO.Ulke).ToList(); } else if (profilDTO.Donor && !profilDTO.Hasta) { tempUyeler = tempUyeler.Where(x => x.Donor.Ulke.UlkeAdi == profilDTO.Ulke).ToList(); } } if (profilDTO.BagisTuru != null) { tempUyeler = tempUyeler.Where(x => x.Donor.BagisTuru.BagisTipi == profilDTO.BagisTuru || x.Hasta.BagisTuru.BagisTipi == profilDTO.BagisTuru).ToList(); } switch (profilDTO.YayinTarihi) { case "Bugün Yayınlananlar": tempUyeler = tempUyeler.Where(a => a.OlusturulmaTarihi == DateTime.Now).ToList(); break; case "Son 7 Gün": tempUyeler = tempUyeler.Where(a => (DateTime.Now - a.OlusturulmaTarihi).TotalDays <= 7).ToList(); break; } foreach (var item in tempUyeler) { if (item.OnayliMi == true) { if (item.Type) { Uyeler.Add(new ProfilDTO { Isim = item.Hasta.Isim, ID = item.ID, Ulke = item.Hasta.Ulke.UlkeAdi, BagisTuru = item.Hasta.BagisTuru.BagisTipi, OlusturulmaTarihi = item.OlusturulmaTarihi, Hasta = item.Type, Soyisim = item.Hasta.Soyisim }); } if (!item.Type) { Uyeler.Add(new ProfilDTO { Isim = item.Donor.Isim, ID = item.ID, Ulke = item.Donor.Ulke.UlkeAdi, BagisTuru = item.Donor.BagisTuru.BagisTipi, OlusturulmaTarihi = item.OlusturulmaTarihi, Donor = item.Type, Soyisim = item.Donor.Soyisim }); } } } return(View(Uyeler)); }
public ActionResult AdminAnaSayfa() { List <Uye> uyeler = _uyeService.GetAll(); return(View(uyeler)); }
public List <Uye> uyeler() { return(uyeService.GetAll()); }