Пример #1
0
 void Send_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     vldSum.Errors.Clear();
     bm.ValidateAll();
     if (vldSum.Errors.Count == 0)
     {
         insrt.SendMsgAsync(txtSubject.Text, txtContent.Text, App.Current.Resources["User"].ToString(), txtSentTo.Text, DateTime.Now.ToString("dd/MM/yyyy H:mm:ss"));
     }
     else
     {
     }
 }
Пример #2
0
        private void FileButton_Click(object sender, RoutedEventArgs e)
        {
            vldSum.Errors.Clear();
            bm.ValidateAll();
            if (isVideoExist == true)
            {
                vldSum.Errors.Clear();
                vldSum.Errors.Add(vdVal);
            }
            if (vldSum.Errors.Count == 0)
            {
                OpenFileDialog d = new OpenFileDialog();
                d.Filter      = "Video (*.wmv, *.mp4, *.avi) |*.wmv;*.mp4;*.avi;";
                d.Multiselect = false;

                if (d.ShowDialog() == true)
                {
                    foreach (FileInfo f in d.Files)
                    {
                        UploadFile file = _files.SingleOrDefault(m => m.Name == f.Name);
                        if (file == null)
                        {
                            file      = new UploadFile();
                            file.Name = f.Name;
                            Stream s = f.OpenRead();
                            file.Size = s.Length / 1000;
                            int chunkSize = (int)s.Length;
                            file.Contents = new List <byte[]>();
                            while (s.Position > -1 && s.Position < s.Length)
                            {
                                if (s.Length - s.Position >= CHUNKSIZE)
                                {
                                    chunkSize = CHUNKSIZE;
                                }
                                else
                                {
                                    chunkSize = (int)(s.Length - s.Position);
                                }

                                byte[] fileBytes = new byte[chunkSize];
                                int    byteCount = s.Read(fileBytes, 0, chunkSize);
                                file.Contents.Add(fileBytes);
                            }
                            s.Close();
                            _files.Add(file);
                            SendFile(file, false);
                        }
                    }
                    FileList.ItemsSource = _files;
                    FileList.Visibility  = Visibility.Visible;
                }
            }
        }
Пример #3
0
 void SignInBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     InsertDataSrv.InsertClient webService = new InsertDataSrv.InsertClient();
     webService.SignInCompleted += new EventHandler <InsertDataSrv.SignInCompletedEventArgs>(WebService_SignIn);
     webService.SignInAsync(txtEmail.Text, txtPass.Password);
     bm.ValidateAll();
 }
Пример #4
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     vldSum.Errors.Clear();
     bm.ValidateAll();
     if (vldSum.Errors.Count == 0)
     {
         insrt.UpdateVideoCompleted += insrt_UpdateVideoCompleted;
         if (EveryoneCb.IsChecked == true)
         {
             insrt.UpdateVideoAsync(txtVideoName.Text, App.Current.Resources["User"].ToString(), cbCategory.SelectedItem.ToString(), "everyone");
         }
         else
         {
             insrt.UpdateVideoAsync(txtVideoName.Text, App.Current.Resources["User"].ToString(), cbCategory.SelectedItem.ToString(), ShareTxt.Text);
         }
     }
 }
Пример #5
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     vldSum.Errors.Clear();
     bm.ValidateAll();
     if (vldSum.Errors.Count == 0)
     {
         try
         {
             nxt.Visibility     = System.Windows.Visibility.Collapsed;
             txtEmail.IsEnabled = false;
         }
         catch { }
         insrt.SelectAnswerCompleted += insrt_SelectAnswerCompleted;
         insrt.SelectAnswerAsync(txtEmail.Text);
     }
 }
        public void PersistChanges()
        {
            BindingModel.ValidateAll();
            if (BindingModel.HasErrors)
            {
                return;
            }

            var dispatcher = RequestDispatcherFactory.CreateAsyncRequestDispatcher();

            dispatcher.Add(new SaveUserGroupRequest
            {
                Id       = BindingModel.Id,
                Name     = BindingModel.Name,
                ParentId = BindingModel.SelectedParentUserGroup.Id != Guid.Empty ? BindingModel.SelectedParentUserGroup.Id : (Guid?)null
            });
            dispatcher.ProcessRequests(PersistChanges_ResponseReceived, PublishRemoteException);
        }
Пример #7
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     vldSum.Errors.Clear();
     bm.ValidateAll();
     if (vldSum.Errors.Count == 0)
     {
         InsertDataSrv.InsertClient webService = new InsertDataSrv.InsertClient();
         webService.UpdDataCompleted += new EventHandler <InsertDataSrv.UpdDataCompletedEventArgs>(WebService_UpdateDataCompleted);
         webService.UpdDataAsync(txtEmail.Text, txtUser.Text, txtPass.Password, cbDD.SelectedValue + "/" + cbMM.SelectedValue + "/"
                                 + cbYYYY.SelectedValue, txtAddress.Text, cbPrefix.SelectedValue + txtPN.Text);
         App.Current.Resources.Remove("Details");
         App.Current.Resources.Add("Details", txtUser.Text + "," + txtEmail.Text + "," + txtPass.Password + "," + cbDD.SelectedValue + "/" + cbMM.SelectedValue + "/"
                                   + cbYYYY.SelectedValue + "," + txtAddress.Text + "," + cbPrefix.SelectedValue + txtPN.Text);
         App.Current.Resources.Remove("User");
         App.Current.Resources.Add("User", txtUser.Text);
         App.Current.Resources.Remove("Email");
         App.Current.Resources.Add("Email", txtEmail.Text);
     }
     else
     {
     }
 }
Пример #8
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            vldSum.Errors.Clear();
            bm.ValidateAll();
            if (isUserExist > 0)
            {
                vldSum.Errors.Add(usrVal);
            }

            if (isEmailExist > 0)
            {
                vldSum.Errors.Add(emlVal);
            }

            if (vldSum.Errors.Count == 0)
            {
                insrt.InsertDataAsync(txtUser.Text, txtPass.Password, txtEmail.Text, cbDD.SelectedItem.ToString() + @"/"
                                      + cbMM.SelectedItem.ToString() + @"/" + cbYYYY.SelectedItem.ToString()
                                      , txtAddress.Text, cbPrefix.SelectedItem.ToString() + "-" + txtPN.Text, cbSQ.SelectedIndex, txtAnswer.Text);
                System.Windows.MessageBox.Show("You Have Registed succefuly");
            }
        }