//order update private void button3_Click(object sender, EventArgs e) { if (dba.updateOrders(orderIDlabel.Text, cusIDtextBox.Text, Convert.ToString(typecomboBox.SelectedItem), Convert.ToString(sizecomboBox.SelectedItem), ColortextBox.Text, DesigntextBox.Text, QuantytextBox.Text, Convert.ToString(ortypecomboBox.SelectedItem), ordateTimePicker.Value.Date.ToString("MM/dd/yyyy"), duedateTimePicker.Value.Date.ToString("MM/dd/yyyy"), Convert.ToString(comstatecomboBox.SelectedItem), fullpaytextBox.Text, advancetextBox.Text, labelarrear.Text, Convert.ToString(substatuscomboBox.SelectedItem), subdatetextBox.Text)) { MessageBox.Show("Successfully Updated"); Form4 f4 = new Form4(); this.Visible = false; f4.Visible = true; f4.FillGridO(); } else { MessageBox.Show("Error occured"); } }
//Add orders private void button2_Click(object sender, EventArgs e) { if (cusIDtextBox.Text == "" || Convert.ToString(ortypecomboBox.SelectedItem) == "" || QuantytextBox.Text == "" || ordateTimePicker.Value.Date.ToString("MM/dd/yyyy") == "" || duedateTimePicker.Value.Date.ToString("MM/dd/yyyy") == "" || Convert.ToString(comstatecomboBox.SelectedItem) == "" || fullpaytextBox.Text == "" || advancetextBox.Text == "" || labelarrear.Text == "" || Convert.ToString(substatuscomboBox.SelectedItem) == "") { MessageBox.Show("please enter the all details "); } else if (dba.addOrders(cusIDtextBox.Text, Convert.ToString(typecomboBox.SelectedItem), Convert.ToString(sizecomboBox.SelectedItem), ColortextBox.Text, DesigntextBox.Text, (float)Convert.ToDouble(QuantytextBox.Text), Convert.ToString(ortypecomboBox.SelectedItem), ordateTimePicker.Value.Date.ToString("MM/dd/yyyy"), duedateTimePicker.Value.Date.ToString("MM/dd/yyyy"), Convert.ToString(comstatecomboBox.SelectedItem), fullpaytextBox.Text, advancetextBox.Text, labelarrear.Text, Convert.ToString(substatuscomboBox.SelectedItem), subdatetextBox.Text)) { MessageBox.Show("Successfully Added"); Form4 f4 = new Form4(); f4.Visible = true; this.Visible = false; f4.FillGridO(); } else { MessageBox.Show("Error occured"); } this.Dispose(); f4.FillGrid(); }