Exemple #1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //w_main fw = new w_main();
            //Application.Run(fw);
            if (args.Length == 0)
            {
                if (PublicFun.start())
                {
                }
                else
                {
                    MessageBox.Show("数据库配置文件错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    w_database_set w_database_set = new w_database_set();
                    w_database_set.ShowDialog();
                    if (w_database_set.isCancel)
                    {
                    }
                    else
                    {
                        return;
                    }
                }


                //异步调用
                // Application.Run(form1);
                //getCustomerHandler gchandler = new getCustomerHandler(DataPublic.getCustomer);
                //IAsyncResult result = gchandler.BeginInvoke( new AsyncCallback(CallBackMethod), null);
                //异步调用结束

                //DataPublic.getCustomer();
                w_user users = new w_user();
                users.ShowDialog();
                if (users.DialogResult == DialogResult.OK)
                {
                    w_main form1 = new w_main();
                    form1.WindowState = FormWindowState.Maximized;
                    Application.Run(form1);
                }
                else
                {
                    return;
                }
            }



            /**
             * Form1 form1 = new Form1();
             * form1.WindowState = FormWindowState.Maximized;
             * Application.Run(form1);
             */
        }
Exemple #2
0
        private void 数据库设置ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            w_database_set w_database_set = new w_database_set();

            w_database_set.ShowDialog();
            if (w_database_set.isCancel)
            {
            }
            else
            {
                return;
            }
        }