コード例 #1
0
        // GET: Home
        public ActionResult Index()
        {
            EvrimSevinc_BTEntities entity = new EvrimSevinc_BTEntities();

            ViewBag.BlogType = entity.BlogTypes.ToList();
            return(View(from blg in entity.Blogs.ToList() select blg));
        }
コード例 #2
0
        public ActionResult Login(UserAuthorize model, string returnurl)
        {
            EvrimSevinc_BTEntities entity = new EvrimSevinc_BTEntities();

            if (ModelState.IsValid)
            {
                if (entity.Users.FirstOrDefault(a => a.EMail == model.EMail && a.Password == model.Password) != null)
                {
                    Session["sessionName"] = "admin";
                    return(RedirectToAction("Index", "ControlPanel"));
                }

                else
                {
                    ModelState.AddModelError("", "EMail veya şifre hatalı!");
                }
            }
            return(View(model));
        }