//projedeki çalışan kişileri listeleme //public JsonResult ProjeKisiListele() //{ // var sonuc = ProjeIslem.ProjeKisi(); // if (sonuc == 0) // return Json("+"); // else // return Json("-"); //} public JsonResult SureceAtananKisileriCek(SureceAtananKisi sak) { var sonuc = ProjeIslem.SureceAtananKisileriCek(sak, projeDetayId); if (sonuc != null) { return(Json(sonuc)); } else { return(Json("-")); } }
//projede çalışan kişiler //public static int ProjeKisi() //{ // try // { // using (BuyutecDBEntities db = new BuyutecDBEntities()) // { // var kl = (from kkk in db.tblKullanicis // select kkk);// gelecek şart // return 0; // } // } // catch (Exception) // { // return 1; // throw; // } //} public static List <Kullanici> SureceAtananKisileriCek(SureceAtananKisi sak, int projeId) { var kullanicilar = (dynamic)null; try { using (BuyutecDBEntities db = new BuyutecDBEntities()) { if (sak.surec == 1) { var projeSurecKontrol = (from p in db.tblSurecs where p.projeId == projeId && p.surecId == sak.Id select p).SingleOrDefault(); if (projeSurecKontrol != null) { var surecSonuc = (from p in db.tblKullaniciSurecs join k in db.tblKullanicis on p.kullaniciId equals k.kullaniciId where p.surecId == sak.Id select k); if (surecSonuc != null) { kullanicilar = Kullanici.MapData(surecSonuc.ToList()); } } } else if (sak.surec == 2) { var projeAltSurecKontrol = (from p in db.tblAltSurecs where p.altSurecId == sak.Id select new { p.surecId }).SingleOrDefault(); if (projeAltSurecKontrol != null) { var projeSurecKontrol = (from p in db.tblSurecs where p.projeId == projeId && p.surecId == projeAltSurecKontrol.surecId select p).SingleOrDefault(); if (projeSurecKontrol != null) { var altsurecSonuc = (from p in db.tblKullaniciAltSurecs join k in db.tblKullanicis on p.kullaniciId equals k.kullaniciId where p.altSurecId == sak.Id select k); if (altsurecSonuc != null) { kullanicilar = Kullanici.MapData(altsurecSonuc.ToList()); } } } } } return(kullanicilar); } catch { return(null); } }