コード例 #1
0
 private void AddToOutvoice_Click(object sender, EventArgs e)
 {
     if (Products.SelectedIndex == -1 || Unit_Price.Text == "" || Quantity.Text == "" || Date.Text == "" || Reciever.Text == "")
     {
         MessageBox.Show("Inputs cant be empty", "Invalid inputs", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         float total = float.Parse(Unit_Price.Text) * Int32.Parse(Quantity.Text);
         bc.insert("outvoice", Int32.Parse(Products.SelectedValue.ToString()), float.Parse(Unit_Price.Text), Int32.Parse(Quantity.Text), total, Date.Text, Reciever.Text);
         dgv_outvoice.DataSource = bc.SelectAll("outvoice");
     }
 }