public ActionResult DeleteRoleForUser()
        {
            var objvm = new AssignRoleVM();

            var lirole = new List<SelectListItem> {new SelectListItem {Text = "Select", Value = "0"}};

            lirole.AddRange(Roles.GetAllRoles().Select(item => new SelectListItem {Text = item, Value = item}));

            objvm.RolesList = lirole;

            using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["TechMixtureConnection"].ToString()))
            {
                var userlist = con.Query("SELECT * FROM Users").ToList();

                var listuser = new List<SelectListItem> {new SelectListItem {Text = "Select", Value = "0"}};

                listuser.AddRange(userlist.Select(item => new SelectListItem {Text = item.UserName, Value = item.UserName}));

                objvm.Userlist = listuser;
            }

            return View(objvm);
        }
        public ActionResult RoleAddToUser(AssignRoleVM objvm)
        {
            if (objvm.RoleName == "0")
            {
                ModelState.AddModelError("RoleName", "Please select RoleName");
            }

            if (objvm.UserName == "0")
            {
                ModelState.AddModelError("UserName", "Please select Username");
            }

            if (ModelState.IsValid)
            {
                if (Roles.IsUserInRole(objvm.UserName, objvm.RoleName))
                {
                    ViewBag.ResultMessage = "This user already has the role specified !";
                }
                else
                {
                    Roles.AddUserToRole(objvm.UserName, objvm.RoleName);

                    ViewBag.ResultMessage = "Username added to the role successfully !";
                }

                var lirole = new List<SelectListItem> {new SelectListItem {Text = "Select", Value = "0"}};

                lirole.AddRange(Roles.GetAllRoles().Select(item => new SelectListItem {Text = item, Value = item}));

                objvm.RolesList = lirole;

                using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ToString()))
                {
                    var userlist = con.Query("SELECT * FROM Users").ToList();
                    var listuser = new List<SelectListItem> {new SelectListItem {Text = "Select", Value = "0"}};
                    listuser.AddRange(
                        userlist.Select(item => new SelectListItem {Text = item.UserName, Value = item.UserName}));

                    objvm.Userlist = listuser;
                }

                return View(objvm);
            }

            else
            {
                var lirole = new List<SelectListItem> {new SelectListItem {Text = "Select", Value = "0"}};
                lirole.AddRange(Roles.GetAllRoles().Select(item => new SelectListItem {Text = item, Value = item}));

                objvm.RolesList = lirole;

                using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ToString()))
                {
                    var userlist = con.Query("SELECT * FROM Users").ToList();
                    var listuser = new List<SelectListItem> {new SelectListItem {Text = "Select", Value = "0"}};

                    listuser.AddRange(
                        userlist.Select(item => new SelectListItem {Text = item.UserName, Value = item.UserName}));

                    objvm.Userlist = listuser;
                }
                ModelState.AddModelError("Error", "Please enter Username and Password");
            }
            return View(objvm);
        }