public override NpceOperationResult Conferma() { CE ce = GetCE(); ConfirmService confirm = new ConfirmService { IdRichiesta = _servizio.IdRichiesta }; ConfirmServiceResponse confirmResult = null; ce.Body = SerializationUtility.SerializeToXmlElement(confirm); using (WsCEClient client = new WsCEClient()) { client.Endpoint.Address = new System.ServiceModel.EndpointAddress(_ambiente.LolUri); client.SubmitRequest(ref ce); try { confirmResult = SerializationUtility.Deserialize <ConfirmServiceResponse>(ce.Body); } catch (Exception ex) { throw (ex); } } return(CreateResult(NpceOperation.Invio, ce.Result.ResType == TResultResType.I ? "0" : "99", ce.Result.Description?.Substring(0, Math.Min(ce.Result.Description.Length, 500)) ?? "Invio Ok", string.Empty, null, null)); }
protected async Task Delete(object context) { await ConfirmService.ConfirmAsync( async() => await NetService.DeleteRoleAsync(((RoleDisplayDto)context).Id), async() => await SearchData(true), "确定要删除该记录吗?"); }
protected async Task Delete(object obj) { if (obj is ReplyDisplayDto dto) { await ConfirmService.ConfirmAsync( async() => await NetService.DeleteReply(dto.Id), async() => await SearchData(true)); } }
protected async Task Resume(object obj) { if (obj is TopicDisplayDto dto) { await ConfirmService.ConfirmAsync( async() => await NetService.ResumeTopic(dto.Id), async() => await SearchData(true) ); } }
protected async Task Resume(object obj) { if (obj is UserDisplayDto dto) { await ConfirmService.ConfirmAsync( async() => await NetService.ResumeUser(dto.Id), async() => await SearchData(true), "确定要激活该账号吗?"); } }
protected async Task Resume(object obj) { if (obj is VersionDisplayDto dto) { await ConfirmService.ConfirmAsync( async() => await NetService.ResumeVersion(dto.Id), async() => await SearchData(true), "确定要删除?"); } }
protected async Task Delete(object obj) { if (obj is BannerDisplayDto dto) { await ConfirmService.ConfirmAsync( async() => await NetService.DeleteBanner(dto.Id), async() => await SearchData(true), "确定要删除?"); } }
protected async Task ResetPassword(object obj) { if (obj is UserDisplayDto dto) { await ConfirmService.ConfirmAsync( async() => await NetService.ResetPassword(dto.Id), async result => { await MessageBox.AlertAsync($"重置密码成功,新密码为{result.Data?.ToString()},请牢记"); //todo--发送短信至用户 await SearchData(true); }, "确定要重置密码吗?"); } }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { //---------------------------------------------------- IConfigService configService = new XMLConfigService("Config.xml"); IMessenger messenger_sms = new SmsMessenger(); IMessenger messenger_email = new EmailMessenger(); IPassHasher passHasher = new SHA256Hasher(); IKeyGenerator smallKeyGenerator = new SmallKeyGenerator(); IKeyGenerator bigKeyGenerator = new BigKeyGenerator(); IRegValidator regValidator = new RegValidator(); IUOWFactory UOWFactory = new EFUOWFactory(configService.ConnectionString); IGetUserDTO getUserDTO = new GetUserDTO(); //---------------------------------------------------- IClaimService claimService = new ClaimService(UOWFactory); //---------------------------------------------------- services.AddSingleton <IConfigService, IConfigService>( serviceProvider => { return(configService); } ); //---------------------------------------------------- services.AddSingleton <IGetUserDTO, IGetUserDTO>( serviceProvider => { return(getUserDTO); } ); //---------------------------------------------------- services.AddSingleton <IUOWFactory, IUOWFactory>( serviceProvider => { return(UOWFactory); } ); services.AddSingleton <IClaimService, ClaimService>(); //----------------------------------------------------- services.AddSingleton <IUserService, UserAuthService>( serviceProvider => { return(new UserAuthService( UOWFactory, new AuthKeyService(smallKeyGenerator, messenger_sms), new AuthKeyService(smallKeyGenerator, messenger_email), passHasher, regValidator, claimService, bigKeyGenerator, getUserDTO )); } ); services.AddSingleton <IProfileService, ProfileService>( serviceProvider => { IConfirmService emailCS = new ConfirmService( new ConfirmKeyService(bigKeyGenerator, messenger_email) ); IConfirmService phoneCS = new ConfirmService( new ConfirmKeyService(smallKeyGenerator, messenger_sms) ); return(new ProfileService( UOWFactory, regValidator, emailCS, phoneCS, passHasher, claimService, getUserDTO )); } ); services.AddSingleton <IRestorePasswordService, RestorePasswordService>( serviceProvider => { var emaiCKS = new ConfirmKeyService(bigKeyGenerator, messenger_email); var phoneCKS = new ConfirmKeyService(smallKeyGenerator, messenger_sms); return(new RestorePasswordService(UOWFactory, emaiCKS, phoneCKS, new RegValidator(), passHasher)); } ); //---------Forum Services-------------------------------- IGroupRules groupRules = new GroupRules(); ISectionRules sectionRules = new SectionRules(groupRules); IThemeRules themeRules = new ThemeRules(sectionRules); IMessageRules messageRules = new MessageRules(themeRules, sectionRules); IDTOHelper dtoHelper = new DTOHelper(); IForumDTOHelper forumDTOHelper = new ForumDTOHelper(messageRules, themeRules, sectionRules, groupRules, dtoHelper); services.AddSingleton <IGroupService, GroupService>( serviceProvider => { return(new GroupService(groupRules, getUserDTO, UOWFactory, forumDTOHelper)); } ); services.AddSingleton <ISectionService, SectionService>( serviceProvider => { return(new SectionService(sectionRules, getUserDTO, UOWFactory, forumDTOHelper)); } ); services.AddSingleton <IThemeService, ThemeService>( serviceProvider => { return(new ThemeService(themeRules, getUserDTO, UOWFactory, forumDTOHelper)); } ); services.AddSingleton <IMessageService, MessageService>( serviceProvider => { return(new MessageService(messageRules, getUserDTO, UOWFactory, forumDTOHelper)); } ); services.AddSingleton <IForumService, ForumService>( serviceProvider => { return(new ForumService(getUserDTO, UOWFactory, forumDTOHelper, groupRules)); } ); //--------------------Page Services-------------------- IPageRules pageRules = new PageRules(); INoteRules noteRules = new NoteRules(); services.AddSingleton <IPageService, PageService>( serviceProvider => { return(new PageService(pageRules, UOWFactory, getUserDTO, dtoHelper)); } ); services.AddSingleton <IBlogService, BlogService>( serviceProvider => { return(new BlogService(noteRules, UOWFactory, getUserDTO, dtoHelper)); } ); //------------------------------------------------------- services.AddSingleton <IImageService, ImageService>( serviceProvider => { return(new ImageService(UOWFactory, getUserDTO)); } ); //------------------------------------------- services.AddSingleton <IAdminService, AdminService>( serviceProvider => { return(new AdminService(getUserDTO, UOWFactory)); } ); services.Configure <FormOptions>(x => { x.ValueCountLimit = int.MaxValue; x.MemoryBufferThreshold = int.MaxValue; x.ValueLengthLimit = int.MaxValue; x.MultipartBodyLengthLimit = int.MaxValue; // In case of multipart }); //------------------------------------------------------ services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(options => { options.LoginPath = new Microsoft.AspNetCore.Http.PathString("/Account/Login"); options.LogoutPath = new Microsoft.AspNetCore.Http.PathString("/Account/Logout"); options.Events.OnValidatePrincipal = PrincipalValidator.ValidateAsync; }); services.AddMvc(); }
public object Any(Confirm_Imgr1 request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ConfirmService cs = new ConfirmService(); cs.ConfirmImgr1(auth, request, confirm_Imgr1_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { ecr.meta.code = 599; ecr.meta.message = "The server handle exceptions, the operation fails."; ecr.meta.errors.code = ex.HResult; ecr.meta.errors.field = ex.HelpLink; ecr.meta.errors.message = ex.Message.ToString(); } return ecr; }
public DatabaseProvider(IJSRuntime jsRuntime, ConfirmService confirmService) { _jsRuntime = jsRuntime; _confirmService = confirmService; }