private void Button_Click(object sender, RoutedEventArgs e)
        {

            Button btn = sender as Button;
            //OpenFile Dialog
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Multiselect = false;
            dlg.Filter = "All files|*.*";

            if ((bool)dlg.ShowDialog())
            {
                var bi1 = new BitmapImage();
                bi1.SetSource(dlg.File.OpenRead());

                PageService.PageSupport vmb = btn.DataContext as PageService.PageSupport;
                Stream s = dlg.File.OpenRead();
                byte[]filebytes = new byte[s.Length];

                s.Write(filebytes, 0, filebytes.Length);
  
                //Save to DB
                //vmb.image = 

                PageService.PageServiceClient psc = new PageService.PageServiceClient();
                psc.UpdatePageSupportByIDAsync(vmb);
                UploadFile(dlg.File.Name, dlg.File.OpenRead());
            }
            else //cancel
            {
                //StatusText.Text = "No file selected...";
            }
        }
Exemplo n.º 2
0
     public void GetSupportData(int pageid)
     {
         PageService.PageServiceClient psc = new PageService.PageServiceClient();
         psc.GetPageSupportByIDCompleted += new EventHandler<PageService.GetPageSupportByIDCompletedEventArgs>(psc_GetSupportPageByIDCompleted);
         
         if(pageid != 0)
            psc.GetPageSupportByIDAsync(pageid);
 
     }
Exemplo n.º 3
0
 public void UpdatePageSupport(PageService.PageSupport ps)
 {
     PageService.PageServiceClient psc = new PageService.PageServiceClient();
     psc.UpdatePageSupportByIDAsync(ps);
 }
 public void GetPageSupport()
 {
     PageService.PageServiceClient psc = new PageService.PageServiceClient();
     psc.GetPageSupportListCompleted += new EventHandler<PageService.GetPageSupportListCompletedEventArgs>(psc_GetPageSupportListCompleted);
     psc.GetPageSupportListAsync();
 }