public static void UpdateSchedule(UpdateSchedule u)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
     {
         cnn.Execute("update Schedule set client = @client where date = @date", u);
     }
 }
        private void makeOrderButton_Click(object sender, EventArgs e)
        {
            int            help     = 0;
            Order          newOrder = new Order();
            UpdateSchedule us       = new UpdateSchedule();

            if (Convert.ToString(comboDate.SelectedItem) == "" || Convert.ToString(comboJumpType.SelectedItem) == "")
            {
                MessageBox.Show("Please check if all data is correct");
            }
            else if (couponNumber.Text != "")
            {
                for (int i = 0; i < coupones.Count; i++)
                {
                    if (coupones[i].code == couponNumber.Text)
                    {
                        newOrder.coupon = coupones[i].ID;
                        i    = coupones.Count + 1;
                        help = 1;
                    }
                }
                if (help == 0)
                {
                    MessageBox.Show("You entered wrong code. Please try again!");
                }
                else
                {
                    if (comboEquipment.SelectedIndex != -1)
                    {
                        newOrder.equipment = comboEquipment.SelectedIndex;
                    }
                    newOrder.peopleNumber = Convert.ToInt32(peopleNUpDown.Value);
                    newOrder.ID           = orders.Count;
                    newOrder.admin        = 0;
                    newOrder.schedule     = comboDate.SelectedIndex;
                    newOrder.jumpType     = comboJumpType.SelectedIndex;
                    newOrder.status       = "Confirming";
                    us.client             = State.ActiveClient.ID;
                    us.date = (string)comboDate.SelectedItem;
                    for (int j = 0; j < additionalJumpers2.Count; j++)
                    {
                        DataBase.SaveAdditionalJumpers(additionalJumpers2[j]);
                    }
                    DataBase.UpdateSchedule(us);
                    DataBase.SaveOrder(newOrder);
                    UpdateData();
                    MessageBox.Show("Your order has been saved");

                    comboDate.Text      = "";
                    comboEquipment.Text = "";
                    comboJumpType.Text  = "";
                    couponNumber.Text   = "";
                    peopleNUpDown.Value = 0;
                    addJumperHelper2    = 0;
                    addJumperHelper     = additionalJumpers.Count;
                    additionalJumpers2.Clear();
                }
            }
            else
            {
                if (comboEquipment.SelectedIndex != -1)
                {
                    newOrder.equipment = comboEquipment.SelectedIndex;
                }
                newOrder.peopleNumber = Convert.ToInt32(peopleNUpDown.Value);
                newOrder.ID           = orders.Count;
                newOrder.admin        = 0;
                newOrder.schedule     = comboDate.SelectedIndex;
                newOrder.jumpType     = comboJumpType.SelectedIndex;
                newOrder.status       = "Confirming";
                us.client             = State.ActiveClient.ID;
                us.date = (string)comboDate.SelectedItem;
                for (int j = 0; j < additionalJumpers2.Count; j++)
                {
                    DataBase.SaveAdditionalJumpers(additionalJumpers2[j]);
                }
                DataBase.UpdateSchedule(us);
                DataBase.SaveOrder(newOrder);
                UpdateData();
                MessageBox.Show("Your order has been saved");

                comboDate.Text      = "";
                comboEquipment.Text = "";
                comboJumpType.Text  = "";
                couponNumber.Text   = "";
                peopleNUpDown.Value = 0;
                addJumperHelper2    = 0;
                addJumperHelper     = additionalJumpers.Count;
                additionalJumpers2.Clear();
            }
        }