private void AddBrrwrBtn_Click(object sender, EventArgs e)
        {
            string Name    = NameTxt.Text;
            string SSN     = SSNTxt.Text;
            string Address = AddressTxt.Text;
            string Phone   = PhoneTxt.Text;
            string Email   = EmailTxt.Text;

            bool SSN_Unique = Check_SSN(SSN);

            if (!string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(SSN) && !string.IsNullOrEmpty(Address))
            {
                SSN = Format_SSN(SSN);

                if (SSN_Unique == true)
                {
                    Execute_Add_Borrower(Name, SSN, Address, Phone, Email);
                }
                else
                {
                    MessageBox.Show("The SSN number provided is already in use.  Please enter another SSN or update the existing record.");
                }
            }
            else
            {
                MessageBox.Show("The values for Name, SSN, and Address must be filled in.");
            }

            NameTxt.Clear();
            SSNTxt.Clear();
            AddressTxt.Clear();
            PhoneTxt.Clear();
            EmailTxt.Clear();
            Load_Borrower_View();
        }
        private void Refresh()
        {
            StudentRegTxt.Clear();
            NameTxt.Clear();
            SurnameTxt.Clear();
            GenderCmb.ResetText();
            CellNTxt.Clear();
            EmailTxt.Clear();
            Postaltxt.ResetText();
            CourseCmb.ResetText();
            Statuscmb.ResetText();
            SemesterCmb.ResetText();
            dataGridView1.DataSource = DataAccess.GetStudents();

            dataGridView1.Columns["ID"].DisplayIndex            = 0;
            dataGridView1.Columns["Name"].DisplayIndex          = 1;
            dataGridView1.Columns["Surname"].DisplayIndex       = 2;
            dataGridView1.Columns["Gender"].DisplayIndex        = 3;
            dataGridView1.Columns["Cell"].DisplayIndex          = 4;
            dataGridView1.Columns["Email"].DisplayIndex         = 5;
            dataGridView1.Columns["PostalAddress"].DisplayIndex = 6;
            dataGridView1.Columns["CourseId"].DisplayIndex      = 7;
            dataGridView1.Columns["Semester"].DisplayIndex      = 8;
            dataGridView1.Columns["StatusId"].DisplayIndex      = 9;
        }
 private void CancelBtn_Click(object sender, EventArgs e)
 {
     NameTxt.Clear();
     SSNTxt.Clear();
     AddressTxt.Clear();
     PhoneTxt.Clear();
     EmailTxt.Clear();
 }
Exemplo n.º 4
0
 public void LoginToWebApp(string user, string pass)
 {
     Selenium.WaitUntilElementIsClickable(SignInLnk);
     SignInLnk.Click();
     EmailTxt.Clear();
     EmailTxt.SendKeys(user);
     PasswordTxt.Clear();
     PasswordTxt.SendKeys(pass);
     LoginBtn.Click();
 }
Exemplo n.º 5
0
 public void ResetForm()
 {
     FullNameTxt.Clear();
     PhoneTxt.Clear();
     EmailTxt.Clear();
     if (ActiveRdBtn.Checked)
     {
         DisabledRdBtn.Checked = false;
     }
     if (DisabledRdBtn.Checked)
     {
         ActiveRdBtn.Checked = false;
     }
 }
Exemplo n.º 6
0
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            if (FullNameTxt.Text == "")
            {
                MessageBox.Show("FullName daxil edin.");
            }
            if (PhoneTxt.Text == "")
            {
                MessageBox.Show("Phone nomreni daxil edin");
            }
            if (EmailTxt.Text == "")
            {
                MessageBox.Show("Email daxil edin");
            }

            if (ActiveRdBtn.Checked == false && DisabledRdBtn.Checked == false)
            {
                MessageBox.Show("Status sechin");
            }
            if (!string.IsNullOrEmpty(FullNameTxt.Text) && !string.IsNullOrEmpty(EmailTxt.Text) && !string.IsNullOrEmpty(PhoneTxt.Text) &&
                (ActiveRdBtn.Checked || DisabledRdBtn.Checked))
            {
                Customer customer = new Customer();

                customer.FullName = FullNameTxt.Text;
                customer.Status   = ActiveRdBtn.Checked ? true : false;
                customer.Phone    = PhoneTxt.Text;
                customer.Email    = EmailTxt.Text;

                _db.Customers.Add(customer);
                _db.SaveChanges();

                MessageBox.Show("Author Added:" + FullNameTxt.Text + "New Author");
                FullNameTxt.Clear();
                PhoneTxt.Clear();
                EmailTxt.Clear();
                ActiveRdBtn.Checked   = false;
                DisabledRdBtn.Checked = false;

                FillCustomers();
            }
        }