예제 #1
0
        private void checkStudent()
        {
            if (!idTextbox.Text.Equals(""))
            {
                loadingScreen.Show();
                this.Enabled = false;
                //Load customer from database (might take awhile, put a loading screen)
                string   customerId = idTextbox.Text.ToUpper();
                Customer c          = CustomerDAO.getInstance().getCustomer(customerId);
                this.Enabled = true;
                loadingScreen.Hide();

                if (c == null)
                {
                    clearData();
                    AddNewStudent addNewStudent = new AddNewStudent();
                    DialogResult  result        = addNewStudent.ShowDialog();
                    if (result.Equals(DialogResult.No))
                    {
                        clearData();
                    }
                    else if (result.Equals(DialogResult.Yes))
                    {
                        clearData();
                        idTextbox.Text = customerId;
                    }
                }
                else
                {
                    loadCustomer(c);
                }
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: orette/southville
        private void checkStudent()
        {
            if (!idTextbox.Text.Equals(""))
            {

                loadingScreen.Show();
                this.Enabled = false;
                //Load customer from database (might take awhile, put a loading screen)
                string customerId = idTextbox.Text.ToUpper();
                Customer c = CustomerDAO.getInstance().getCustomer(customerId);
                this.Enabled = true;
                loadingScreen.Hide();

                if (c == null)
                {
                    clearData();
                    AddNewStudent addNewStudent = new AddNewStudent();
                    DialogResult result = addNewStudent.ShowDialog();
                    if (result.Equals(DialogResult.No))
                    {
                        clearData();
                    }
                    else if (result.Equals(DialogResult.Yes))
                    {
                        clearData();
                        idTextbox.Text = customerId;
                    }
                }
                else
                {
                    loadCustomer(c);
                }

            }
        }