private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { CallUser = null; frmLogIn fofo = new frmLogIn(); fofo.ShowDialog(); this.Close(); }
private void XtraMain_Load(object sender, EventArgs e) { #if (DEBUG && !ONLY_PIPE_TOOLS) frmLogIn LogIn = new frmLogIn(); if (LogIn.ShowDialog() == DialogResult.OK) { if (QyrUserInfo(LogIn.edtUserId.Text) != 0) { //어떻게 할래? } } #endif }
public frmMain() { using (frmLogIn logIn = new frmLogIn()) { if (logIn.ShowDialog() == DialogResult.OK) { InitializeComponent(); m_GestionCompteJoueur.ObtenirCompte(logIn._compte.NomJoueur); } else { System.Environment.Exit(1); } } }
private void Main_Load(object sender, EventArgs e) { SetModuleNames(); pnlSidebar.Enabled = false; SideBarPanelsVisibility(""); var logIn = new frmLogIn(); logIn.ShowDialog(); if (logIn.isLogIn) { SetDefaultData(); } else { Dispose(); } }
private void BtnLogout_Click(object sender, EventArgs e) { if (MessageBox.Show(@"Are you sure you want to logout?", @"Info", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { ClearData(); var logIn = new frmLogIn(); logIn.ShowDialog(); if (logIn.isLogIn) { SetDefaultData(); } else { Dispose(); } } }
private void btnOK_Click(object sender, EventArgs e) { string strCompanyID; try { if (strType == "Select") { if (lvDetails.SelectedItems.Count > 0) { ListViewItem itm = lvDetails.SelectedItems[0]; strCompanyID = itm.SubItems[0].Text; RegistryKey regKey = Registry.CurrentUser.CreateSubKey("SOFTWARE\\SmartAccounts"); if (regKey != null) { //string user = Environment.UserDomainName + "\\" + Environment.UserName; //RegistrySecurity rs = new RegistrySecurity(); //rs.AddAccessRule(new RegistryAccessRule(user, RegistryRights.ReadKey | RegistryRights.WriteKey | RegistryRights.Delete, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow));//To allow permission //RegistryKey rk = Registry.CurrentUser.CreateSubKey("SOFTWARE\\SmartAccounts"); regKey.SetValue("CompanyID", strCompanyID); regKey.Close(); } Utility.strDataBase = "SMART" + strCompanyID; Utility.gSelectCompanyName(strCompanyID, "NO"); //string s = accms.gSelectCompanyName(strCompanyID); if (Utility.gblnAccessControl == true) { if (System.Windows.Forms.Application.OpenForms["frmMain"] as frmMain == null) { frmMain objfrmmain = new frmMain(); objfrmmain.intCheckBackup = 1; objfrmmain.Close(); } else { ((frmMain)Application.OpenForms["frmMain"]).Text = Utility.gstrCompanyID + "-" + Utility.gstrCompanyName + " - " + Convert.ToDateTime(Utility.gdteFinancialYearFrom).ToString(Utility.DEFAULT_DATE_FORMAT) + " to " + Convert.ToDateTime(Utility.gdteFinancialYearTo).ToString(Utility.DEFAULT_DATE_FORMAT); frmMain objfrm = (frmMain)Application.OpenForms["frmMain"]; objfrm.intCheckBackup = 1; objfrm.Close(); } this.Close(); if (System.Windows.Forms.Application.OpenForms["frmLogIn"] as frmLogIn == null) { frmLogIn objfrmlogin = new frmLogIn(); objfrmlogin.mload(); objfrmlogin.ShowDialog(); } else { frmLogIn objfrmlogin = (frmLogIn)Application.OpenForms["frmLogIn"]; objfrmlogin.mload(); objfrmlogin.Show(); objfrmlogin.Focus(); } //frmLogIn objfrmlogin = new frmLogIn(); //objfrmlogin.ShowDialog(); } else { //this.Dispose(); //frmMain objfrm = new frmMain(); ////((frmMain)Application.OpenForms["frmMain"]).Text = s; //objfrm.Refresh(); //((frmMain)Application.OpenForms["frmMain"]).Text = Utility.gstrCompanyID + "-" + Utility.gstrCompanyName + " - " + Convert.ToDateTime(Utility.gdteFinancialYearFrom).ToString(Utility.DEFAULT_DATE_FORMAT) // + " to " + Convert.ToDateTime(Utility.gdteFinancialYearTo).ToString(Utility.DEFAULT_DATE_FORMAT); if (System.Windows.Forms.Application.OpenForms["frmMain"] as frmMain == null) { frmMain objfrmmain = new frmMain(); objfrmmain.intCheckBackup = 1; //objfrmmain.Show(); } else { ((frmMain)Application.OpenForms["frmMain"]).Text = Utility.gstrCompanyID + "-" + Utility.gstrCompanyName + " - " + Convert.ToDateTime(Utility.gdteFinancialYearFrom).ToString(Utility.DEFAULT_DATE_FORMAT) + " to " + Convert.ToDateTime(Utility.gdteFinancialYearTo).ToString(Utility.DEFAULT_DATE_FORMAT); frmMain objfrm = (frmMain)Application.OpenForms["frmMain"]; objfrm.intCheckBackup = 1; objfrm.Focus(); } this.Close(); } } } else { if (lvDetails.SelectedItems.Count > 0) { ListViewItem itm = lvDetails.SelectedItems[0]; strCompanyID = "SMART" + itm.SubItems[0].Text; string strmsg = Utility.DeleteCompnay(itm.SubItems[0].Text, strCompanyID); if (strmsg == "1") { //Utility.creaateWrite("0001"); Utility.Kill("DeepLaid"); this.Dispose(); } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }