Exemple #1
0
        protected override void OnLoggingOn(LogonEventArgs args)
        {
            base.OnLoggingOn(args);

            string database = ((IDatabaseNameParameter)args.LogonParameters).DatabaseName;

            if (!String.IsNullOrEmpty(((CustomLogonParametersForStandardAuthentication)args.LogonParameters).UserName))
            {
                IJSRuntime jsruntime = ServiceProvider.GetRequiredService <IJSRuntime>();
                jsruntime.InvokeVoidAsync("methods.CreateCookie", "NewKey3", database, 1);
            }

            if (database == "Select DB")
            {
                IHttpContextAccessor contextAccessor = ServiceProvider.GetRequiredService <IHttpContextAccessor>();
                database = contextAccessor.HttpContext.Request.Cookies["NewKey3"];
            }

            if (!String.IsNullOrEmpty(database))
            {
                MSSqlServerChangeDatabaseHelper.UpdateDatabaseName(this, database);
            }
        }
Exemple #2
0
 protected override void OnLoggingOn(LogonEventArgs args)
 {
     base.OnLoggingOn(args);
     MSSqlServerChangeDatabaseHelper.UpdateDatabaseName(this, ((IDatabaseNameParameter)args.LogonParameters).DatabaseName);
 }