internal void Close() { if (!YIoc.Get <YAuthorization>().IsAuthorize) { Application.Exit(); } }
internal string OnAuthorize(string login, string password) { try { YIoc.Get <YAuthorization>().Authorize(login, password); } catch (Exception) { return("sorry, database error."); } if (YIoc.Get <YAuthorization>().IsAuthorize) { _authorizationForm.Close(); MainForm = new MainForm(); MainForm.Show(); return(string.Empty); } return("authorization failed."); }
internal void Authorize(string login, string password) { int count = Convert.ToInt32(YIoc.Get <UsersTableAdapter>().AuthorizeByLoginAndPassword(login, password)); IsAuthorize = count == 1; }