private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Equals("") || textBox6.Text.Equals("")) { MessageBox.Show("Kullanıcı Adı ve Şifreyi Giriniz."); } else if (is_exist(textBox1.Text)) { MessageBox.Show("Bu Kullanıcı Adına Sahip Başka Bir Kullanıcı Var."); } else { string isim = textBox1.Text + " " + textBox2.Text; string yapı = "\nuye" + "," + textBox1.Text + "," + textBox6.Text + "," + isim + "," + textBox3.Text + "," + comboBox1.Text + "," + comboBox2.Text + "," + textBox5.Text + "," + textBox4.Text; File.AppendAllText(test.kullanıcı_dat, yapı); Üye yeni_uye = new Üye("uye", textBox1.Text, isim, textBox6.Text); yeni_uye.cinsiyet = comboBox1.Text; yeni_uye.evli = comboBox2.Text; yeni_uye.maas = Convert.ToInt32(textBox4.Text); yeni_uye.meslek = textBox5.Text; test.tum_kullan.Add(yeni_uye); this.Close(); ana_sayfa.Hide(); } }
public ActionResult OturumAç(UyeModel model, string returnUrl) { Üye üye = db.Üye.Where(h => h.KullaniciAdi == model.KullaniciAdi && h.Sifre == model.Sifre).SingleOrDefault(); if (üye != null) { Session["UyeOturum"] = true; Session["UyeId"] = üye.UyeId; Session["UyeAdi"] = üye.KullaniciAdi; Session["UyeSifre"] = üye.Sifre; Session["UyeAdmin"] = üye.UyeAdmin; Session["UyeFoto"] = üye.Foto; if (returnUrl == null) { return(RedirectToAction("Index")); } else { return(Redirect(returnUrl)); } } else { ViewBag.HataMesajı = "Kullanıcı Adı veya Paralosı Geçersizdir!"; return(View()); } }
public ActionResult RenewForm(int Id, Üye Model) { using (var db = new Entities()) { var _üye = db.Üyeler.Find(Id); _üye.Şifre = Model.Şifre.GenerateMD5Hex(); db.SaveChanges(); } return(RedirectToAction("Index", "Home")); }
public ActionResult ÜyeOl(UyeModel model) { var sn = db.Üye.Where(h => h.KullaniciAdi == model.KullaniciAdi).ToList(); if (sn.Count() > 0) { ViewBag.KayıtHata = "Girilen Kullanıcı Adı Kayıtlıdır"; return(View()); } Üye yeniüye = new Üye(); if (model.Foto != null && model.Foto.ContentLength > 0) { string uzanti = Path.GetExtension(model.Foto.FileName).ToLower(); string dosya = Guid.NewGuid().ToString(); if (uzanti != ".jpg" && uzanti != ".jpeg" && uzanti != ".png") { ModelState.AddModelError("Foto", "Dosya uzantısı JPG,JPEG veya PNG Olmalıdır!"); return(View()); } string dosyaAdi = dosya + uzanti; model.Foto.SaveAs(Server.MapPath("~/Content/ÜyeFoto/" + dosyaAdi)); yeniüye.AdSoyad = model.AdSoyad; yeniüye.Email = model.Email; yeniüye.KullaniciAdi = model.KullaniciAdi; yeniüye.Sifre = model.Sifre; yeniüye.Foto = dosyaAdi; yeniüye.UyeId = new Guid(); } db.Üye.Add(yeniüye); db.SaveChanges(); Üye üye = db.Üye.OrderByDescending(a => a.UyeId).FirstOrDefault(); Session["UyeOturum"] = true; Session["UyeId"] = üye.UyeId; Session["UyeAdi"] = üye.KullaniciAdi; Session["UyeSifre"] = üye.Sifre; Session["UyeAdmin"] = üye.UyeAdmin; Session[",0"] = üye.Foto; return(RedirectToAction("Index")); }
public ActionResult Register(Üye Model) { int lastId = 0; using (var db = new Entities()) { Model.ÜyelikTarihi = DateTime.Now; Model.EPostaDoğrulama = false; Model.Şifre = Model.Şifre.GenerateMD5Hex(); db.Üyeler.Add(Model); db.SaveChanges(); lastId = db.Üyeler.Where(p => p.EPosta == Model.EPosta).SingleOrDefault().Id; } string key = (lastId.ToString() + ConfigurationManager.AppSettings["securitySalt"]).GenerateMD5Hex(); string link = ConfigurationManager.AppSettings["siteUrl"] + Url.Action("Validate", "Member") + "?id=" + lastId + "&key=" + key; MessageHelper.SendMessage(Model.EPosta, "EPosta Doğrulama Mesajı", string.Format(System.IO.File.ReadAllText(Server.MapPath("~/Content/ValidationMessage.html")), Model.İsim, link)); return(RedirectToAction("RegisterSuccess")); }
public ActionResult RenewForm(int Id, Üye Model) { using (var db = new Entities()) { var _üye = db.Üyeler.Find(Id); _üye.Şifre = Model.Şifre.GenerateMD5Hex(); db.SaveChanges(); } return RedirectToAction("Index", "Home"); }
public ActionResult Register(Üye Model) { int lastId = 0; using (var db = new Entities()) { Model.ÜyelikTarihi = DateTime.Now; Model.EPostaDoğrulama = false; Model.Şifre = Model.Şifre.GenerateMD5Hex(); db.Üyeler.Add(Model); db.SaveChanges(); lastId = db.Üyeler.Where(p => p.EPosta == Model.EPosta).SingleOrDefault().Id; } string key = (lastId.ToString() + ConfigurationManager.AppSettings["securitySalt"]).GenerateMD5Hex(); string link = ConfigurationManager.AppSettings["siteUrl"] + Url.Action("Validate", "Member") + "?id=" + lastId + "&key=" + key; MessageHelper.SendMessage(Model.EPosta, "EPosta Doğrulama Mesajı", string.Format(System.IO.File.ReadAllText(Server.MapPath("~/Content/ValidationMessage.html")), Model.İsim, link)); return RedirectToAction("RegisterSuccess"); }
public IActionResult YeniÜye(Üye ü) { c.üyes.Add(ü); c.SaveChanges(); return(RedirectToAction("YeniÜye")); }