示例#1
0
        public Login(DBCtrl dbc)
        {
            InitializeComponent();
            dbCtrl = dbc;
            RegistryKey reg;

            reg = Registry.LocalMachine.CreateSubKey("Software\\AsTEK\\Pomanager");

            textBox_server.Text = reg.GetValue("SERVER", "").ToString();
            textBox_ID.Text     = reg.GetValue("ID", "").ToString();
            reg.Close();
            //textBox_server.Text = "localhost\\SQLEXPRESS";
        }
示例#2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            dbCtrl = new DBCtrl();
            Login login = new Login(dbCtrl);

            if (login.ShowDialog() == DialogResult.OK)
            {
                this.Text = login.GetCompanyName();
                PurchaseOrdersForm purchaseOrderForm = new PurchaseOrdersForm();
                purchaseOrderForm.MdiParent = this;
                purchaseOrderForm.Show();
                purchaseOrderForm.WindowState = FormWindowState.Maximized;
            }
            else
            {
                this.Close();
            }
        }