public void Delete(string email) { User_Authentication user = this.context.User_Authentication.SingleOrDefault(x => x.userEmail == email); this.context.User_Authentication.Remove(user); this.context.SaveChanges(); }
public void Update(User_Authentication user_authentication) { User_Authentication user = this.context.User_Authentication.SingleOrDefault(x => x.userEmail == user_authentication.userEmail); user.password = user_authentication.password; this.context.SaveChanges(); }
public void Delete(string userId) { User_Authentication user = this.context.User_Authentication.SingleOrDefault(x => x.userName == userId); this.context.User_Authentication.Remove(user); this.context.SaveChanges(); }
public ActionResult AddingUsers() { if (Convert.ToBoolean(Session["loggedOn"]) == true && Convert.ToInt32(Session["userType"]) == 1) { if (Request.Form["AddBtn"] != null) { try { User_Info user = new User_Info(); user.Name = Request.Form["Name"]; user.Email = Request.Form["email"]; user.Status = Request.Form["status"]; //user.Designation = Request.Form["desig"]; if (Convert.ToInt32(Request.Form["desig"]) == 2) { user.Designation = "Project Manager"; } else if (Convert.ToInt32(Request.Form["desig"]) == 3) { user.Designation = "Team Lead"; } else if (Convert.ToInt32(Request.Form["desig"]) == 4) { user.Designation = "Developer"; } else if (Convert.ToInt32(Request.Form["desig"]) == 5) { user.Designation = "QA Engineer"; } else if (Convert.ToInt32(Request.Form["desig"]) == 6) { user.Designation = "UX Engineer"; } User_Authentication userlog = new User_Authentication(); userlog.userEmail = Request.Form["email"]; userlog.password = Request.Form["email"] + "123"; userlog.userType = Convert.ToInt32(Request.Form["desig"]); users.Insert(user); log.Insert(userlog); return(RedirectToAction("showUsers")); } catch (Exception e) { ViewBag.Errormsg = e; } } return(View("Index")); } return(View("Index", "Error")); }
public ActionResult signUp(HttpPostedFileBase profilePicture) { if (Request.Form["signUP"] != null) { if (Request.Form["passtxt"] == Request.Form["rePasstxt"]) { User_info user = new User_info(); User_Authentication logged = new User_Authentication(); if (profilePicture != null && profilePicture.ContentLength > 0) { var filename = Path.GetFileName(profilePicture.FileName); var path = Path.Combine(Server.MapPath("~/images"), filename); profilePicture.SaveAs(path); user.userName = Request.Form["usernametxt"]; user.fullName = Request.Form["fullnametxt"]; user.email = Request.Form["emailtxt"]; user.Gender = Request.Form["genderSelect"]; user.DOB = Convert.ToDateTime(Request.Form["DOB"]); user.profilePicture = "~/images/" + filename.ToString(); logged.userName = Request.Form["usernametxt"]; logged.passWord = Request.Form["passtxt"]; users.Insert(user); logs.Insert(logged); return(RedirectToAction("Index")); } else { Session["signUpError"] = "Picture Is not Uploaded"; return(RedirectToAction("signUp")); } } else { Session["signUpError"] = "Passwords did not matched"; return(RedirectToAction("signUp")); } } return(RedirectToAction("Index", "Home")); }
public void Update(User_Authentication user_authentication) { this.data.Update(user_authentication); }
public void Insert(User_Authentication user_authentication) { this.data.Insert(user_authentication); }
public void Insert(User_Authentication user_authentication) { this.context.User_Authentication.Add(user_authentication); this.context.SaveChanges(); }