Exemplo n.º 1
0
        private void validationSave()
        {
            // SupplierId_txtbx FirstName_txtbx LastName_txtbx Address_txtbx PhoneNum_txtbx Country_combx

            if (SupplierId_txtbx.Text != "")
            {
                string txt = SupplierId_txtbx.Text;
                int    minValue;

                if (int.TryParse(txt, out minValue))
                {
                    if (FirstName_txtbx.Text != "")
                    {
                        if (LastName_txtbx.Text != "")
                        {
                            if (Address_txtbx.Text != "")
                            {
                                if (PhoneNum_txtbx.Text != "")
                                {
                                    string txtp = PhoneNum_txtbx.Text;
                                    long   minValuep;

                                    if (long.TryParse(txtp, out minValuep))
                                    {
                                        string txtpp = PhoneNum_txtbx.Text;

                                        if (!(txtpp.Length != 11))
                                        {
                                            if (Country_combx.Text != "")
                                            {
                                                dbaseSupplierSave(SupplierId_txtbx.Text, FirstName_txtbx.Text, LastName_txtbx.Text, Address_txtbx.Text, PhoneNum_txtbx.Text, Country_combx.Text);
                                            }
                                            else
                                            {
                                                MessageBox.Show("Country is not filled ");
                                                Country_combx.Focus();
                                            }
                                        }
                                        else
                                        {
                                            MessageBox.Show("Phone Number can only be 11 Digits");
                                            PhoneNum_txtbx.Focus();
                                        }
                                    }
                                    else
                                    {
                                        MessageBox.Show("Phone Number can only be Digits");
                                        PhoneNum_txtbx.Focus();
                                    }
                                }
                                else
                                {
                                    MessageBox.Show("Phone Number is not filled ");
                                    PhoneNum_txtbx.Focus();
                                }
                            }
                            else
                            {
                                MessageBox.Show("Address is not filled ");
                                Address_txtbx.Focus();
                            }
                        }
                        else
                        {
                            MessageBox.Show("Last Name is not filled ");
                            LastName_txtbx.Focus();
                        }
                    }
                    else
                    {
                        MessageBox.Show("First Name is not filled ");
                        FirstName_txtbx.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("supplier Id can only be Digits");
                }
                SupplierId_txtbx.Focus();
            }
            else
            {
                MessageBox.Show("Supplier ID is not filled ");
                SupplierId_txtbx.Focus();
            }
        }
Exemplo n.º 2
0
        private void validationSave()
        {
            //EmployeeID_txtbx   FirstName_txtbx   LastName_txtbx   City_cmbbx    PhoneNumber_txtbx

            if (EmployeeID_txtbx.Text != "")
            {
                string txt = EmployeeID_txtbx.Text;
                int    minValue;
                if (int.TryParse(txt, out minValue))
                {
                    if (FirstName_txtbx.Text != "")
                    {
                        if (LastName_txtbx.Text != "")
                        {
                            if (City_cmbbx.Text != "")
                            {
                                if (PhoneNumber_txtbx.Text != "")
                                {
                                    string txtp = PhoneNumber_txtbx.Text;
                                    long   minValuep;

                                    if (long.TryParse(txtp, out minValuep))
                                    {
                                        string txtpp = PhoneNumber_txtbx.Text;

                                        if (!(txtpp.Length != 11))
                                        {
                                            dbaseEmployeeSave(EmployeeID_txtbx.Text, FirstName_txtbx.Text, LastName_txtbx.Text,
                                                              City_cmbbx.Text, PhoneNumber_txtbx.Text);
                                        }
                                        else
                                        {
                                            MessageBox.Show("Phone Number can only be 11 Digits");
                                            PhoneNumber_txtbx.Focus();
                                        }
                                    }
                                    else
                                    {
                                        MessageBox.Show("Phone Number must be a Number ");
                                        PhoneNumber_txtbx.Focus();
                                    }
                                }
                                else
                                {
                                    MessageBox.Show("Phone Number is not filled ");
                                    PhoneNumber_txtbx.Focus();
                                }
                            }
                            else
                            {
                                MessageBox.Show("City is not filled ");
                                City_cmbbx.Focus();
                            }
                        }
                        else
                        {
                            MessageBox.Show("Last Name is not filled ");
                            LastName_txtbx.Focus();
                        }
                    }
                    else
                    {
                        MessageBox.Show("First Name is not filled ");
                        EmployeeID_txtbx.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("Employee ID must be a Number ");
                    EmployeeID_txtbx.Focus();
                }
            }
            else
            {
                MessageBox.Show("Employee ID is not filled ");
                EmployeeID_txtbx.Focus();
            }
        }