예제 #1
0
        void buy_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {



            if (BuySell == true)
            {
                var a = MessageBox.Show("Do you want to buy it?", "Buy", MessageBoxButton.OKCancel);
                if (a == MessageBoxResult.OK)
                {
                    TranzactiiClient tc = new TranzactiiClient(bind,endpoint);
                    tc.AddCumparareAsync(Username.Text, "test", NumeAnimal.Text, "bla", int.Parse(Price.Text), short.Parse(Quantity.Text), ID);
                    tc.AddCumparareCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(tc_AddCumparareCompleted);
                }
            }
               

            else
            {
                var a = MessageBox.Show("Do you want to sell it?", "Sell", MessageBoxButton.OKCancel);
                if (a == MessageBoxResult.OK)
                {
                    TranzactiiClient tc = new TranzactiiClient(bind, endpoint);
                    tc.AddCumparareAsync("test", Username.Text, NumeAnimal.Text, "bla", int.Parse(Price.Text), short.Parse(Quantity.Text), ID);
                    tc.AddCumparareCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(tc_AddCumparareCompleted);
                }
            }
            
        }
예제 #2
0
 void adaugaoferta_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     TranzactiiClient tc = new TranzactiiClient(bind,endpoint);
     ComboBoxItem cSpecii = (ComboBoxItem)cbSpecies.SelectedItem;
     ComboBoxItem cBuySell = (ComboBoxItem)cbBuySell.SelectedItem;
     ComboBoxItem cFirma = (ComboBoxItem)cbShipping.SelectedItem;
     if (cBuySell.Content.ToString() == "Sell")
     {//le introduce lu buying
         tc.AddTranzactieAsync("test", cSpecii.Content.ToString(), int.Parse(numar.Text), cFirma.Content.ToString(), int.Parse(pret.Text), "1", "NULL");
     }
     else
     {
         tc.AddTranzactieAsync("test", cSpecii.Content.ToString(), int.Parse(numar.Text), cFirma.Content.ToString(), int.Parse(pret.Text), "NULL", "1");
     }
     tc.AddTranzactieCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(tc_AddTranzactieCompleted);
     b.IsBusy = true;
 }
예제 #3
0
 void Search_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     #region Buying
     TranzactiiClient tc = new TranzactiiClient(bind,endpoint);
     ComboBoxItem regiune = (ComboBoxItem)cbRegiune.SelectedItem;
    if (check == false)
     {
         tc.CautaAsync(regiune.Content.ToString(), KeyWords.Text, 1, false, false, true);
     }
     else
     {
         ComboBoxItem DA = (ComboBoxItem)cbSortAD.SelectedItem;
     ComboBoxItem QA = (ComboBoxItem)cbSortPQ.SelectedItem;
         if(QA.Content.ToString()=="Price" && DA.Content.ToString()=="Ascending")
         {
             tc.CautaAsync(regiune.Content.ToString(), KeyWords.Text, 1, true, true, false);
         }
         else if (QA.Content.ToString() == "Quantity" && DA.Content.ToString() == "Ascending")
         {
             tc.CautaAsync(regiune.Content.ToString(), KeyWords.Text, 1, false, true, false);
         }
         else if (QA.Content.ToString() == "Quantity" && DA.Content.ToString() == "Descending")
         {
             tc.CautaAsync(regiune.Content.ToString(), KeyWords.Text, 1, false, false, false);
         }
         else if (QA.Content.ToString() == "Price" && DA.Content.ToString() == "Descending")
         {
             tc.CautaAsync(regiune.Content.ToString(), KeyWords.Text, 1, true, false, false);
         }
     }
     tc.CautaCompleted += new EventHandler<CautaCompletedEventArgs>(tc_CautaCompleted);
     #endregion
 }