public ActionResult ManageUser(int id)
        {
            BusinessViewModel     businessViewModel = businessService.CreateViewModel(id);
            BusinessUserViewModel model             = new BusinessUserViewModel()
            {
                Id = businessViewModel.Id, BusinessName = businessViewModel.BusinessName, ContactEmail = businessViewModel.ContactEmail
            };

            return(PartialView("_businessusers", model));
        }
        public async Task <ActionResult> BusinessUserSave(BusinessUserViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser {
                    UserName = model.ContactEmail, Email = model.ContactEmail
                };
                IdentityResult result = null;
                if (string.IsNullOrEmpty(model.IdentityUserId) || model.Id.Equals("0"))
                {
                    user = _userManager.FindByEmailAsync(model.ContactEmail).Result;
                    if (user == null)
                    {
                        user = new ApplicationUser {
                            UserName = model.ContactEmail, Email = model.ContactEmail
                        };
                        result = await _userManager.CreateAsync(user, model.Password);
                    }

                    if (result.Succeeded)
                    {
                        string code = await _userManager.GeneratePasswordResetTokenAsync(user);

                        result = await _userManager.ResetPasswordAsync(user, code, model.Password);

                        if (result.Succeeded)
                        {
                            user = _userManager.FindByEmailAsync(model.ContactEmail).Result;
                            if (user != null)
                            {
                                var businessViewModel = businessService.CreateViewModel(model.Id);
                                businessViewModel.IdentityUserId = user.Id;
                                var response    = businessService.MapViewModelToSite(businessViewModel, CurrentUserName, true);
                                var client      = pharmixWebApiClient.InitializeClient(_apiBaseURI);
                                var apiResponse = await client.GetAsync("api/PharmixApi/SaveBusinessDetails?CurrentUserName="******"&BusinessName=" + model.BusinessName);
                            }
                        }
                        else
                        {
                            foreach (var item in result.Errors)
                            {
                                model.ErrorMessage = model.ErrorMessage + item.Description;
                            }
                            if (!string.IsNullOrEmpty(model.ErrorMessage))
                            {
                                ViewBag.IsSuccess = model.ErrorMessage;
                                return(PartialView("_businessusers", model));
                            }
                        }
                    }
                    else
                    {
                        foreach (var item in result.Errors)
                        {
                            model.ErrorMessage = model.ErrorMessage + item.Description;
                        }

                        if (string.IsNullOrEmpty(model.ErrorMessage))
                        {
                        }
                        else
                        {
                            ViewBag.IsSuccess = model.ErrorMessage;
                            return(PartialView("_businessusers", model));
                        }
                    }
                }


                ViewBag.IsSuccess = result.Succeeded;

                return(RedirectToAction("Index"));
            }
            else
            {
                ViewBag.IsSuccess = "Something Went wrong!..";

                return(PartialView("_businessusers", model));
            }
        }