private void button_next_acc_cr_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure to want to continue??", "QUESTION", MessageBoxButtons.YesNo, MessageBoxIcon.Question);


            if (result == DialogResult.Yes)
            {
                if (txt_ApplicantIdentifier.Text == "" || txt_ApplicantFirstName.Text == "" || txt_ApplicantSecondName.Text == "" || txt_ApplicantPlaceOfBirth.Text == "" || cb_ApplicantNationality.Text == "" || cb_ApplicantMeritalStatus.Text == "" || txt_ApplicantNameOfSpouse.Text == "" || txt_ApplicantProffesional.Text == "" || cb_Applicantcode.Text == "" || txt_ApplicantMobileNumber.Text == "" || txt_ApplicantIdCard.Text == "" || txt_ApplicantConsideration.Text == "" || txt_ApplicantCountryName.Text == "" || txt_ApplicantProvince.Text == "" || txt_ApplicantTown.Text == "" || txt_ApplicantTownship.Text == "" || txt_ApplicantQuarter.Text == "" || txt_ApplicantAvenue.Text == "" || txt_ApplicantHouseNumber.Text == "")
                {
                    MessageBox.Show("You are not allowed to go to next step without saving Applicant details");
                }
                else
                {
                    if (!Form1.instance.pane3.Controls.ContainsKey("BankAccountDetails"))
                    {
                        Form1.instance.pane3.Controls.Clear();
                        BankAccountDetails user = new BankAccountDetails();
                        user.Dock = DockStyle.None;
                        Form1.instance.pane3.Controls.Add(user);
                        user.Location = new Point(250, 0);
                    }
                    Form1.instance.pane3.Controls["BankAccountDetails"].BringToFront();
                }
            }
            else
            {
            }
        }
Exemplo n.º 2
0
 private void button_next_acc_cr_Click(object sender, EventArgs e)
 {
     if (cb_ApplicantReq.SelectedItem == "YES")
     {
         DialogResult result = MessageBox.Show("Are you sure to want to continue??", "QUESTION", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (result == DialogResult.Yes)
         {
             if (txt_FirstName.Text == "" || txt_SecondName.Text == "" || date_Birth.Text == "" || txt_PlaceOfBirth.Text == "" || cb_Nationality.Text == "" || cb_MeritalStatus.Text == "" || txt_NameOfSpouse.Text == "" || txt_Proffesional.Text == "" || cb_code.Text == "" || txt_MobileNumber.Text == "" || txt_CountryName.Text == "" || txt_Province.Text == "" || txt_Town.Text == "" || txt_Township.Text == "" || txt_Quarter.Text == "" || txt_Avenue.Text == "" || txt_HouseNumber.Text == "")
             {
                 MessageBox.Show("You are not allowed to go to next step without completing all Personnal details required");
             }
             else
             {
                 if (!Form1.instance.pane3.Controls.ContainsKey("ApplicantDetails"))
                 {
                     Form1.instance.pane3.Controls.Clear();
                     ApplicantDetails user = new ApplicantDetails();
                     user.Dock = DockStyle.Fill;
                     Form1.instance.pane3.Controls.Add(user);
                 }
                 Form1.instance.pane3.Controls["ApplicantDetails"].BringToFront();
             }
         }
         else
         {
             DialogResult Result = MessageBox.Show("Obligated to make the Applicants requirement", "WARMING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else if (cb_ApplicantReq.SelectedItem == "NO")
     {
         DialogResult result = MessageBox.Show("Are you sure to want to continue??", "QUESTION", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (result == DialogResult.Yes)
         {
             if (txt_FirstName.Text == "" || txt_SecondName.Text == "" || date_Birth.Text == "" || txt_PlaceOfBirth.Text == "" || cb_Nationality.Text == "" || cb_MeritalStatus.Text == "" || txt_NameOfSpouse.Text == "" || txt_Proffesional.Text == "" || cb_code.Text == "" || txt_MobileNumber.Text == "" || txt_CountryName.Text == "" || txt_Province.Text == "" || txt_Town.Text == "" || txt_Township.Text == "" || txt_Quarter.Text == "" || txt_Avenue.Text == "" || txt_HouseNumber.Text == "")
             {
                 MessageBox.Show("You are not allowed to go to next step without completing all Personnal details required");
             }
             else
             {
                 if (!Form1.instance.pane3.Controls.ContainsKey("BankAccountDetails"))
                 {
                     Form1.instance.pane3.Controls.Clear();
                     BankAccountDetails user = new BankAccountDetails();
                     user.Dock = DockStyle.None;
                     Form1.instance.pane3.Controls.Add(user);
                     user.Location = new Point(250, 0);
                 }
                 Form1.instance.pane3.Controls["BankAccountDetails"].BringToFront();
             }
         }
         else
         {
         }
     }
 }
        private void button_save_applicant_Click(object sender, EventArgs e)
        {
            try
            {
                SqlCommand     cmd = new SqlCommand("SELECT Identifier FROM APPLICANT_DETAILS WHERE Identifier = '" + txt_ApplicantIdentifier.Text + "'", conn);
                SqlDataAdapter da  = new SqlDataAdapter(cmd);
                DataTable      dt  = new DataTable();
                da.Fill(dt);

                if (dt.Rows.Count >= 1)
                {
                    DialogResult result = MessageBox.Show("The Account Name  " + txt_ApplicantIdentifier.Text + " already has an applicant, Do you want to Add another applicant for this account?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result == DialogResult.Yes)
                    {
                        if (txt_ApplicantIdentifier.Text == "" || txt_ApplicantFirstName.Text == "" || txt_ApplicantSecondName.Text == "" || txt_ApplicantPlaceOfBirth.Text == "" || cb_ApplicantNationality.Text == "" || cb_ApplicantMeritalStatus.Text == "" || txt_ApplicantNameOfSpouse.Text == "" || txt_ApplicantProffesional.Text == "" || cb_Applicantcode.Text == "" || txt_ApplicantMobileNumber.Text == "" || txt_ApplicantIdCard.Text == "" || txt_ApplicantConsideration.Text == "" || txt_ApplicantCountryName.Text == "" || txt_ApplicantProvince.Text == "" || txt_ApplicantTown.Text == "" || txt_ApplicantTownship.Text == "" || txt_ApplicantQuarter.Text == "" || txt_ApplicantAvenue.Text == "" || txt_ApplicantHouseNumber.Text == "")
                        {
                            MessageBox.Show("You miss some fields");
                        }
                        else
                        {
                            Saved();
                        }
                    }
                    else
                    {
                        if (!Form1.instance.pane3.Controls.ContainsKey("BankAccountDetails"))
                        {
                            Form1.instance.pane3.Controls.Clear();
                            BankAccountDetails user = new BankAccountDetails();
                            user.Dock = DockStyle.None;
                            Form1.instance.pane3.Controls.Add(user);
                            user.Location = new Point(250, 0);
                        }
                        Form1.instance.pane3.Controls["BankAccountDetails"].BringToFront();
                    }
                }
                else
                {
                    if (txt_ApplicantIdentifier.Text == "" || txt_ApplicantFirstName.Text == "" || txt_ApplicantSecondName.Text == "" || txt_ApplicantPlaceOfBirth.Text == "" || cb_ApplicantNationality.Text == "" || cb_ApplicantMeritalStatus.Text == "" || txt_ApplicantNameOfSpouse.Text == "" || txt_ApplicantProffesional.Text == "" || cb_Applicantcode.Text == "" || txt_ApplicantMobileNumber.Text == "" || txt_ApplicantIdCard.Text == "" || txt_ApplicantConsideration.Text == "" || txt_ApplicantCountryName.Text == "" || txt_ApplicantProvince.Text == "" || txt_ApplicantTown.Text == "" || txt_ApplicantTownship.Text == "" || txt_ApplicantQuarter.Text == "" || txt_ApplicantAvenue.Text == "" || txt_ApplicantHouseNumber.Text == "")
                    {
                        MessageBox.Show("You miss some fields");
                    }
                    else
                    {
                        Saved();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }