public IValidate Validation; //yeni bir işlem ekleyince buraya da yazıyoruz public CrossCuttingConcernFacade() { Logging = new Logging(); Caching = new Caching(); Authorize = new Authorize(); Validation = new Validation(); //yeni bir işlem ekleyince buraya da yazıyoruz }
/// <summary> /// Обработчик запуска службы /// Этот метод считать точкой входа а-ля main() /// </summary> /// <param name="args"></param> protected override void OnStart(string[] args) { _instance = new AuthorizationService(); _service = new ServiceHost(_instance); _service.Open(); _logger.Info("OnStart"); }
public static IAuthorize GetAuthorizer() { if (!s_HasSetAuthorizerType) { lock (s_SyncObj) { if (!s_HasSetAuthorizerType) { string path = GetConfigPath(); if (File.Exists(path)) { XmlDocument x = new XmlDocument(); x.Load(path); XmlNode node = x.SelectSingleNode(@"//serviceList"); if (node != null) { string name = GetNodeAttribute(node, "authorizerType"); if (name != null && name.Trim().Length > 0) { Type type = Type.GetType(name, false); s_Authorizer = (IAuthorize)Activator.CreateInstance(type); } } } s_HasSetAuthorizerType = true; } } } return(s_Authorizer); }
public static IAuthorize GetAuthorizeInterface() { string className, profilePath; string dataBaseType = ConfigurationManager.AppSettings["DataBaseType"] as string; switch (dataBaseType) { case "ORACLE": className = "SinoSZAuthorizeDC.OraAuthorizeFactroy"; profilePath = "SinoSZAuthorizeDC"; return((IAuthorize)Assembly.Load(profilePath).CreateInstance(className)); case "SQLSERVER": return(null); case "REMOTING": IServiceFactory _serviceFactory = (IServiceFactory)RemotingClientSvc.GetAppSvrObj(typeof(IServiceFactory)); RemotingClientSvc.BindTicketToCallContext(SessionClass.CurrentTicket); IAuthorize _ret = _serviceFactory.GetInterFace("AuthorizeServerPlugin") as IAuthorize; return(_ret); } return(null); }
/// <summary> /// Initializes a new instance of the <see cref="AuthorizeAttribute"/> class. /// </summary> /// <param name="authorizer">The authorization framework integration interface</param> public AuthorizeAttribute(IAuthorize authorizer) { WhiteList = new string[0]; Blacklist = new string[0]; _authorizer = authorizer; }
public CrossCuttingConcernsFacade() { Caching = new Caching(); Logging = new Logging(); Authorize = new Authorize(); Validate = new Validate(); }
public Facade() { logging = new Logging(); caching = new Caching(); authorize = new Authorize(); validate = new Validation(); }
public IValidation Validation; // public CrossFacade() // { // Logging = new Logging(); // Cachig = new Caching(); // Authorize = new Authorize(); // Validation = new Validation(); // } //
public CCCFacade() { Logging = new Logging(); Caching = new Caching(); Authorize = new Authorize(); Validation = new Validation(); }
//private ILogging _logging; //private ICaching _caching; //private IAuthorize _authorize; public CustomerManager(ILogging logging, ICaching caching, IAuthorize authorize) { _concerns = new CCCFacade(); //_logging = logging; //_caching = caching; //_authorize = authorize; }
public T Authorize <T>(IAuthorize authorize) where T : IPayment { var url = _context.Url + "/quickbooks/v4/payments/charges"; var payment = new Model.Gateway.Payment(); payment.Amount = authorize.Amount; payment.Currency = _context.Currency; var address = new Model.Gateway.Address(); address.City = authorize.Customer.City; address.Country = authorize.Customer.Country; address.PostalCode = authorize.Customer.Zipcode; address.Region = authorize.Customer.StateOrProvince; address.StreetAddress = authorize.Customer.Address; var creditCard = new Model.Gateway.CreditCard(); creditCard.Name = authorize.Customer.FirstName + " " + authorize.Customer.LastName; creditCard.Address = address; creditCard.Number = authorize.CreditCard.CardNumber; creditCard.ExpMonth = authorize.CreditCard.ExpirationMonth; creditCard.ExpYear = authorize.CreditCard.ExpirationYear; creditCard.CVC = authorize.CreditCard.CVV; payment.Card = creditCard; payment.Capture = "false"; var body = JsonConvert.SerializeObject(payment); var response = _context.SendRequest(url, "POST", body, new Dictionary <string, string>(), null); return(JsonConvert.DeserializeObject <T>(response.Body.ToString())); }
public CrossCuttingConcernsFacade() { Logging = new Logging(); Caching = new Caching(); Authorize = new Authorize(); Validation = new Validator(); }
/// <summary> /// 实例化授权注册窗口 /// </summary> /// <param name="aboutCode">提示关于怎么获取注册码的信息</param> /// <param name="encrypt">加密的方法</param> public FormAuthorize(string aboutCode, IAuthorize authorize) { InitializeComponent(); Authorize = authorize; machineCode = Authorize.GetMachineCodeString(); this.lblMachineCode.Tag = machineCode; }
public CrossCuttingConcernsFacade() { _logging = new Logging(); _cache = new Caching(); _authorize = new Authorize(); _validate = new Validate(); }
public CrossCuttongConcernsFacede() { Logging = new Logging(); Cahcing = new Caching(); Authorize = new Authorize(); Validation = new Validation(); }
public static IAuthorize GetAuthorizer() { if (!s_HasSetAuthorizerType) { lock (s_SyncObj) { if(!s_HasSetAuthorizerType) { string path = GetConfigPath(); if (File.Exists(path)) { XmlDocument x = new XmlDocument(); x.Load(path); XmlNode node = x.SelectSingleNode(@"//serviceList"); if (node != null) { string name = GetNodeAttribute(node, "authorizerType"); if (name != null && name.Trim().Length > 0) { Type type = Type.GetType(name, false); s_Authorizer = (IAuthorize)Activator.CreateInstance(type); } } } s_HasSetAuthorizerType = true; } } } return s_Authorizer; }
/// <summary> /// Authorizes a charge for the specified amount on the given credit card. /// </summary> /// <param name="cardNumber">The card number.</param> /// <param name="expirationMonthAndYear">The expiration month and year.</param> /// <param name="cvv">The CVV.</param> /// <param name="amount">The amount.</param> /// <returns></returns> public override void Authorize(IAuthorize authorize) { SetApiAction(RequestAction.Authorize); Queue(AuthorizeDotNetApi.CreditCardNumber, authorize.CreditCard.CardNumber); Queue(AuthorizeDotNetApi.CreditCardExpiration, authorize.CreditCard.ExpirationMonth + authorize.CreditCard.ExpirationYear); Queue(AuthorizeDotNetApi.CreditCardCode, authorize.CreditCard.CVV); Queue(AuthorizeDotNetApi.Amount, authorize.Amount.ToString()); }
public UsersApi(IUsersTable usersTable, IMapper mapper, JsonSerializerOptions jsonOptions, JsonObjectSerializer jsonSerializer, IAuthorize authorize) : base(jsonOptions, jsonSerializer) { this.usersTable = usersTable; this.mapper = mapper; this.authorize = authorize; }
public Utilities(IConfiguration configuration, IAuthorize authorize) { _authorize = authorize; Root = (configuration["magic:io:root-folder"] ?? "~/files/") .Replace("~", Directory.GetCurrentDirectory()) .TrimEnd('/') + "/"; }
public APISecurityProvider(IOperationSecurityConfigProvider securityConfigProvider, ISemanticLog logger, ISessionManager sessionManager, IAuthorize authorize, IExecutionContextProvider executionContextProvider) { this.logger = logger; this.securityConfigProvider = securityConfigProvider; this.sessionManager = sessionManager; this.authorize = authorize; this.executionContextProvider = executionContextProvider; }
public PlayersApi(IPlayerTable playerTable, IMapper mapper, JsonSerializerOptions jsonOptions, JsonObjectSerializer jsonSerializer, IAuthorize authorize, IPlayerLogTable playerLogTable, IPlayerResultTable playerResultTable) : base(playerTable, jsonOptions, jsonSerializer) { this.mapper = mapper; this.authorize = authorize; this.playerLogTable = playerLogTable; this.playerResultTable = playerResultTable; }
public FacadeCrossCuttingConcerns() { Logging = new Logging(); Caching = new Caching(); Authorize = new Authorize(); /*Yeni özellikler ve metodlar bu kısma eklenir, CustomManager adlı ana sınıfta * her yeni özellik için dependency injection yapma işlemine gerek kalmaz. Bu açıdan * Facade deseni oldukça faydalıdır. Bir nevi sadeleştirme işi görür. */ }
public T Authorize <T>(IAuthorize authorize) where T : IPayment { var request = _context.Create(); request.ApiAction = RequestAction.Authorize; request.AddCustomer(authorize.Customer); request.AddShipping(authorize.Shipping); request.AddCurrency(_context.Currency); request.Authorize(authorize); return((T)_context.Send(request)); }
static void Main(string[] args) { IKernel kernel = new StandardKernel(); kernel.Bind <IAuthorize>().To <FacebookAuthenticationProvider>(); kernel.Bind <IDbConnection>().To <DbConnection>(); IAuthorize authorize = kernel.Get <IAuthorize>(); var isAuthorized = authorize.Authorize("mojLogin", "mojeHaslo"); }
public static bool Export(BaseView _view) { SaveFileDialog _sf = new SaveFileDialog(); _sf.Filter = "Excle文件|*.xls|HTML文件|*.mht|文本文件|*.TXT"; _sf.FilterIndex = 1; string _fname = ""; while (_fname == "") { if (_sf.ShowDialog() == DialogResult.OK) { _fname = _sf.FileName; if (_fname != "") { switch (_sf.FilterIndex) { case 1: _view.ExportToXls(_fname, true); break; case 2: _view.ExportToMht(_fname, "UTF-8", "", true); break; case 3: _view.ExportToText(_fname, "\t"); break; case 4: _view.ExportToPdf(_fname); break; } IAuthorize ics_Auth = LoginConfig.GetAuthorizeInterface(); int _exportRowCount = _view.RowCount; ics_Auth.WriteExportLog(_exportRowCount, (_view.Tag != null) ? _view.Tag.ToString() : ""); if (XtraMessageBox.Show("导出文件已成功,是否立即打开?", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { System.Diagnostics.Process.Start(_fname); } return(true); } else { XtraMessageBox.Show("请输入导出文件名!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { return(false); } } return(false); }
protected virtual bool Authorize() { if (IsPostBack) { return(true); } bool hasAccess = false; bool hasAttr = false; foreach (object at in GetType().GetCustomAttributes(true)) { IAuthorize auth = at as IAuthorize; if (auth != null) { hasAttr = true; if (auth.Authorize(this.Context)) { hasAccess = true; } } } if (hasAccess) { return(true); } if (!hasAttr) { string sitmap = HttpContext.Current.Server.MapPath("~/Web.sitemap"); if (File.Exists(sitmap)) { XmlDocument doc = new XmlDocument(); doc.Load(sitmap); foreach (XmlNode childNode in doc.DocumentElement.FirstChild.ChildNodes) { if (childNode.NodeType == XmlNodeType.Comment) { continue; } if (FindNodeAndCheckAccess(childNode, "Menu", false)) { return(true); } } } } FormsAuthentication.RedirectToLoginPage(); return(false); }
public AuthorizableDiscountCalculator( IAuthorize authorizer, IDiscountQuery baseQuery) { if (authorizer == null) { throw new ArgumentNullException(nameof(authorizer)); } if (baseQuery == null) { throw new ArgumentNullException(nameof(baseQuery)); } _authorizer = authorizer; _baseQuery = baseQuery; }
public PlayersPlayApi(IPlayerTable playerTable, JsonSerializerOptions jsonOptions, JsonObjectSerializer jsonSerializer, IAuthorize authorize, IGameClient gameClient, IPlayerLogTable playerLogTable, IPlayerResultTable playerResultTable, IPlayerGameLeaseManager playerGameLease, IConfiguration configuration, IMessageSender messageSender) : base(playerTable, jsonOptions, jsonSerializer) { this.authorize = authorize; this.gameClient = gameClient; this.playerLogTable = playerLogTable; this.playerResultTable = playerResultTable; this.playerGameLease = playerGameLease; this.messageSender = messageSender; if (serviceBusConnectionString == null) { serviceBusConnectionString = configuration["AzureWebJobsServiceBus"]; } }
private void simpleButton1_Click(object sender, EventArgs e) { if (ValidNewPass()) { string _oldPass = this.te_oldPass.EditValue.ToString(); string _newPass = this.te_newPass.EditValue.ToString(); IAuthorize _authService = LoginConfig.GetAuthorizeInterface(); if (_authService.ChangePassWord(SessionClass.CurrentSinoUser.LoginName, _oldPass, _newPass, "")) { XtraMessageBox.Show("修改口令成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.OK; this.Close(); } else { XtraMessageBox.Show("修改口令失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.OK; this.Close(); } } }
public Member(IAuthorize authorize) { this.authorized = authorize.CheckAuthorize("ifew", "1234"); }
private IAuthorize _authorize; // // public CustomerManager(ILogging logging, ICaching caching, IAuthorize authorize) // { // _logging = logging; // bu normal yöntem _caching = caching; // _authorize = authorize; // } //