Ejemplo n.º 1
0
 public ActionResult Index(int?id)
 {
     if (id != null && id != 0)
     {
         Hesabim hesap = db.Hesabims.Where(i => i.ProfilNo == id).SingleOrDefault();
         hesap.AktifMi = false;
         db.SaveChanges();
     }
     return(View());
 }
Ejemplo n.º 2
0
        public ActionResult KayitOl(FormCollection form)
        {
            var    numaraList       = db.Hesabims.ToList().LastOrDefault();
            var    hesapKontrolList = db.Hesabims.ToList();
            string kullaniciAdi     = Request.Form["KullaniciAdi"];
            string email            = Request.Form["email"];
            string password         = Request.Form["password"];
            string image            = Request.Form["image"];
            int    flag             = 0;

            foreach (var kontrol in hesapKontrolList)
            {
                if (kontrol.KullaniciAdi != kullaniciAdi && kontrol.Mail != email)
                {
                    flag = 0;
                }
                else
                {
                    flag = 1;
                    goto Etiket;
                }
            }
Etiket:
            if (flag == 0)
            {
                Hesabim hesap = new Hesabim();
                hesap.KullaniciAdi = kullaniciAdi;
                hesap.Mail         = email;
                hesap.Sifre        = password;
                hesap.ProfilFoto   = "~/images/user.png";
                hesap.AnasayfaNo   = numaraList.AnasayfaNo + 1;
                hesap.ProfilNo     = numaraList.ProfilNo + 1;
                hesap.AktifMi      = false;
                db.Hesabims.Add(hesap);
                db.SaveChanges();
                MessageBox.Show("KAYIT BAŞARILI");
            }
            else if (flag == 1)
            {
                MessageBox.Show("KULLANICI ADINIZ VEYA MAİL ADRESİNİZ DAHA ÖNCE KULLANILMIŞ,KAYIT BAŞARISIZ ");
            }

            return(View());
        }