public void ShowDialog() { if (!LCY_DBTools.DBTool.TestConnString(LCY_DBTools.DBTool.GetConnString())) { return; } if (UserType == LCY_Database.UserType.NONE) { using (FrmLogon f = new FrmLogon()) { if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { UserType = f.GetUserType(); } else { return; } } } using (FrmUpload f = new FrmUpload(UserType)) { f.ShowDialog(); } }
private void BntLogoff_Click(object sender, EventArgs e) { this.Hide(); FrmLogon fl = new FrmLogon(); fl.Show(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); #if Release if (!ReadKey()) { MessageBox.Show("对不起试用版已经过期!请尽快付费!"); return; } FrmLogon logon = new FrmLogon(); if (logon.ShowDialog() == DialogResult.OK) { logon.Close(); Application.Run(new FrmMain()); } #else Application.Run(new FrmMain()); //Application.Run(new FrmTest()); //Application.Run(new Form1()); #endif }
private static void Main(string[] args) { ConstEnvironment.CallInModel = true; Application.ThreadException += new ThreadExceptionEventHandler(ClientData.Application_ThreadException); if (!ClientData.OpenExistApp()) { Application.EnableVisualStyles(); if (args.Length > 0) { string param = args[0]; ClientData.UseStartParameter(param); } RemoteProxy.SetCallExcuteName(); FrmVerify.GetFingerCltDefalut = (GetFingerCltDefalutEventHandler)Delegate.Combine(FrmVerify.GetFingerCltDefalut, new GetFingerCltDefalutEventHandler(UIFinger.GetFingerCltDefalut)); PLPassWordChecker.ResetPassWord = (ResetPassWord)Delegate.Combine(PLPassWordChecker.ResetPassWord, new ResetPassWord(FrmSetPsnPwd.ResetUserPassWord)); ClientData.AutoCopyLiveUpdateFiles(); if (FrmLogon.Logon(PLMProductName.TiModeler.ToString())) { try { SplashHelper.Instance.ShowSplashForm(ConstCommon.FUNCTION_EDMS ? "TiModeler.edm" : "TiModeler.plm"); PSInit.InitPS(ClientData.LogonUser, true); Thyt.TiPLM.CLT.TiModeler.FrmMain frmMain = new Thyt.TiPLM.CLT.TiModeler.FrmMain(); ClientData.mainForm = frmMain; BPMEventInit.InitBPMEvent(); UIMessage.Instance.InitilizeMessage(frmMain); MenuBuilder.Instance.Init(); PLProject.Instance.ProjDelegateInstance = (ProjDelegate)Delegate.Combine(PLProject.Instance.ProjDelegateInstance, new ProjDelegate(UIProject.ProjDelegateEvent)); SplashHelper.Instance.CloseSplashForm(); Application.Run(frmMain); frmMain.Dispose(); } catch (Exception exception) { MessageBox.Show(exception.Message, "TiModeler", MessageBoxButtons.OK, MessageBoxIcon.Hand); } finally { LogOff(); } } } }
/// <returns> /// 登录成功返回true /// </returns> public static bool Login() { string product = "TiDesk"; bool isLogin = false; try { //product += "Unknown"; // MessageBox.Show("1"); if (FrmLogon.Logon(product, true)) { if (Init()) { isLogin = true; } } } catch (Exception ex) { PrintException.Print(ex); } return(isLogin); }