Example #1
0
        //注销
        private void btnCancle_Click(object sender, EventArgs e)
        {
            if (CJia.Health.Tools.Message.ShowQuery("是否确认注销", CJia.Health.Tools.Message.Button.YesNo) == CJia.Health.Tools.Message.Result.Yes)
            {
                if (CJia.Health.Tools.Help.SystemInitConfig())
                {
                    UI.LoginView login = new UI.LoginView();
                    CJia.Health.Tools.Help.NewNoBorderForm(login);
                    if (User.IsLoginSuccess)
                    {
                        if (this.Controls != null)
                        {
                            for (int i = 0; i < this.Controls.Count; i++)
                            {
                                this.Controls[i].Dispose();
                            }
                        }
                        this.Controls.Clear();
                        this.FormClosing -= new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
                        InitializeComponent();

                        while (cJiaTabControl1.TabPages.Count > 0)
                        {
                            cJiaTabControl1.TabPages[0].Dispose();
                        }
                        Init();
                        mainFormArgs.UserID = User.UserData.Rows[0]["USER_ID"].ToString();
                        OnInitFunction(null, mainFormArgs);
                    }
                }
            }
        }
Example #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ThreadException += Application_ThreadException;
            Init();
            string isDev = CJia.Health.Tools.ConfigHelper.GetAppStrings("isDev");

            if (isDev == "0")
            {
                LoginWaitFrm frm = new LoginWaitFrm();
                frm.Show();
                Application.DoEvents();
                UI.LoginView login = new UI.LoginView();
                frm.Close();
                CJia.Health.Tools.Help.NewNoBorderForm(login);
            }
            else
            {
                LoginFrom log = new LoginFrom();
                log.ShowDialog();
            }
            if (User.IsLoginSuccess)
            {
                Application.Run(new NewMainForm());
            }
        }