static void Main() { //using (MatchesContext db = new MatchesContext()) //{ // MatchEntity match = new MatchEntity(); // CoeffEntity coeff = new CoeffEntity(); // match.League = "EPL"; // match.StartTime = DateTime.Parse("10/12/2017 19:30"); // match.Teams = "Манчестер Юнайтед - Манчестер Сити"; // coeff.Formula = "П1"; // coeff.Coefficient = 3.25; // coeff.Holder = match; // db.Matches.Add(match); // db.SaveChanges(); // db.Coeffs.Add(coeff); // db.SaveChanges(); //} Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var startForm = new AuthorizationForm(); var model = new Model.UserListModel(); var messageService = new MessageBoxService(); var AuthPresenter = new AuthorizationFormPresenter(startForm, model, messageService); Application.Run(startForm); }
private void competedButton_Click(object sender, EventArgs e) { Form authorizationForm = new AuthorizationForm(); Hide(); authorizationForm.Show(); }
internal YApplication() { _authorizationForm = new AuthorizationForm { OnAuthorize = OnAuthorize, OnClose = Close }; _authorizationForm.Show(); }
public IActionResult Index() { var form = new AuthorizationForm { SamlIssuer = _secretsStore.GetSamlIssuer() }; return(View(form)); }
private void VkAuthButton_Click(object sender, RoutedEventArgs e) { var authorizer = new Authorizer(VkApiSettings.Instance); var url = authorizer.GenerateUrl(); var authorizationForm = new AuthorizationForm(CultureInfo.CurrentCulture, url, VkApiConstants.VkBlankUrl); authorizationForm.Authorized += (o, args) => { var sessionInfo = authorizer.GetSessionInfo(args.Url); var s = 20; }; authorizationForm.ShowDialog(); }
public void Intercept(IInvocation invocation) { var method = invocation.Method; if (method.IsDecoratedBy(typeof(AuthorizationRequiredAttribute))) { var loggedInUser = LoginService.LoggedInUser; var authorizationForm = new AuthorizationForm(); authorizationForm.ShowDialog(); } invocation.Proceed(); }
public async Task <IActionResult> GoToPz(AuthorizationForm authorizationForm, CancellationToken token) { _secretsStore.SetSamlIssuer(authorizationForm.SamlIssuer); var signingForm = new LoginForm.LoginForm( Environment.Test, authorizationForm.SamlIssuer, _x509Provider); var signingFormModel = await signingForm.BuildFormModel(new LoginFormBuildingArguments { AssertionConsumerServiceURL = Constants.PublicEndpoint + Url.Action("ConsumePzArtifact") }, token); return(View(signingFormModel)); }
private void FbAuthButton_Click(object sender, RoutedEventArgs e) { var authorizer = new FacebookApi.Actions.Authorizer(FbApiSettings.Instance); var url = authorizer.GenerateUrl(); var authorizationForm = new AuthorizationForm(CultureInfo.CurrentCulture, url, FbApiConstants.BlankUrl); authorizationForm.Authorized += (o, args) => { var sessionInfo = authorizer.GetSessionInfo(args.Url); var newSessionInfo = authorizer.RenewSessionInfo(sessionInfo); var d = 30; }; authorizationForm.ShowDialog(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AuthorizationForm AuthForm = new AuthorizationForm(); AuthForm.ShowDialog(); if (AuthForm.DialogResult == DialogResult.OK) { _IsAdmUser = AuthForm.IsAdmUser; Application.Run(new MainForm()); } else { return; } }
public static void login(string email, string pass, AuthorizationForm authorizationForm) { try { if (validator.checkAuthorization(dataService.getUserWithLogPass(email, pass))) { dataService.addSession(email, getMAC()); view.toMainForm(authorizationForm, dataService.isAdmin(getMAC()), dataService.isSuperAdmin(getMAC())); } else { view.getAuthorizationError(authorizationForm); } } catch (Exception e) { Console.WriteLine(e.Message); } }
private void changeUserToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); AuthorizationForm authForm = new AuthorizationForm(); authForm.StartPosition = FormStartPosition.CenterParent; if (authForm.ShowDialog() == DialogResult.OK) { this.Visible = true; this.employee = authForm.Empl; labelEmp.Text = employee.Name + " " + employee.Surname; returnLaw(); determineLaw(); } else { this.Close(); } }
private void EmplooyersForm_Load(object sender, EventArgs e) { try { Bitmap bitmap = new Bitmap(1, 1); Graphics.FromImage(bitmap).FillRectangle(Brushes.Transparent, new Rectangle(0, 0, 1, 1)); _mainIcon = Icon.FromHandle(bitmap.GetHicon()); } catch { } AuthorizationForm authorizationForm = new AuthorizationForm("CascadeManager", new Messages()); if (authorizationForm.ShowDialog() != DialogResult.OK) { _allowClose = true; Close(); } else { CurrentUser = authorizationForm.User; if (CurrentUser.Role == 2) { btUsers.Enabled = true; } else { btUsers.Enabled = false; } int[] actions = CurrentUser.GetActions(); for (int index = 0; index < actions.Length; ++index) { if (actions[index] == 8) { btObjects.Enabled = true; } if (actions[index] == 7) { btSettings.Enabled = true; } if (actions[index] == 0) { btFaces.Enabled = true; if (_faceForm == null || _faceForm.IsDisposed) { _faceForm = new FrmFaces(); _faceForm.MdiParent = this; } _faceForm.Icon = _mainIcon; _faceForm.Show(); } if (actions[index] == 12) { btStatistic.Enabled = true; } if (actions[index] == 13) { btResults.Enabled = true; } if (actions[index] == 10) { btCategories.Enabled = true; } if (actions[index] == 11) { btWorkStations.Enabled = true; } if (actions[index] == 6) { btSearch.Enabled = true; } if (actions[index] == 17) { btLogSearch.Enabled = true; } if (actions[index] == 4) { btQueryTemplates.Enabled = true; } } } }