public async Task <ActionResult> add(ArgorTB model) { model.kayit = DateTime.Now; string sifre = new GeneralFunctions().RandomSifreGetir(); model.sifre = sifre; bool result = await hocaOps.AddArGorAsync(model); result = await new GeneralFunctions().YeniKayitEmail(model.email, sifre); return(RedirectToAction("operations", "teachers")); //return View(); }
public async Task <bool> AddArGorAsync(ArgorTB model) { try { db.ArgorTB.Add(model); await db.SaveChangesAsync(); return(true); } catch (System.Exception) { return(false); } }
public async Task <ActionResult> passreset(int id) { ArgorTB result = await hocaOps.ReadArGorAsync(id); string sifre = new GeneralFunctions().RandomSifreGetir(); result.sifre = sifre; ArgorTB yeniResult = await hocaOps.UpdateArGorAsync(result); bool emailResult = await new Models.GeneralFunctions().SendEmail(result.email, sifre); return(View()); }
public async Task <ArgorTB> UpdateArGorAsync(ArgorTB model) { db.ArgorTB.AddOrUpdate(model); db.SaveChangesAsync(); return(model); }