public ActionResult Index(GirisModel model) { using (ServisNoktasi servis = new ServisNoktasi()) { if(ModelState.IsValid) { Yonetici yonetici = new Yonetici(); yonetici.KullaniciAdi = model.KullaniciAdi; yonetici.Sifre = model.Sifre; IslemSonucu sonuc = servis.Yonetici.GirisYap(yonetici); if (!sonuc.BasariliMi) { ModelState.AddModelError("HataliGiris", sonuc.Mesaj); return View(); } string userInfo = String.Format("admin;{0};{1}",yonetici.Id,yonetici.KullaniciAdi); FormsAuthentication.SetAuthCookie(userInfo, true); var routeValues = TempData["yonlendirmeDegerleri"]; if(routeValues!=null) { RouteValueDictionary values = (RouteValueDictionary)routeValues; string action = values["action"].ToString(); string controller = values["controller"].ToString(); return RedirectToAction(action,controller,values); } return RedirectToAction("Index", "YoneticiAnasayfa"); } return View(); } }
public BaseController() { Servis = new ServisNoktasi(); }
public LayoutController() { Servis = new ServisNoktasi(); }