예제 #1
0
        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();
        }
예제 #2
0
        public async Task <bool> AddArGorAsync(ArgorTB model)
        {
            try
            {
                db.ArgorTB.Add(model);
                await db.SaveChangesAsync();

                return(true);
            }
            catch (System.Exception)
            {
                return(false);
            }
        }
예제 #3
0
        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());
        }
예제 #4
0
 public async Task <ArgorTB> UpdateArGorAsync(ArgorTB model)
 {
     db.ArgorTB.AddOrUpdate(model);
     db.SaveChangesAsync();
     return(model);
 }