コード例 #1
0
        private void SubmitPaymentButton_Click(object sender, RoutedEventArgs e)
        {
            string connectionString;

            connectionString =
                "Data Source=(local);Initial Catalog=ML635064021;"
                + "Integrated Security=true";
            SqlConnection connection = new SqlConnection(connectionString);
            SqlCommand    payments   = connection.CreateCommand();

            payments.CommandText = "INSERT INTO PAYMENTS (Lease_Terms_ID, Date, Amount)" +
                                   " VALUES (@LeaseId, @DateEntry, @AmountEntry)";
            payments.Parameters.AddWithValue("@LeaseId", LeaseIDBox.Text);
            payments.Parameters.AddWithValue("@DateEntry", DateBox.Text);
            payments.Parameters.AddWithValue("@AmountEntry", AmountBox.Text);
            try
            {
                connection.Open();
                payments.ExecuteNonQuery();
                MessageBox.Show("Payment Successfuly Added!");
            }
            catch
            {
                MessageBox.Show("Something went wrong!");
            }
            finally
            {
                connection.Close();

                DateBox.Clear();
                AmountBox.Clear();
                LeaseIDBox.Clear();
            }
        }
 private void Clear_All_Entries()
 {
     USNBox.Clear();
     ScholarshipNameList.ClearSelected();
     SearchBox.Clear();
     AmountBox.Clear();
     DataView.DataSource = null;
 }
コード例 #3
0
 private void Clear_All_Entries()
 {
     EmployeeIDBox.Clear();
     AmountBox.Clear();
     CategoryList.ClearSelected();
     SearchBox.Clear();
     DataView.DataSource = null;
 }
コード例 #4
0
        //-------------------------User control buttons--------------------------------
        private void Change_Click(object sender, RoutedEventArgs e)
        {
            mainGrid.IsEnabled = false;
            changeAddFlag      = false;
            //This is important... Used to determine which step it's on
            var _ingNum = sender as Button;

            ingNum = (int)_ingNum.Tag;        //This was set during initiation
                                              //MessageBox.Show(resp.ToString());

            //Functional stuff make pop up display right info
            //And display which step it's on
            if (_recipe._ingredients[ingNum]._unitType.ToString() == "VOLUME")
            {
                measurementChanger.SelectedItem = "VOL.";
            }
            else if (_recipe._ingredients[ingNum]._unitType.ToString() == "MASS")
            {
                measurementChanger.SelectedItem = "MASS";
            }
            else if (_recipe._ingredients[ingNum]._unitType.ToString() == "LENGTH")
            {
                measurementChanger.SelectedItem = "LEN.";
            }
            else if (_recipe._ingredients[ingNum]._unitType.ToString() == "SPECIAL")
            {
                measurementChanger.SelectedItem = "SPEC.";
            }
            else if (_recipe._ingredients[ingNum]._unitType.ToString() == "NONE")
            {
                measurementChanger.SelectedItem = "NONE";
            }
            if (_recipe._ingredients[ingNum]._unitType.ToString() == "NONE")
            {
                unitChanger.Items.Clear();
                unitChanger.Text      = "N/A";
                unitChanger.IsEnabled = false;
            }
            else
            {
                unitChanger.IsEnabled    = true;
                unitChanger.SelectedItem = _recipe._ingredients[ingNum]._unitStr;
            }

            AmountBox.Clear();
            modBox.IsEnabled  = true;
            modBox.Visibility = System.Windows.Visibility.Visible;
            AmountBox.Text    = (_recipe._ingredients[ingNum]._measurement).ToString("###, #.##");


            ingBox.Text = _recipe._ingredients[ingNum]._mainText.ToString();
        }
コード例 #5
0
        //----------------------------------------This pages buttons -----------------------------------------

        private void Add_Click(object sender, RoutedEventArgs e)
        {
            mainGrid.IsEnabled = false;
            changeAddFlag      = true;
            //Functional stuff, make the popup, display the step that's going to be changed in the text box
            //And display which step it's on
            ingBox.Clear();
            AmountBox.Clear();

            //measurementChanger.SelectedItem = null;
            measurementChanger.Text = "MEAS.";
            unitChanger.Text        = "UNIT";

            modBox.IsEnabled  = true;
            modBox.Visibility = System.Windows.Visibility.Visible;
            AmountBox.Text    = "";
            ingBox.Text       = "";
        }
コード例 #6
0
 private void Clear_All_Entries()
 {
     NameBox.Clear();
     USNBox.Clear();
     TypeBox.Clear();
     AmountBox.Clear();
     AmountToBox.Clear();
     YearList.SelectedItems.Clear();
     YearToList.SelectedItems.Clear();
     MonthList.Visible    = false;
     MonthToList.Visible  = false;
     DayList.Visible      = false;
     DayToList.Visible    = false;
     HourList.Visible     = false;
     HourToList.Visible   = false;
     MinuteList.Visible   = false;
     MinuteToList.Visible = false;
     AMPMList.Visible     = false;
     AMPMToList.Visible   = false;
     DataView.DataSource  = null;
 }
コード例 #7
0
 private void LabelAmount_Click(object sender, EventArgs e)
 {
     AmountBox.Select();
 }
コード例 #8
0
 public TicketWindow()
 {
     InitializeComponent();
     AmountBox.Focus();
     DataContext = this;
 }
コード例 #9
0
 private void ClearBtn(object sender, RoutedEventArgs e)
 {
     PriceBox.Clear();
     QtyBox.Clear();
     AmountBox.Clear();
 }
コード例 #10
0
        private void button12_Click(object sender, EventArgs e)
        {
            double montant = Convert.ToDouble(AmountBox.Text);
            double solde;

            try
            {
                if (DepotRadioBox.Checked == true)
                {
                    if (montant == 0)
                    {
                        MessageBox.Show("Le montant doit être plus que 0");
                        return;
                    }
                    if (CHQRadioBox.Checked == true)
                    {
                        balance += montant;
                        AmountBox.Clear();
                        MessageBox.Show("Nouveau solde est :  $" + balance);
                    }
                    else
                    {
                        AmountBox.Clear();
                        MessageBox.Show("Solde courant est :  $" + balance);
                    }
                }
                else if (RetaritRadioBox.Checked == true)
                {
                    if (montant == 0)
                    {
                        AmountBox.Clear();
                        MessageBox.Show("Le montant doit être plus que 0");
                        return;
                    }
                    if (montant > 1000)
                    {
                        AmountBox.Clear();
                        MessageBox.Show("Vous ne pouvez pas retier plus de $1,000");
                        return;
                    }
                    if (montant % 10 != 0)
                    {
                        AmountBox.Clear();
                        MessageBox.Show("Vous n'avez le droit qu'aux montants par $10");
                        return;
                    }
                    if (CHQRadioBox.Checked == true)
                    {
                        if (montant > balance)
                        {
                            AmountBox.Clear();
                            MessageBox.Show("Pas assez de fonds \n\n ");
                        }
                        else
                        {
                            balance -= montant;
                            AmountBox.Clear();
                            MessageBox.Show("Nouveau solde de:  $" + balance);
                        }
                    }
                    else
                    {
                        if (gest.RetraitEpargne(code, montant) == false)
                        {
                            balance -= montant;
                            AmountBox.Clear();
                            MessageBox.Show("Pas assez de fonds \n\n Le solde est de:  $" + balance);
                        }
                        else
                        {
                            balance -= montant;
                            AmountBox.Clear();
                            MessageBox.Show("Nouveau solde de:  $" + balance);
                        }
                    }
                }
                else if (TransfertRadioBox.Checked == true)
                {
                    if (montant == 0)
                    {
                        MessageBox.Show("Le montant doit être plus de 0");
                        return;
                    }
                    if (CHQRadioBox.Checked == true)
                    {
                        if (montant > 100000)
                        {
                            AmountBox.Clear();
                            MessageBox.Show("Transfert interdit à plus de $100,000");
                        }
                        else
                        {
                            if (balance < montant)
                            {
                                MessageBox.Show("Pas assez de fonds \n\n Le solde est de:  $:  $" + balance);
                            }
                            else
                            {
                                balance -= montant;
                                AmountBox.Clear();
                                MessageBox.Show("Compte Epargne est de:  " + montant + "\n" + "Le Nouveau solde est :  $" + balance);
                            }
                        }
                    }
                    else
                    {
                        if (montant > 100000)
                        {
                            MessageBox.Show("Transfert interdit de plus de $100,000");
                        }
                        else
                        {
                            if (balance < montant)
                            {
                                MessageBox.Show("Pas assez de fonds \n\n Le solde est de :  $" + balance);
                            }
                            else
                            {
                                balance += montant;
                                solde    = balance + montant;
                                AmountBox.Clear();
                                MessageBox.Show("Compte Eepargne est de:  " + montant + "\n" + "Nouveau solde est de :  $" + solde);
                            }
                        }
                    }
                }
                else if (PayFactureRadioBox.Checked == true)
                {
                    if (montant == 0)
                    {
                        MessageBox.Show("Le montant doit être plus de 0");
                        return;
                    }
                    if (montant > 10000)
                    {
                        MessageBox.Show("Impossible de payer plus de $10,000");
                    }
                    else
                    {
                        if (balance < montant)
                        {
                            MessageBox.Show("Pas assez de fonds \n\n Balance de:  $" + balance);
                        }
                        else
                        {
                            balance -= montant + 1.25;
                            AmountBox.Clear();
                            MessageBox.Show("Paiement facture de: " + montant + "\n" + "Le Nouveau solde est : $" + balance);
                        }
                    }
                }
            }
            catch
            {
                MessageBox.Show("Veuillez séléctionner un montant pour débuter la transaction");
            }
        }
コード例 #11
0
 private void ClearAll()
 {
     TypeOfProblemList.Items.Clear();
     VehicleComboBox.Items.Clear();
     AmountBox.Clear();
 }