public ActionResult Register()
        {
            TurlerRep rep = new TurlerRep();

            ViewData["Tur"] = rep.GetAll().Where(x => x.TurAdi != "_silindi");
            return(View());
        }
Beispiel #2
0
        public ActionResult BilgilerimiDuzenle(Kullanici kullanici, HttpPostedFileBase Resim)
        {
            TurlerRep rep  = new TurlerRep();
            var       user = rep.GetAllUser().FirstOrDefault(x => x.Id == User.Identity.GetUserId());

            user.Email         = kullanici.Email;
            user.UserName      = kullanici.Email;
            user.GrupAdi       = kullanici.GrupAdi;
            user.GrupUyeleri   = kullanici.GrupUyeleri;
            user.Aciklama      = kullanici.Aciklama;
            user.KurulusTarihi = kullanici.KurulusTarihi;
            user.TurID         = kullanici.TurID;
            user.WebSite       = kullanici.WebSite;
            user.YoutubeLinki  = kullanici.YoutubeLinki;
            if (kullanici.Resim != null)
            {
                user.Resim = FileUpload(Resim);
            }
            else
            {
                user.Resim = user.Resim;
            }

            rep.UpdateUser(user);
            ViewData["Tur"] = rep.GetAll().Where(x => x.TurAdi != "_silindi");
            return(View());
        }
Beispiel #3
0
        public ActionResult BilgilerimiDuzenle()
        {
            TurlerRep rep = new TurlerRep();

            ViewData["Tur"] = rep.GetAll().Where(x => x.TurAdi != "_silindi");
            var user = rep.GetAllUser().FirstOrDefault(x => x.Id == User.Identity.GetUserId());

            return(View(user));
        }
Beispiel #4
0
        // GET: Admin/Admin
        public ActionResult Index()
        {
            TurlerRep rep  = new TurlerRep();
            YorumRep  yRep = new YorumRep();
            BlogRep   bRep = new BlogRep();

            ViewBag.YorumSayisi     = yRep.GetAll().Count.ToString();
            ViewBag.BlogSayisi      = bRep.GetAll().Count.ToString();
            ViewBag.TurSayisi       = rep.GetAll().Count(x => x.TurAdi != "_silindi").ToString();
            ViewBag.KullaniciSayisi = rep.GetAllUser().Count().ToString();
            return(View());
        }
        public async Task <ActionResult> Register(RegisterViewModel model, HttpPostedFileBase Resim)
        {
            if (ModelState.IsValid)
            {
                UserStore <Kullanici>   str = new UserStore <Kullanici>(new MyContext());
                UserManager <Kullanici> mng = new UserManager <Kullanici>(str);


                var user = new Kullanici
                {
                    UserName      = model.Email,
                    Email         = model.Email,
                    GrupAdi       = model.GrupAdi,
                    Aciklama      = model.Aciklama,
                    KurulusTarihi = model.KurulusTarihi,
                    GrupUyeleri   = model.GrupUyeleri,
                    Resim         = FileUpload(Resim),
                    TurID         = model.TurID,
                    YoutubeLinki  = model.YoutubeLinki
                };


                var result = await mng.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    SignInManager <Kullanici, string> smng = new SignInManager <Kullanici, string>(mng, AuthenticationManager);

                    await smng.SignInAsync(user, isPersistent : false, rememberBrowser : false);

                    // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
                    // Send an email with this link
                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

                    return(RedirectToAction("Index", "Home"));
                }
                AddErrors(result);
            }
            TurlerRep rep = new TurlerRep();

            ViewData["Tur"] = rep.GetAll().Where(x => x.TurAdi != "_silindi");
            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Beispiel #6
0
        public ActionResult Index()
        {
            TurlerRep rep = new TurlerRep();

            return(View(rep.GetAll().Where(x => x.TurAdi != "_silindi").ToList()));
        }