public HttpResponseMessage UserLogin(tbladmin admin) { proc_LoginCheck_Result result = null; result = entities.proc_LoginCheck(admin.admin_id, admin.password).FirstOrDefault(); if (result == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Invalid Username or password")); } else { return(Request.CreateResponse <proc_LoginCheck_Result>(result)); } }
public ActionResult Giris(tbladmin t) { var bilgiler = db.tbladmin.FirstOrDefault(x => x.kulanici == t.kulanici && x.sifre == t.sifre); if (bilgiler != null) { FormsAuthentication.SetAuthCookie(bilgiler.kulanici, false); return(RedirectToAction("Index", "Musteri")); } else { return(View()); } }
public ActionResult Giriş(tbladmin t) { var blg = db.tbladmin.FirstOrDefault(x => x.Kullanici == t.Kullanici && x.Sifre == t.Sifre); if (blg != null) { FormsAuthentication.SetAuthCookie(blg.Kullanici, false); return(RedirectToAction("Index", "Musteri")); } else { return(View()); } }
public ActionResult doLogIn(tbladmin adm) { tbladmin _adm = res.tbladmin.Where(t => t.UserName.Equals(adm.UserName) && t.Password.Equals(adm.Password)).SingleOrDefault(); if (adm != null) { Session["AdminID"] = _adm.AdminID; Session["AdminName"] = _adm.UserName; return(RedirectToAction("Index")); } else { return(RedirectToAction("doLogIn")); } }
public HttpResponseMessage updatePassword(tbladmin admin) { var result = entities.tbladmins.Where(a => a.email_id == admin.email_id).FirstOrDefault(); if (result != null) { result.password = admin.password; entities.SaveChanges(); return(Request.CreateErrorResponse(HttpStatusCode.Accepted, "Password accepted")); } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "password not updated")); } }
public ActionResult AdminLogin(tbladmin obj) { var p = dc.tbladmins.Where(c => c.username == obj.username && c.password == obj.password).ToList(); if (p.Count == 1) { Session["adminid"] = p.FirstOrDefault().id; return(RedirectToAction("Dashboard", "Admin")); } else { ViewBag.msg = "Invalid User Name Or Password"; } return(View()); }
public HttpResponseMessage updateadmin([FromBody] tbladmin obj) { Dictionary <string, string> dic = new Dictionary <string, string>(); try { db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); dic.Add("status", "success"); return(Request.CreateResponse(HttpStatusCode.OK, dic)); } catch (Exception ex) { dic.Add("status", ex.Message); return(Request.CreateResponse(HttpStatusCode.OK, dic)); } }
public async Task SendUsernametoMails(tbladmin admin) { // string email = email_id.ToString(); tbladmin resadmin = entities.tbladmins.Where(a => a.email_id == admin.email_id).FirstOrDefault(); var message = new MailMessage(); message.To.Add(new MailAddress(admin.email_id)); message.From = new MailAddress("RDNS Bank <*****@*****.**>"); //message.Bcc.Add(new MailAddress("Amit Mohanty <*****@*****.**>")); message.Subject = "The Username for RDNS Banking"; message.Body = resadmin.admin_id; message.IsBodyHtml = true; using (var smtp = new SmtpClient()) { await smtp.SendMailAsync(message); await Task.FromResult(0); } }
public ActionResult YeniAdmin(tbladmin p) { db.tbladmin.Add(p); db.SaveChanges(); return(RedirectToAction("Index")); }