Example #1
0
        public GetUserDetail GetUserDetails(int userId)
        {
            GetUserDetail userDetail    = new GetUserDetail();
            var           getUserDetail = (from o in mVCDemoEntities.UserDetails
                                           join g in mVCDemoEntities.Genders on o.GenderId equals g.GenderId
                                           join c in mVCDemoEntities.Countries on o.CountryId equals c.ID
                                           join s in mVCDemoEntities.States on o.StateId equals s.ID
                                           join ci in mVCDemoEntities.Cities on o.CityId equals ci.ID
                                           where o.UserId == userId
                                           select new
            {
                o.UserId,
                o.Address,
                o.DOB,
                g.GenderName,
                o.Phone,
                CountryName = c.Name != null ? c.Name : null,
                o.CountryId,
                StateName = s.Name != null ? s.Name : null,
                o.StateId,
                CityName = ci.Name != null ? ci.Name : null,
                o.CityId,
                o.PostalCode,
                o.LandMark,
                o.Image,
                o.ImageName,
                o.ImageType
            }).FirstOrDefault();

            if (getUserDetail != null)
            {
                userDetail.UserId      = getUserDetail.UserId;
                userDetail.Address     = getUserDetail.Address;
                userDetail.Image       = getUserDetail.Image;
                userDetail.ImageName   = getUserDetail.ImageName;
                userDetail.ImageType   = getUserDetail.ImageType;
                userDetail.DOB         = getUserDetail.DOB;
                userDetail.GenderName  = getUserDetail.GenderName;
                userDetail.PostalCode  = getUserDetail.PostalCode;
                userDetail.Phone       = getUserDetail.Phone;
                userDetail.CountryName = getUserDetail.CountryName;
                userDetail.StateName   = getUserDetail.StateName;
                userDetail.CityName    = getUserDetail.CityName;
                userDetail.LandMark    = getUserDetail.LandMark;
            }
            else
            {
                userDetail = null;
            }
            return(userDetail);
        }
Example #2
0
        public async Task <ActionResult <string> > GetAsync()
        {
            _logger.LogInformation("start call to user actor");
            var userService = _actorFactory.FindTopLevelActor <UserService>();
            var command     = new GetUserDetail(1);
            var result      = await userService.Ask <UserDetailResult>(command, TimeSpan.FromSeconds(30));

            //var result = await _userManagerActor.Ask<UserDetailResult>(command, TimeSpan.FromSeconds(30));
            if (result.HasError)
            {
                throw result.Exception;
            }

            _logger.LogInformation("end call to user actor");
            return(new ActionResult <string>($"{result.FirstName} {result.LastName}"));
            //return new string[] { "value1", "value2" };
        }
        public ActionResult Editor()
        {
            UserResBody currResBody = new UserResBody();

            foreach (UserResBody item in base._userResBody)
            {
                if (item.res_path.Equals("0,1,107,118,121,"))
                {
                    currResBody = item;
                    break;
                }
            }

            HasPermission(currResBody.res_id);

            ViewData["currResBody"] = currResBody;//当前菜单
            string position = "";

            ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position);
            ViewData["position"]  = position;//页面位置

            int      userid = DoRequest.GetQueryInt("uid");
            UserInfo user   = null;

            if (userid == 0)
            {
                user = new UserInfo();
            }
            else
            {
                user = new UserInfo();
                var resuser = GetUserDetail.Do(userid);
                if (resuser != null && resuser.Body != null)
                {
                    user = resuser.Body;
                }
            }
            ViewData["userinfo"] = user;

            return(View());
        }