예제 #1
0
        public JsonResult LoadData(string account, int?countryId, int?status, GridPager pager)
        {
            if (!countryId.HasValue)
            {
                return(Json(new List <UserProfileViewModel>().ToGridJson(pager)));
            }
            var profileList = new UserProfileBLL().GetUserResidencePageList(account, countryId.Value, status, ref pager);

            if (profileList == null || profileList.Count <= 0)
            {
                return(Json(new List <UserProfileViewModel>().ToGridJson(pager)));
            }

            var accountIds  = profileList.Select(t => t.UserAccountId.Value).ToList();
            var countryName = FoundationDB.CountryDb.GetById(countryId).Name;

            var userList = FiiiPayDB.UserAccountDb.GetList(t => accountIds.Contains(t.Id));
            var data     = profileList.ToGridJson(pager, r =>
                                                  new
            {
                id   = r.UserAccountId,
                cell = new
                {
                    UserAccountId    = r.UserAccountId,
                    Cellphone        = userList.Where(t => t.Id == r.UserAccountId).Select(t => t.Cellphone).FirstOrDefault(),
                    FirstName        = r.FirstName,
                    LastName         = r.LastName,
                    CountryName      = countryName,
                    State            = r.State,
                    City             = r.City,
                    L2VerifyStatus   = r.L2VerifyStatus.HasValue ? ((VerifyStatus)r.L2VerifyStatus.Value).ToString() : "",
                    L2SubmissionDate = r.L2SubmissionDate.HasValue ? r.L2SubmissionDate.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm") : "",
                    Remark           = r.L2Remark,
                    Options          = r.L2VerifyStatus.HasValue ? (int)r.L2VerifyStatus : 0
                }
            });

            return(Json(data));
        }
예제 #2
0
        public JsonResult LoadData(string cellphone, int?countryId, int?status, GridPager pager)
        {
            if (!countryId.HasValue)
            {
                return(Json(new List <UserAccountStatus>().ToGridJson(pager)));
            }
            var profileList = new UserProfileBLL().GetUserAccountStatusList(cellphone, countryId.Value, status, ref pager);

            if (profileList == null || profileList.Count <= 0)
            {
                return(Json(new List <UserAccountStatus>().ToGridJson(pager)));
            }

            var accountIds  = profileList.Select(t => t.UserAccountId.Value).ToList();
            var countryName = FoundationDB.CountryDb.GetById(countryId).Name;

            var userList = FiiiPayDB.UserAccountDb.GetList(t => accountIds.Contains(t.Id));
            var data     = profileList.ToGridJson(pager, r =>
                                                  new
            {
                id   = r.UserAccountId,
                cell = new
                {
                    Id                = r.UserAccountId,
                    AccountNo         = r.Cellphone,
                    CountryName       = countryName,
                    ProfileVerify     = r.L1VerifyStatus.ToString(),
                    AddressVerify     = r.L2VerifyStatus.ToString(),
                    IsAllowWithdrawal = r.IsAllowWithdrawal,
                    IsAllowAccept     = r.IsAllowExpense,
                    Status            = (r.Status == 1) ? "Enable" : "Disable",
                    RegisterDate      = r.RegistrationDate.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm"),
                    LastLoginDate     = r.LastLoginTimeStamp.HasValue ? r.LastLoginTimeStamp.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm") : ""
                }
            });

            return(Json(data));
        }