/// <summary> /// 分销商列表信息 /// </summary> /// <param name="manaDTO"></param> /// <returns></returns> public ManageDTO ManageInfoExt(ManageVM manaDTO) { ManageDTO result = new ManageDTO(); if (manaDTO == null) { return(result); } if (manaDTO.Ynos == 1 && manaDTO.ParentId != Guid.Empty) { var parent = Distributor.ObjectSet().FirstOrDefault(c => c.Id == manaDTO.ParentId); if (parent != null) { var tuple = CBCSV.GetUserNameAndCode(parent.UserId); result.ParentName = tuple.Item1; result.ParentCode = tuple.Item2; } } var resultData = DSSBP.Instance.ManageInfo(manaDTO); if (resultData != null && resultData.Data != null) { result.Count = resultData.Data.Count; result.Manager = resultData.Data.Manager; } LogHelper.Info( string.Format("DistributeBP.ManageInfoExt(AppId='{0}',ParentId='{1}'),返回:Count={2},Manager.Count={3}。", manaDTO.AppId, manaDTO.ParentId, result.Count, result.Manager.Count)); return(result); }
public async Task <IActionResult> SendVerificationEmail(ManageVM model) { if (!ModelState.IsValid) { return(View(model)); } var user = await GetLoggedInUserAsync(); var code = await _accountService.GenerateEmailConfirmationTokenAsync(user); var callbackUrl = Url.EmailConfirmationLink(user.Id, code, Request.Scheme); var email = user.Email; var response = await _notificationService.SendConfirmationNotificationAsync(user, callbackUrl); if (response.Success) { StatusMessage = new StatusMessageVM(true, "Verification email sent. Please check your email."); } else { StatusMessage = new StatusMessageVM(false, "An error occurred"); } return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Index(ManageVM model) { if (!ModelState.IsValid) { return(View(model)); } var user = await GetLoggedInUserAsync(); // Update the user with the values from the model user.Email = model.Email; user.PhoneNumber = model.PhoneNumber; user.FirstName = model.FirstName; user.LastName = model.LastName; var updateResult = await _accountService.UpdateUserAsync(user); if (!updateResult.Succeeded) { throw new ApplicationException(@"Unexpected error occurred updating user"); } StatusMessage = new StatusMessageVM(true, "Your profile has been updated"); return(RedirectToAction(nameof(Index))); }
public ResultDTO <ManageDTO> ManageInfo(ManageVM manageVM) { ResultDTO <ManageDTO> result = null; try { var url = string.Format("{0}/Jinher.AMP.DSS.BP.DistributorBP.svc/ManageInfo", CustomConfig.DSSUrl); var resultStr = BaseRequest.CreateRequest(url, manageVM, true, "a"); result = JsonHelper.JsonDeserialize <ResultDTO <ManageDTO> >(resultStr); //DistributorFacade distributorFacade = new DistributorFacade(); //distributorFacade.ContextDTO = AuthorizeHelper.CoinInitAuthorizeInfo(); //result = distributorFacade.ManageInfo(manageVM); } catch (Exception ex) { LogHelper.Error(string.Format("DSSBP.ManageInfo分销商列表信息服务异常。manageVM:{0}", JsonHelper.JsonSerializer(manageVM)), ex); } return(result); }
/// <summary> /// 分销商数量和层级 /// </summary> /// <returns></returns> public ManageNumDTO ManageNcExt(ManageVM search) { ManageNumDTO manageNumDTO = new ManageNumDTO(); if (search == null || search.AppId == Guid.Empty) { return(manageNumDTO); } var query = Distributor.ObjectSet().Where(c => c.EsAppId == search.AppId); if (query.Any()) { manageNumDTO.Count = query.Count(); manageNumDTO.MaxLevel = query.Max(c => c.Level); } else { manageNumDTO.Count = 0; manageNumDTO.MaxLevel = 0; } return(manageNumDTO); }