Beispiel #1
0
        private void button_SpecialDeal_Window_Click(object sender, RoutedEventArgs e)
        {
            Special_Deal_Window oSpecial_Deal_Window = new Special_Deal_Window();

            oSpecial_Deal_Window.ShowDialog();
            this.Close();
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void button_SpecialDeal_Create_Click(object sender, RoutedEventArgs e)
        {
            SpecialDeals query = null;

            try
            {
                query = (await oSpecialDealsRepository.Select_SpecialDeals_Async("select * from specialdeals where bouquets_id = " + oBouquet.bouquets_id))[0];
            }
            catch
            {
            }

            if (query == null)
            {
                await oSpecialDealsRepository.Insert_SpecialDeals_Async(new SpecialDeals(oBouquet.bouquets_id, (double)numericUD_SpecialDeal_Percent.Value, DateTime.Parse(datepicker.Text)));

                await Update_ListView_SpecialDeals();

                Special_Deal_Window oSpecial_Deal_Window = new Special_Deal_Window();
                oSpecial_Deal_Window.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Спец. предложения для данного букета уже существует.");
            }
        }