コード例 #1
0
 private void BTN_AddItem_Click(object sender, EventArgs e)
 {
     try
     {
         Item item = new Item()
         {
             name        = TXTB_AddName.Text,
             stock       = int.Parse(TXTB_AddStock.Text),
             price       = double.Parse(TXTB_AddPrice.Text),
             course      = DB_AddCourse.Text,
             description = TXTB_AddDescription.Text,
             tax         = int.Parse(DB_AddTAX.Text.Substring(0, 1)),
             foodtype    = DB_AddType.Text
         };
         itemLogic.Additem(item);
         MessageBox.Show("Item was succesfully Added");
         ShowPanel("PNL_ManageStock");
     }
     catch
     {
         MessageBox.Show("Niet alle velden zijn gevuld");
     }
 }