private void button3_Click(object sender, EventArgs e) { Dao.SupplierInfoDao da = new Dao.SupplierInfoDao(); if (this.textBox1.Text != "" && this.textBox2.Text != "" && this.textBox3.Text != "" && this.textBox4.Text != "" && this.textBox5.Text != "" && !string.IsNullOrWhiteSpace(this.textBox1.Text) && !string.IsNullOrWhiteSpace(this.textBox2.Text) && !string.IsNullOrWhiteSpace(this.textBox3.Text) && !string.IsNullOrWhiteSpace(this.textBox4.Text) && !string.IsNullOrWhiteSpace(this.textBox5.Text)) { if (IsEmail(this.textBox4.Text)) { da.SupplierCreate(this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, this.textBox4.Text, this.textBox5.Text, Convert.ToString((this.comboBox1.SelectedIndex) + 1)); MessageBox.Show("新增成功!!!", "Title"); SupplierInfoForm frm = new SupplierInfoForm(); Common.ContainerForm.NextForm(frm); } else { this.label11.Text = "請輸入正確的電子信箱!!!"; } } else { foreach (Control p in this.panel1.Controls) { if (p is TextBox) { p.Text = ""; } } MessageBox.Show("欄位不可為空值!!!"); } }
private void button3_Click(object sender, EventArgs e) { Dao.SupplierInfoDao da = new Dao.SupplierInfoDao(); da.SupplierUpdate(Convert.ToString((this.comboBox1.SelectedIndex) + 1), SupplierInfoForm.supplierName); MessageBox.Show("修改成功!!!", "Title"); SupplierInfoForm frm = new SupplierInfoForm(); Common.ContainerForm.NextForm(frm); }