public ActionResult EditUser(LmsUserViewRegistration user) { if (user.GuidId == null) { var guid = _opp2.GetGuidByEmail(user.Email); user.GuidId = guid; } _opp2.Edit(user); if (user.AdminRole) _opp2.AssignRole(user.GuidId, "1"); if (!user.AdminRole) _opp2.RemoveRole(user.GuidId, "1"); if (user.TeacherRole) _opp2.AssignRole(user.GuidId, "2"); if (!user.TeacherRole) _opp2.RemoveRole(user.GuidId, "2"); if (user.StudentRole) _opp2.AssignRole(user.GuidId, "3"); if (!user.StudentRole) _opp2.RemoveRole(user.GuidId, "3"); if (user.ParentRole) _opp2.AssignRole(user.GuidId, "4"); if (!user.ParentRole) _opp2.RemoveRole(user.GuidId, "4"); return RedirectToAction("AdminDashboard", "Admin"); }
public void LogIn(LmsUserViewRegistration user) { byte? gradeLevelId = null; if (user.GradeLevelId != null) { gradeLevelId = Convert.ToByte(user.GradeLevelId); } ObjectParameter userId = new ObjectParameter("userId", typeof (int)); db.LmsUserInsert(user.GuidId, user.FirstName, user.LastName, user.Email, gradeLevelId, user.SuggestedRole, userId); }
public ActionResult LogIn() { List<GradeLevel> grade = _opp.GetAllGrades(); var gradeList = new LmsUserViewRegistration { GradeLevelList = grade.Select(x => new System.Web.Mvc.SelectListItem() { Value = x.GradeLevelId.ToString(), Text = x.GradeLevelName.ToString() }) }; return View(gradeList); }
public ActionResult Edit(int id) { LmsUser edit = _opp1.GetById(id); List<GradeLevel> gradeList = _opp1.GetAllGrades(); var grades = new LmsUserViewRegistration { GradeLevelList = gradeList.Select(x => new SelectListItem() { Value = x.GradeLevelId.ToString(), Text = x.GradeLevelName.ToString() }) }; grades.UserId = id; grades.Email = edit.Email; grades.FirstName = edit.FirstName; grades.LastName = edit.LastName; grades.SuggestedRole = edit.SuggestedRole; grades.GradeLevelId = edit.GradeLevelId; grades.GuidId = edit.Id; return View(grades); }
public void Edit(LmsUserViewRegistration user) { _repo.Edit(user); }
public void LogIn(LmsUserViewRegistration user) { _repo.LogIn(user); }
public void Edit(LmsUserViewRegistration user) { byte gradeLevelId = Convert.ToByte(user.GradeLevelId); db.LmsUserEdit(user.UserId, user.GuidId, user.FirstName, user.LastName, gradeLevelId); }