コード例 #1
0
        // GET: Kullanıcı/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Kullanıcı kullanıcı = kRep.Find(x => x.KullanıcıID == id.Value);

            if (kullanıcı == null)
            {
                return(HttpNotFound());
            }
            return(View(kullanıcı));
        }
コード例 #2
0
        public Kullanici KullaniciYonetim(KayıtView data)
        {
            Kullanici kul = kRep.Find(x => x.KullaniciAdi == data.KullaniciAdi || x.Email == data.Email);

            if (kul != null)
            {
                throw new Exception("Kayıtlı Kullanici adı veya eposta adresi");
            }
            else
            {
                kRep.Insert(new Kullanici()
                {
                    KullaniciAdi = data.KullaniciAdi,
                    Email        = data.Email,
                    Sifre        = data.Sifre,
                    Ad           = data.Ad,
                    Soyad        = data.Soyad,
                    AdminMi      = false
                });
            }
            return(kul);
        }
コード例 #3
0
        public ActionResult Giris(Entity.KullaniciYonetim.GirisView model)
        {
            if (ModelState.IsValid)
            {
                KullaniciRep      kRep = new KullaniciRep();
                Kullanıcı         kul  = kRep.Find(x => x.KullaniciAdi == model.KullaniciAdi);
                KullaniciYonetimi kYon = new KullaniciYonetimi();
                kYon.KullaniciGiris(model);
                Session["kullanici"] = kul;

                return(RedirectToAction("Index"));
            }
            return(View(model));
        }