public bool Add(T entity) { bool Sonuc = false; try { _dbSet.Add(entity); Sonuc = Convert.ToBoolean(_neYapsakContext.SaveChanges()); } catch (Exception ex) { string hata = ex.Message; //throw new Exception("Kayıt yapılamadı!"); } return(Sonuc); }
public ActionResult ConfirmEmail(string userId) { if (userId == null) { return(View("Error")); } var usermanager = IdentityTools.NewUserManager(); ApplicationUser user = new ApplicationUser(); NeYapsakContext ent = new NeYapsakContext(); user = ent.Users.Where(u => u.Id == userId).FirstOrDefault(); if (user != null) { user.EmailConfirmed = true; ent.SaveChanges(); } else { return(View("Error")); } return(View("ConfirmEmail")); }
public async Task <ActionResult> MesajGonder(string AliciId, string GondericiId, string Mesaj) { var usermanager = IdentityTools.NewUserManager(); var Alici = usermanager.FindById(AliciId); var Gonderici = usermanager.FindById(GondericiId); Gorusmeler Gorusme = new Gorusmeler(); Gorusme.AliciId = AliciId; Gorusme.GondericiId = GondericiId; Gorusme.Mesaj = Mesaj; ent.Gorusmeler.Add(Gorusme); await MesajMailiGonder(Gonderici, Alici, Mesaj).ConfigureAwait(false); if (Convert.ToBoolean(ent.SaveChanges())) { MsgHistViewModel Guncellet = new MsgHistViewModel(); Guncellet.AliciId = AliciId; Guncellet.GondericiId = GondericiId; return(PartialView("SohbetGecmisi", Guncellet)); } return(PartialView("Error")); }