public ActionResult RoleAddToUser(string UserName, string RoleName, string FirstName, string LastName, string Phone)
        {
            ApplicationDbContext    context = new ApplicationDbContext();
            pointersecurityEntities db      = new pointersecurityEntities();

            var UserManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(context));

            var CurrentUser = db.AspNetUsers.FirstOrDefault(c => c.UserName.Equals(UserName, StringComparison.CurrentCultureIgnoreCase));


            if (CurrentUser == null)
            {
                ViewBag.Roles = context.Roles.OrderBy(r => r.Name).ToList().Select(rr => new SelectListItem {
                    Value = rr.Name.ToString(), Text = rr.Name
                }).ToList();

                ViewBag.clientlist = db.Clients.Select(c => new SelectListItem {
                    Text = c.ClientName, Value = c.ID.ToString()
                }).ToList();
                ViewBag.ResultMessage = "There is no user with this Username !";
                return(View("ManageUserRoles"));
            }
            var currentUserID = CurrentUser.Id;
            var roleresult    = UserManager.AddToRole(currentUserID, RoleName);

            ViewBag.ResultMessage = "Role created successfully !";

            var     ObjisitManager = db.Manager.Find(currentUserID);
            Manager ObjManager     = new Manager();

            if (ObjisitManager != null)
            {//update
             // ObjManager.ID = ObjisitManager.ID;
             //ObjManager.FirstName = ObjisitManager.FirstName;
             //ObjManager.LastName = ObjisitManager.LastName;
             //ObjManager.Phone = ObjisitManager.Phone;
             //db.Manager.Attach(ObjManager);
             //var Entry = db.Entry(ObjManager);
             //Entry.Property(c => c.FirstName).IsModified = true;
             //Entry.Property(c => c.LastName).IsModified = true;
             //Entry.Property(c => c.Phone).IsModified = true;
            }
            else
            {//insert
                ObjManager.ID        = currentUserID;
                ObjManager.FirstName = FirstName;
                ObjManager.LastName  = LastName;
                ObjManager.Phone     = Phone;
                db.Manager.Add(ObjManager);
                db.SaveChanges();
            }



            // prepopulat roles for the view dropdown
            ViewBag.Roles = context.Roles.OrderBy(r => r.Name).ToList().Select(rr => new SelectListItem {
                Value = rr.Name.ToString(), Text = rr.Name
            }).ToList();
            ViewBag.clientlist = db.Clients.Select(c => new SelectListItem {
                Text = c.ClientName, Value = c.ID.ToString()
            }).ToList();
            return(View("ManageUserRoles"));
        }