Ejemplo n.º 1
0
        private void btnBDelete_Click(object sender, RoutedEventArgs e)
        {
            tabDelete.Visibility    = Visibility.Visible;
            tabControl.SelectedItem = tabDelete;
            dining = (WebService.Dining)DGDining.SelectedItem;
            lblDeleteDiningName.Content  = dining.DName;
            lblDeleteDiningVenue.Content = dining.DVenue;
            lblDeleteDiningLong.Content  = dining.DLong;
            lblDeleteDiningLat.Content   = dining.DLat;
            lblDeleteDiningDesc.Content  = dining.DDesc;
            preBytes = dining.DImage;

            BitmapImage bmpImage = new BitmapImage();

            MemoryStream mystream = new MemoryStream(dining.DImage);

            bmpImage.SetSource(mystream);

            deleteDiningImage.Source = bmpImage;
        }
Ejemplo n.º 2
0
        void WCF_checkDiningCompleted(object sender, WebService.checkDiningCompletedEventArgs e)
        {
            if (e.Result == true)
            {
                MessageBox.Show("Identical Data Found!", "Insert", MessageBoxButton.OK);
            }
            else
            {
                WebService.Dining inDining = new WebService.Dining();
                inDining.DName  = tbxInsertDiningName.Text;
                inDining.DVenue = tbxInsertDiningVenue.Text;
                inDining.DLat   = Convert.ToDecimal(tbxInsertDininglat.Text);
                inDining.DLong  = Convert.ToDecimal(tbxInsertDininglong.Text);
                inDining.DDesc  = tbxInsertDiningDesc.Text;
                img             = bytes;
                inDining.DImage = img;

                WCF.InsertDiningAsync(inDining);
                WCF.InsertDiningCompleted += new EventHandler <InsertDiningCompletedEventArgs>(WCF_InsertDiningCompleted);
            }
        }
Ejemplo n.º 3
0
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            WCF = new WebService.Service1Client();
            WebService.Dining upDining = new WebService.Dining();
            upDining.DName  = lblUpdateDiningName.Content.ToString();
            upDining.DVenue = tbxUpdateDiningVenue.Text;
            upDining.DDesc  = tbxUpdateDiningDesc.Text;
            upDining.DLat   = Convert.ToDecimal(tbxUpdateDininglat.Text);
            upDining.DLong  = Convert.ToDecimal(tbxUpdateDininglong.Text);


            if (bytes != null)
            {
                upDining.DImage = bytes;
            }
            else
            {
                upDining.DImage = preBytes;
            }
            selected = false;
            WCF.UpdateDiningAsync(upDining);
            WCF.UpdateDiningCompleted += new EventHandler <UpdateDiningCompletedEventArgs>(WCF_UpdateDiningCompleted);
        }