// GET: Ogretmen public ActionResult Index() { Kullanicilar kullanicilar = (Kullanicilar)Session["Kullanici"]; Ogretmenler ogretmen = kullaniciManager.Find(x => x.ID == kullanicilar.ID).Ogretmenler; return(View(ogretmen)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } KanBanKullanici kanBanKullanici = km.Find(x => x.Id == id.Value); if (kanBanKullanici == null) { return(HttpNotFound()); } return(View(kanBanKullanici)); }
public ActionResult Profilim(int id, string ad, string soyad, string eposta, string ogrencinumarasi, string sifre) { Kullanicilar kullanici = kullaniciManager.Find(x => x.Ogrenciler.ID == id); if (kullanici != null) { if (ad != "") { kullanici.Ogrenciler.OgrenciAdi = ad; } if (soyad != "") { kullanici.Ogrenciler.OgrenciSoyadi = soyad; } if (eposta != "") { kullanici.EPosta = eposta; } if (sifre != "") { kullanici.Sifre = sifre; } if (ogrencinumarasi != "") { kullanici.Ogrenciler.OgrenciNumarasi = ogrencinumarasi; } kullaniciManager.Update(kullanici); TempData["mesaj"] = "Kullanıcı Bilgileri Güncellendi"; Session["Kullanici"] = kullanici; return(View()); } TempData["mesaj"] = "Kullanıcı Bilgileri Bulunamadı"; return(View()); }
public PartialViewResult OgretmenDerslerveOdevler() { Kullanicilar kullanicilar = (Kullanicilar)Session["Kullanici"]; Ogretmenler ogretmen = kullaniciManager.Find(x => x.ID == kullanicilar.ID).Ogretmenler; return(PartialView("~/Views/Ogretmen/_DersTablosuPartial.cshtml", ogretmen)); }
public JsonResult YetkiliMesaj(Mesajlasma mesaj) { if (mesaj.Yanit == null) { return(Json("Mesaj Gönderilemedi lütfen boş yer bırakmyın.", JsonRequestBehavior.AllowGet)); } else { Ortak123 o = Session["loginy"] as Ortak123; int kullaniciid1 = Convert.ToInt32(TempData["gönderilenkullanici"]); Kullanicilar kk = k.Find(x => x.Id == kullaniciid1); Mesajlasma m = new Mesajlasma(); m.Yanit = mesaj.Yanit; m.GondermeTarihi = DateTime.Now; m.GonderenKullanici = kk; m.AlanKullanici = o.Adi + " " + o.Soyadi; m.Okundumu = true; m.Kokudumu = false; m_manager.Insert(m); return(Json("Mesajınınz başarıyla gönderildi.", JsonRequestBehavior.AllowGet)); } }
public IHttpActionResult Giris(LoginModel loginModel) { if (loginModel.kullaniciadi != null && loginModel.sifre != null) { try { Kullanicilar kul = kullaniciManager.Find(x => x.KullaniciAdi == loginModel.kullaniciadi && x.Sifre == loginModel.sifre); if (kul != null) { return(Ok(kul)); } else { return(BadRequest("Hatalı Kullanıcı Adı veya Şifre")); } } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } return(BadRequest("Sunucuyla bağlantı kurulamadı")); } } else { return(BadRequest("Eksik Bilgi Girişi")); } }
public ActionResult PesonelIslemKullanicisi(SifirSatilanAraba model) { int idsi = Convert.ToInt32(TempData["araba"]); YeniArabalar car = yenia.Find(x => x.Arabaid.Id == idsi); Yoneticiler y = Session["loginy"] as Yoneticiler; Kullanicilar ku = kma.Find(x => x.Tc == model.SatilanKullanici.Tc); if (ku == null) { ErrorViewModel notifyonj = new ErrorViewModel() { Title = "Kullanıcı Tc'si hatalı böyle bir kullanıcı bulunamadı..", RedirectingUrl = "/Home/PesonelIslemKullanicisi" }; return(View("Error", notifyonj)); } SifirSatilanAraba yenisat = new SifirSatilanAraba(); yenisat.SifirArabalar = car; yenisat.SatilanKullanici = ku; yenisat.SatilmaTarih = DateTime.Now; yenisat.SatilmaUcret = model.SatilmaUcret; yenisat.SatanPersonel = y.Adi + " " + y.Adres; sifirsatilan.Insert(yenisat); try { Arabalar aa = a.Find(x => x.Id == car.Arabaid.Id); aa.IslemYapabilme = false; a.Update(aa); SifirSatilmayanArabalar satilma = satilmayanaraba.Find(x => x.SatilmayanAraba.Id == car.Id); satilmayanaraba.Delete(satilma); car.Durum = OtoGaleri_Entities.IkincielEnums.Durum.Satildi; yenia.Update(car); Gelirler gelir = new Gelirler(); gelir.Araba = aa; gelir.ArabaninDurumu = aa.Durum; gelir.Kullanici = ku; gelir.Tarih = DateTime.Now; gelir.Personel = yenisat.SatanPersonel; //sifir satılmış personelden çektik ilerde deişiklik yapabilirim... gelir.Fiyat = yenisat.SatilmaUcret; gelirmanager.Insert(gelir); OkViewModel notifyobj = new OkViewModel() { Title = "Güncelleme Başarılı", RedirectingUrl = "/Home/Index", }; notifyobj.Items.Add("Satış işleminiz başarılı bir şekilde gerçekleşmiştir."); return(View("Ok", notifyobj)); } catch (Exception) { ErrorViewModel notifyonj = new ErrorViewModel() { Title = "Hata Oluştu.", }; return(View("Error", notifyonj)); } }
public ActionResult KayitOl(string ad, string soyad, HttpPostedFileBase profilFotografi, string sifretekrari, string eposta, string sifre, string kullaniciadi, string kayitturu, string ogrenciNumarasi) { Kullanicilar tempKullanici = kullaniciManager.Find(x => x.EPosta == eposta || x.KullaniciAdi == kullaniciadi || x.Ogrenciler.OgrenciNumarasi == ogrenciNumarasi); if (tempKullanici == null) { if (ad != null && soyad != null && sifretekrari != null && eposta != null && sifre != null && kullaniciadi != null) { if (sifre == sifretekrari) { try { string fotograf = ""; kullanici = new Kullanicilar(); kullanici.KullaniciAdi = kullaniciadi; kullanici.Sifre = sifre; kullanici.EPosta = eposta; if (kayitturu == "1") { ogrenci = new Ogrenciler(); ogrenci.OgrenciAdi = ad; ogrenci.OgrenciSoyadi = soyad; ogrenci.OgrenciNumarasi = ogrenciNumarasi; kullanici.Yetki = yetkiManager.Find(x => x.YetkiAdi == "Ogrenci"); if (profilFotografi != null) { string yeniResimAdi = ""; ResimIslem r = new ResimIslem(); yeniResimAdi = r.Ekle(profilFotografi); //yeniResimAdi = new ResimIslem().Ekle(resimGelen); if (yeniResimAdi == "uzanti") { ViewData["Hata"] = "Lütfen .png veya .jpg uzantılı dosya giriniz."; } else if (yeniResimAdi == "boyut") { ViewData["Hata"] = "En fazla 1MB boyutunda dosya girebilirsiniz."; } else { fotograf = yeniResimAdi; } ogrenci.OgrenciFotografi = fotograf; kullanici.Ogrenciler = ogrenci; } } if (kayitturu == "2") { ogretmen = new Ogretmenler(); ogretmen.OgretmenAdi = ad; ogretmen.OgretmenSoyadi = soyad; kullanici.Yetki = yetkiManager.Find(x => x.YetkiAdi == "Ogretmen"); if (profilFotografi != null) { string yeniResimAdi = ""; ResimIslemOgretmen r = new ResimIslemOgretmen(); yeniResimAdi = r.Ekle(profilFotografi); //yeniResimAdi = new ResimIslem().Ekle(resimGelen); if (yeniResimAdi == "uzanti") { ViewData["Hata"] = "Lütfen .png veya .jpg uzantılı dosya giriniz."; } else if (yeniResimAdi == "boyut") { ViewData["Hata"] = "En fazla 1MB boyutunda dosya girebilirsiniz."; } else { fotograf = yeniResimAdi; } ogretmen.OgretmenFotografi = fotograf; kullanici.Ogretmenler = ogretmen; } } using (var client = new HttpClient()) { var jsonformatter = new JsonMediaTypeFormatter(); jsonformatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; client.BaseAddress = new Uri("http://localhost:64663/api/LoginApi/Kayit"); var postTask = client.PostAsync("Kayit", kullanici, jsonformatter); postTask.Wait(); var result = postTask.Result; if (result.IsSuccessStatusCode) { TempData["mesaj"] = "Kayıt işlemi başarılı bir şekilde tamamlandı."; return(RedirectToAction("Index", "Login")); } else { TempData["mesaj"] = "Hatalı Bilgi Girişi"; return(RedirectToAction("Index", "Login")); } } } catch (DbEntityValidationException e) { TempData["mesaj"] = "Sunucuyla bağlantı kurulamadı."; } } return(RedirectToAction("Index", "Login")); } TempData["mesaj"] = "Eksik Bilgi Girişi"; } else { TempData["mesaj"] = "Kullanıcı Sistemle Kayıtlı Tekrar Deneyin"; } return(RedirectToAction("Index", "Login")); }