public ActionResult AddUser() { var roles = _iCommonManager.GetAllUserRoles().ToList(); ViewBag.Roles = roles; return(View()); }
public ActionResult AssignBranchToUser(FormCollection collection) { User anUser = new User { UserId = Convert.ToInt32(collection["UserId"]) }; List <Branch> branchList = new List <Branch>(); string[] tokens = collection["SelectedBranch"].Split(','); for (int i = 0; i < tokens.Length; i++) { branchList.Add(new Branch { BranchId = Convert.ToInt32(tokens[i]) }); } TempData["Message"] = _superAdminUserManager.AssignBranchToUser(anUser, branchList); var branches = _iBranchManager.GetAllBranches(); var roles = _iCommonManager.GetAllUserRoles().ToList(); ViewBag.Roles = roles; return(View(branches)); }
// GET: LogIn public ActionResult LogIn() { //var text = StringCipher.Encrypt( // "Data Source=192.168.2.62; Initial Catalog=dbUniversalBusinessSolution1; User Id=sa; Password=Nbl&Cit&Navana;Integrated Security=false;MultipleActiveResultSets=true;", // "salam_cse_10_R"); //var ip = "192.168.2.62"; //var dbName = "dbUniversalBusinessSolution1"; //var userName = "******"; //var password = "******"; //_iCommonManager.SaveEncriptedConString(text,ip,dbName,userName,password); Session["user"] = null; Session["Branches"] = null; Session["Roles"] = null; ViewBag.Companies = _iCompanyManager.GetAll().ToList().OrderBy(n => n.CompanyId).ToList(); ViewBag.Roles = _iCommonManager.GetAllUserRoles(); return(View()); }