Пример #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            int iid = 0;

            if ((String.IsNullOrEmpty(name.Text)) || (String.IsNullOrEmpty(address.Text)) || (String.IsNullOrEmpty(mobile.Text)) || (String.IsNullOrEmpty(email.Text)))
            {
                MessageBox.Show("Some Fields have been left blank");
            }
            else if ((mobile.Text).ToString().Length != 10)
            {
                MessageBox.Show("Mobile Number invalid.It must be of 10 digits");
            }
            else
            {
                String ll = "";
                if (!String.IsNullOrEmpty(landline.Text))
                {
                    ll = landline.Text;
                }
                OracleCommand    cmdc = new OracleCommand("select * from supplier order by supplier_id", con);
                OracleDataReader odr  = cmdc.ExecuteReader();
                while (odr.Read())
                {
                    iid = Int32.Parse((odr["supplier_id"].ToString()));
                }
                iid = iid + 1;
                OracleCommand    cmd1 = new OracleCommand("insert into supplier values(" + iid.ToString() + ",'" + name.Text + "','" + address.Text + "'," + mobile.Text + "," + ll + ",'" + email.Text + "')", con);
                OracleDataReader odr2 = cmd1.ExecuteReader();
                MessageBox.Show("Supplier Added Succesfully");
                SupTable a = new SupTable();
                a.Show();
                this.Hide();
            }
        }
Пример #2
0
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            SupTable et = new SupTable();

            et.Show();
            this.Hide();
        }