コード例 #1
0
        private void UpdateDialPlanComplete(SubmitOperation so)
        {
            SIPDialPlan dialPlan = (SIPDialPlan)so.UserState;

            if (so.HasError)
            {
                if (m_editControl != null)
                {
                    m_editControl.WriteStatusMessage(MessageLevelsEnum.Error, "There was an error performing a Dial Plan update." + so.Error.Message);
                }
                else
                {
                    LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error performing a Dial Plan update." + so.Error.Message);
                }

                so.MarkErrorAsHandled();
            }
            else
            {
                if (m_editControl != null)
                {
                    m_editControl.WriteStatusMessage(MessageLevelsEnum.Info, "Update completed successfully for " + dialPlan.DialPlanName + ".");
                }
            }
        }
コード例 #2
0
        private void SIPProviderAddComplete(SubmitOperation so)
        {
            if (so.HasError)
            {
                if (m_addControl != null)
                {
                    m_addControl.WriteStatusMessage(MessageLevelsEnum.Error, so.Error.Message);
                }
                else
                {
                    LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error adding a SIP Provider. " + so.Error.Message);
                }

                m_riaContext.SIPProviders.Remove((SIPProvider)so.UserState);
                so.MarkErrorAsHandled();
            }
            else
            {
                if (m_addControl != null)
                {
                    SIPProvider sipProvider = (SIPProvider)so.UserState;
                    SIPProvidersPanel_Add();
                    m_addControl.WriteStatusMessage(MessageLevelsEnum.Info, "SIP Provider was successfully created for " + sipProvider.ProviderName + ".");
                }

                m_sipProvidersPanel.AssetAdded();
            }
        }
コード例 #3
0
 private void SubmitComplete(SubmitOperation submitOperation)
 {
     if (submitOperation.HasError)
     {
         submitOperation.MarkErrorAsHandled();
     }
 }
コード例 #4
0
        public void OnUserProfileSaved(SubmitOperation op)
        {
            if (op.HasError)
            {
                //Show error message dialog
                string errorMessage = String.Format("{0}:\n{1}\n", "Неуспешен запис!", op.Error.Message);
                foreach (var errorEntity in op.EntitiesInError)
                {
                    foreach (var validationResult in errorEntity.ValidationErrors)
                    {
                        errorMessage += string.Format("{0}\n", validationResult.ErrorMessage);
                    }
                }

                var dialogErrorMessage = new ErrorDialogMessage(
                    errorMessage, "Съхраняване на XXXX");                    //TO DO: Update
                Messenger.Default.Send(dialogErrorMessage);

                op.MarkErrorAsHandled();
                return;
            }

            this.SendSaveSuccessMessage();
            this.SendUpdatedUserProfileMessage();
        }
コード例 #5
0
        void submitQuestionOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (submitOperation.HasError)
            {
                submitOperation.MarkErrorAsHandled();
                NotifyWindow notifyWindow = new NotifyWindow("错误", "保存失败");
                notifyWindow.Show();
            }
            else
            {
                NotifyWindow notifyWindow = new NotifyWindow("保存成功", "保存成功!");
                notifyWindow.Show();
            }
            (OnViewQuestion as DelegateCommand).RaiseCanExecuteChanged();
            (OnAnswerQuestion as DelegateCommand).RaiseCanExecuteChanged();
            (OnViewTraceQuestion as DelegateCommand).RaiseCanExecuteChanged();
            (OnCloseTraceQuestion as DelegateCommand).RaiseCanExecuteChanged();

            using (questionTraceView.DeferRefresh())
            {
                questionTraceView.MoveToFirstPage();
            }

            using (questionTraceTraceView.DeferRefresh())
            {
                questionTraceTraceView.MoveToFirstPage();
            }

            IsBusy = false;
        }
コード例 #6
0
        public void UpdateRuleComplete(SubmitOperation so)
        {
            var rule = (SimpleWizardRule)so.UserState;

            if (so.HasError)
            {
                if (rule.Direction == SIPCallDirection.Out.ToString())
                {
                    m_outgoingRulesUpdateControl.SetErrorMessage(so.Error.Message);
                }
                else
                {
                    m_incomingRulesUpdateControl.SetErrorMessage(so.Error.Message);
                }
                so.MarkErrorAsHandled();
            }
            else
            {
                var updatedRule = m_riaContext.SimpleWizardRules.SingleOrDefault(x => x.ID == rule.ID);

                if (updatedRule != null)
                {
                    if (rule.Direction == SIPCallDirection.Out.ToString())
                    {
                        m_outgoingRulesUpdateControl.SetStatusMessage(SimpleWizardOutRuleControl.UPDATE_TEXT, false);
                        m_outgoingRulesUpdateControl.SetRuleToUpdate(updatedRule);
                    }
                    else
                    {
                        m_incomingRulesUpdateControl.SetStatusMessage(SimpleWizardInRuleControl.UPDATE_TEXT, false);
                        m_incomingRulesUpdateControl.SetRuleToUpdate(updatedRule);
                    }
                }
            }
        }
コード例 #7
0
        private void SIPAccountAddComplete(SubmitOperation so)
        {
            if (so.HasError)
            {
                if (m_addControl != null)
                {
                    m_addControl.WriteStatusMessage(MessageLevelsEnum.Error, so.Error.Message);
                }
                else
                {
                    LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error adding a SIP Account. " + so.Error.Message);
                }

                m_riaContext.SIPAccounts.Remove((SIPAccount)so.UserState);
                so.MarkErrorAsHandled();
            }
            else
            {
                if (m_addControl != null)
                {
                    SIPAccount sipAccount = (SIPAccount)so.UserState;
                    SIPAccountsAssetViewer_Add();
                    m_addControl.WriteStatusMessage(MessageLevelsEnum.Info, "SIP Account was successfully created for " + sipAccount.SIPUsername + "@" + sipAccount.SIPDomain + ".");
                }

                m_sipAccountsPanel.AssetAdded();
            }
        }
コード例 #8
0
        private void UpdateCustomerComplete(SubmitOperation so)
        {
            if (so.HasError)
            {
                if (!m_customer.HasValidationErrors)
                {
                    // Only display the exception message if it's not already being set in the validation summary.

                    // Remove the error information the RIA domain services framework adds in and that will just confuse things.
                    string errorMessage = Regex.Replace(so.Error.Message, @"Submit operation failed.", "");
                    UIHelper.SetText(m_statusTextBlock, errorMessage);
                }
                else
                {
                    UIHelper.SetText(m_statusTextBlock, "There was a validation error updating your details.");
                }

                so.MarkErrorAsHandled();
            }
            else
            {
                UIHelper.SetText(m_statusTextBlock, "Details successfully updated.");
            }

            SetUpdateButtonsEnabled(true);
        }
コード例 #9
0
ファイル: AdminViewModel.cs プロジェクト: Surrog/atomic-rss
 private void submit_Completed(SubmitOperation so)
 {
     if (so.HasError)
     {
         Debug.WriteLine(so.Error.StackTrace);
         so.MarkErrorAsHandled();
     }
 }
コード例 #10
0
 private void SubmitComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, so.Error.Message);
         so.MarkErrorAsHandled();
     }
 }
コード例 #11
0
 private void DeleteComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         UIHelper.SetText(m_statusTextBlock, "Error deleting account. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         Logout_External(false);
     }
 }
コード例 #12
0
 /// <summary>
 /// This is used to handle the domaincontext submit operation result, and check whether there are any errors.
 /// If not, user is show success message
 /// </summary>
 /// <param name="so"></param>
 public void OnFormSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message), "Error", MessageBoxButton.OK);
         so.MarkErrorAsHandled();
     }
     else
     {
         MessageBox.Show("Saved Successfully", "Success", MessageBoxButton.OK);
     }
 }
コード例 #13
0
ファイル: Company.xaml.cs プロジェクト: shenoyroopesh/Gama
 /// <summary>
 /// This is used to handle the domaincontext submit operation result, and check whether there are any errors. 
 /// If not, user is show success message
 /// </summary>
 /// <param name="so"></param>
 public void OnFormSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message), "Error", MessageBoxButton.OK);
         so.MarkErrorAsHandled();
     }
     else
     {
         MessageBox.Show("Saved Successfully", "Success", MessageBoxButton.OK);
     }
 }
コード例 #14
0
 private void DeleteDialPlanComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error deleting the dial plan. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         m_dialPlansPanel.AssetDeleted();
     }
 }
コード例 #15
0
        void submitOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            ProductManagersViewModel.IsBusy = false;
            if (submitOperation.HasError)
            {
                if (!isUserProject)
                {
                    submitOperation.MarkErrorAsHandled();
                    NotifyWindow notifyWindow = new NotifyWindow("错误", "取消自选失败!");
                    notifyWindow.Show();
                }
                else
                {
                    submitOperation.MarkErrorAsHandled();
                    NotifyWindow notifyWindow = new NotifyWindow("错误", "添加自选失败!");
                    notifyWindow.Show();
                }
            }
            else
            {
                if (!isUserProject)
                {
                    NotifyWindow notifyWindow = new NotifyWindow("成功", "取消自选成功!");
                    notifyWindow.Show();

                    //isUserProject = false;
                    UserProjectEntityDictionary.Remove(manufactureNumber);
                }
                else
                {
                    NotifyWindow notifyWindow = new NotifyWindow("成功", "添加自选成功!");
                    notifyWindow.Show();
                    //isUserProject = true;
                    UserProjectEntityDictionary.Add(manufactureNumber, UserProjectEntity);
                }
            }
        }
コード例 #16
0
 private ServiceSubmitChangesResult CreateResult(SubmitOperation op)
 {
     if (op.HasError)
     {
         op.MarkErrorAsHandled();
     }
     return(new ServiceSubmitChangesResult(
                op.ChangeSet,
                op.EntitiesInError,
                op.Error,
                op.IsCanceled,
                op.UserState));
 }
コード例 #17
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         MessageBox.Show("Đã xóa log !");
         this.DialogResult = false;
     }
 }
コード例 #18
0
 private void OnSubmitCompleted1(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         EntityQuery<mytv> Query = dstb.GetMytvsQuery();
         LoadOperation<mytv> LoadOp = dstb.Load(Query, LoadOpM_Complete, null);
     }
 }
コード例 #19
0
        private void SubmitChangesCallback(SubmitOperation submitOperation)
        {
            if (submitOperation.HasError)
            {
                Status = "Data was missing or incorrect. Please try again"; // submitOperation.Error.Message;
                submitOperation.MarkErrorAsHandled();
                return;
            }

            UpdateState(false);

            Status = "Customer was saved";
        }
コード例 #20
0
		protected void submit(SubmitOperation oper) {
			if (oper.HasError) {
				GlobalStatus.Current.Status = "Ошибка при выполнении операции на сервере: " + oper.Error.Message;
				MessageBox.Show(oper.Error.Message, "Ошибка при выполнении операции на сервере", MessageBoxButton.OK);
				refresh();
				Logger.info(oper.Error.ToString());
				oper.MarkErrorAsHandled();
			} else {
				GlobalStatus.Current.Status = "Готово";
			}
			userForm.CurrentItem = null;
			gridUsers.SelectedItem = null;
		}
コード例 #21
0
 private void DeleteSIPAccountComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error deleting the SIP account. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         SIPAccount sipAccount = (SIPAccount)so.UserState;
         //LogActivityMessage_External(MessageLevelsEnum.Info, "Delete completed successfully for " + sipAccount.SIPUsername + "@" + sipAccount.SIPDomain + ".");
         m_sipAccountsPanel.AssetDeleted();
     }
 }
コード例 #22
0
 private void DeleteSIPProviderComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error deleting the SIP provider. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         SIPProvider sipProvider = (SIPProvider)so.UserState;
         //LogActivityMessage_External(MessageLevelsEnum.Info, "Delete completed successfully for " + sipProvider.ProviderName + ".");
         m_sipProvidersPanel.AssetDeleted();
     }
 }
 void SubmitChangesCallback(SubmitOperation submitOperation)
 {
     if (submitOperation.HasError)
     {
         if (submitOperation.CanCancel)
         {
             submitOperation.Cancel();
         }
         context.RejectChanges();
         HandleException(submitOperation.Error);
         submitOperation.MarkErrorAsHandled();
     }
     uiDispatcher.BeginInvoke(() => riaInstantSource.Refresh());
 }
 private void OnSubmitCompleted(SubmitOperation so)
 {
     UploadBusyIndicator.IsBusy = false;
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         MessageBox.Show("Submitted Successfully!");
         GetAcct_Ac_tblJournalAttachmentsByAcct_Ac_tblJournalQueryDataSource.Load();
     }
 }
コード例 #25
0
        public void OnCarSaved(SubmitOperation op)
        {
            if (op.HasError)
            {
                string errorMessage = GenerateSubmitOperationErrorMessage(op);
                this.SaveUnsuccessfull(errorMessage);

                op.MarkErrorAsHandled();
                return;
            }

            string successMessage = "Записът е успешен!";

            this.SaveSuccessfull(successMessage);
        }
コード例 #26
0
        /// <summary>
        /// Used by Silverlight client applications to verify that an update operation
        /// completed successfully.
        /// </summary>
        /// <param name="operation">The query operation context.</param>
        public static void Check(SubmitOperation operation)
        {
            if (operation.IsCanceled)
            {
                throw new CancelException();
            }

            if (!operation.HasError)
            {
                return;
            }

            operation.MarkErrorAsHandled();
            Check(operation.Error, GetFaultDetails(operation.EntitiesInError));
        }
コード例 #27
0
 protected void submit(SubmitOperation oper)
 {
     if (oper.HasError)
     {
         GlobalStatus.Current.Status = "Ошибка при выполнении операции на сервере: " + oper.Error.Message;
         MessageBox.Show(oper.Error.Message, "Ошибка при выполнении операции на сервере", MessageBoxButton.OK);
         RefreshOrders(true);
         Logger.info(oper.Error.ToString());
         oper.MarkErrorAsHandled();
     }
     else
     {
         GlobalStatus.Current.Status = "Готово";
     }
 }
コード例 #28
0
 /// <summary>
 ///     Handles <see cref="SubmitOperation.Completed"/> for a userRegistrationContext
 ///     operation. If there was an error, an <see cref="ErrorWindow"/> is
 ///     displayed to the user. Otherwise, this triggers a <see cref="LoginOperation"/>
 ///     that will automatically log in the just registered user
 /// </summary>
 private void RegistrationOperation_Completed(SubmitOperation asyncResult)
 {
     if (asyncResult.HasError)
     {
         ErrorWindow.CreateNew(asyncResult.Error);
         asyncResult.MarkErrorAsHandled();
         this.registerForm.BeginEdit();
     }
     else
     {
         LoginOperation loginOperation = WebContext.Current.Authentication.Login(this.registrationData.ToLoginParameters(), this.LoginOperation_Completed, null);
         this.BindUIToOperation(loginOperation);
         this.parentWindow.AddPendingOperation(loginOperation);
     }
 }
コード例 #29
0
        private void SubOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (submitOperation.HasError)
            {
                submitOperation.MarkErrorAsHandled();
                NotifyWindow notifyWindow = new NotifyWindow("错误", "上传失败 " + submitOperation.Error);
                notifyWindow.Show();
            }
            else
            {
                NotifyWindow notifyWindow = new NotifyWindow("上传成功", "上传成功!");
                notifyWindow.Show();
            }
        }
コード例 #30
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         MessageBox.Show("Đã thêm tuyến :" + txttuyen.Text.Trim().ToUpper());
         this.txtten.Text = "";
         this.txttuyen.Text = "";
         this.txtghichu.Text = "";
         this.txttuyen.Focus();           
     }
 }
コード例 #31
0
 private void OnSubmitChangesCompleted(SubmitOperation op)
 {
     if (op.HasError)
     {
         MessageBox.Show("Operation failed.");
         op.MarkErrorAsHandled();
     }
     else if (op.IsComplete)
     {
         MessageBox.Show("Operation completed.");
     }
     else if (op.IsCanceled)
     {
         MessageBox.Show("Operation cancelled.");
     }
 }
コード例 #32
0
 private void UpdateSIPAccountComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error updating the SIP account. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         if (m_editControl != null)
         {
             SIPAccount sipAccount = (SIPAccount)so.UserState;
             m_editControl.WriteStatusMessage(MessageLevelsEnum.Info, "Update completed successfully for " + sipAccount.SIPUsername + "@" + sipAccount.SIPDomain + ".");
         }
     }
 }
コード例 #33
0
 private void UpdateSIPProviderComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error updating the SIP provider. " + so.Error.Message);
         so.MarkErrorAsHandled();
         m_riaContext.RejectChanges();
     }
     else
     {
         if (m_editControl != null)
         {
             SIPProvider sipProvider = (SIPProvider)so.UserState;
             m_editControl.WriteStatusMessage(MessageLevelsEnum.Info, "Update completed successfully for SIP provider " + sipProvider.ProviderName + ".");
         }
     }
 }
コード例 #34
0
        void submitOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (submitOperation.HasError)
            {
                submitOperation.MarkErrorAsHandled();
                NotifyWindow notifyWindow = new NotifyWindow("错误", "保存失败");
                notifyWindow.Show();
            }
            else
            {
                NotifyWindow notifyWindow = new NotifyWindow("保存成功", "保存成功!");
                notifyWindow.Show();
            }
            BusyIndicator.IsBusy = false;
        }
コード例 #35
0
        void submitOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (submitOperation.HasError)
            {
                submitOperation.MarkErrorAsHandled();
                NotifyWindow notifyWindow = new NotifyWindow("错误", "删除失败");
                notifyWindow.Show();
            }
            else
            {
                NotifyWindow notifyWindow = new NotifyWindow("删除成功", "删除成功!");
                notifyWindow.Show();
                LoadData();
            }
        }
コード例 #36
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         if (m_update)
             this.DialogResult = false;
         else
         {
             MessageBox.Show("Đã thêm xã :" + txtten.Text.Trim());
             this.txtten.Text = "";
             this.txtmaap.Text = "";                    
             this.txtmaap.Focus();
         }
     }
 }
コード例 #37
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         if (m_update)
             this.DialogResult = false;
         else
         {
             MessageBox.Show("Đã thêm chương trình :" + txtten.Text.Trim());
             this.txtten.Text = "";
             this.txtmakm.Text = "";
             this.dbatdau.EditValue = null;
             this.dketthuc.EditValue = null;
             this.txtmakm.Focus();
         }
     }
 }
コード例 #38
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         enable_control(false);
         this.OKButton.IsEnabled = false;
         this.btnNew.IsEnabled = true;
         if (v_update==false)
             Send_SMS();
         MessageBox.Show("Đã lưu vào cơ sở dữ liệu");
         if (nhiemthu.IsChecked == true)
             innhiemthu();
         else
             inhopdong();    
     }
 }
コード例 #39
0
 private void UpdateSIPAccountComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error updating the SIP account. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         if (m_editControl != null)
         {
             SIPAccount sipAccount = (SIPAccount)so.UserState;
             m_editControl.WriteStatusMessage(MessageLevelsEnum.Info, "Update completed successfully for " + sipAccount.SIPUsername + "@" + sipAccount.SIPDomain + ".");
         }
     }
 }
コード例 #40
0
        private void CompleteOperation(SubmitOperation submitOp, Apartment cur)
        {
            //---------------------------
            //如果当前正在加载,则查询结果可能不正确,需要cancel一次
            MakeSureLoadCorret();

            //---------------------------

            if (submitOp.HasError)
            {
                cur.ValidationErrors.Add(new ValidationResult(submitOp.Error.Message, null));
                submitOp.MarkErrorAsHandled();
                MessageBox.Show(ApartmentServiceError.ServerOperationException + "\n\n" + submitOp.Error.Message);
            }
            else
            {
                string info = GetOperationResult(cur);
                MessageBox.Show(ApartmentServiceError.ServerOperationSuccessed + "\n\n" + info);
                if (_apartemntLocked.Contains(cur))
                {
                    _apartemntLocked.Remove(cur);
                }
            }
            //---------------------------

            //取出busing列表
            if (_apartmentBusingList.Contains(cur))
            {
                _apartmentBusingList.Remove(cur);
            }

            cur.CurState = ApartmentRuntimeState.Deleted;

            _domainContext.Apartments.Detach(cur);
        }
コード例 #41
0
        public void OnCarSaved(SubmitOperation op)
        {
            if (op.HasError)
            {
                string errorMessage = GenerateSubmitOperationErrorMessage(op);
                this.SaveUnsuccessfull(errorMessage);

                op.MarkErrorAsHandled();
                return;
            }

            string successMessage = "Записът е успешен!";
            this.SaveSuccessfull(successMessage);
        }
コード例 #42
0
 public override void OnFormSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message), "Error", MessageBoxButton.OK);
         so.MarkErrorAsHandled();
     }
     else
     {
         MessageBox.Show("Saved Successfully", "Success", MessageBoxButton.OK);
         var addressStickersWindow = new PrintAddressStickers
             {
                 ReportNo = this.RGReport.ReportNo
             };
         addressStickersWindow.Show();
     }
 }
コード例 #43
0
        private void ChangesSubmitted(SubmitOperation op)
        {
            IsBusy = false;
            if (!op.HasError)
            {
                EntitySpeakerPresentations.Clear();
                SpeakerPresentations.Clear();
                SelectedPresentation = null;
                GetEventPresentationsForSpeaker(App.Event.Id, App.LoggedInPerson.Id);
            }
            else
            {
                var message = op.Error.Message + Environment.NewLine;
                foreach (var entityInError in op.EntitiesInError)
                {
                    foreach (var validationError in entityInError.ValidationErrors)
                    {
                        message += validationError.ErrorMessage + Environment.NewLine;
                    }
                }

                EventAggregator.Publish(new ErrorWindowEvent { Message = message, ViewModelName="SpeakerViewModel" });
                var ex = new Exception(message);
                _loggingService.LogException(ex);
                op.MarkErrorAsHandled();
            }
        }
コード例 #44
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         gridControl1.ShowLoadingPanel = false;               
         MessageBox.Show("Đã lưu thay đổi !");
         //this.Hide();
         //frmdscodinh frmtuyen = new frmdscodinh();
         //frmtuyen.Width = this.ActualWidth;
         //frmtuyen.Height = this.ActualHeight;
         //frmtuyen.Show();
     }
 }
コード例 #45
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         gridControl1.ShowLoadingPanel = false;
         MessageBox.Show("Đã thay tiền thuê bao xong");               
     }
 }
コード例 #46
0
 private void OnSubmitCompleted2(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         MessageBox.Show("Da cap nhat xong !");
     }
 }
コード例 #47
0
        private void OnSaveCallBack(SubmitOperation op)
        {
            string msg = string.Empty;
            if (op.HasError)
            {
                msg = "Неуспешно съхраняване на полицата!:" + op.Error.Message;
                op.MarkErrorAsHandled();
            }
            else
            {
                msg = "Полицата е изпратена узпешно!";
            }

            Messenger.Default.Send<SaveInsuarancePolicyMessageDialog>(new SaveInsuarancePolicyMessageDialog(msg, "Изпращане на полица"));
        }
コード例 #48
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         MessageBox.Show("Đã lưu vào cơ sở dữ liệu");               
         this.OKButton.IsEnabled = false;
         this.btnNew.IsEnabled = true;
         this.txtusr.Focus();
     }
 }
コード例 #49
0
        private void SIPAccountAddComplete(SubmitOperation so)
        {
            if (so.HasError)
            {
                if (m_addControl != null)
                {
                    m_addControl.WriteStatusMessage(MessageLevelsEnum.Error, so.Error.Message);
                }
                else
                {
                    LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error adding a SIP Account. " + so.Error.Message);
                }

                m_riaContext.SIPAccounts.Remove((SIPAccount)so.UserState);
                so.MarkErrorAsHandled();
            }
            else
            {
                if (m_addControl != null)
                {
                    SIPAccount sipAccount = (SIPAccount)so.UserState;
                    SIPAccountsAssetViewer_Add();
                    m_addControl.WriteStatusMessage(MessageLevelsEnum.Info, "SIP Account was successfully created for " + sipAccount.SIPUsername + "@" + sipAccount.SIPDomain + ".");
                }

                m_sipAccountsPanel.AssetAdded();
            }
        }
コード例 #50
0
 private void OnSubmitCompleted(SubmitOperation so)
 {           
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {
         QLThuebaoDomainContext dstb = new QLThuebaoDomainContext();
         InvokeOperation<System.Nullable<int>> p = dstb.Excute_p_doiaccmytv(txtusr.Text.Trim(), txtusrn.Text.Trim());
         p.Completed += new EventHandler(Completed);
     }
 }
コード例 #51
0
        private void CreateCustomerComplete(SubmitOperation so)
        {
            Customer customer = (Customer)so.UserState;

            if (so.HasError)
            {
                m_riaContext.Customers.Remove(customer);

                // Remove the error information the RIA domain services framework adds in and that will just confuse things.
                string errorMessage = Regex.Replace(so.Error.Message, @"Submit operation failed.", "");
                UIHelper.SetText(m_statusTextBlock, errorMessage);

                so.MarkErrorAsHandled();
            }
            else
            {
                CustomerCreated("A comfirmation email has been sent to " + customer.EmailAddress + ". " +
                    "Please click on the link contained in the email to activate your account. Accounts not activated within 24 hours are removed.");

                Reset();
            }
        }
コード例 #52
0
 private void SubmitComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, so.Error.Message);
         so.MarkErrorAsHandled();
     }
 }
コード例 #53
0
		private static void OnSubmitChangesCompleted(SubmitOperation submitOperation)
		{
			var action = submitOperation.UserState as Action;

			if (action != null)
			{
				action();
			}

			if (submitOperation.HasError)
			{				
				if (submitOperation.Error is DomainOperationException)
				{
					DomainOperationException exception = (DomainOperationException)submitOperation.Error;

					if (exception.Status == OperationErrorStatus.Conflicts)
					{
						foreach (var item in submitOperation.EntitiesInError)
						{
							if (item.EntityConflict.IsDeleted)
							{
								foreach (var entitySet in ScheduleViewRepository.Context.EntityContainer.EntitySets)
								{
									if (entitySet.EntityType == item.GetType())
									{
										entitySet.Detach(item);
										entitySet.Attach(item);
										entitySet.Remove(item);
										ScheduleViewRepository.Context.SubmitChanges();
									}
								}
							}
							else
							{
								item.EntityConflict.Resolve();
							}
						}
					}
					submitOperation.MarkErrorAsHandled();
				}
			}
		}
コード例 #54
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     if (m_update)
         this.DialogResult = false;
     else
         MessageBox.Show("Đã thêm user :" + username_callback);
 }       
コード例 #55
0
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     laythongtin();
 }
コード例 #56
0
 private void DeleteSIPProviderComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error deleting the SIP provider. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         SIPProvider sipProvider = (SIPProvider)so.UserState;
         //LogActivityMessage_External(MessageLevelsEnum.Info, "Delete completed successfully for " + sipProvider.ProviderName + ".");
         m_sipProvidersPanel.AssetDeleted();
     }
 }
コード例 #57
0
        private void SIPProviderAddComplete(SubmitOperation so)
        {
            if (so.HasError)
            {
                if (m_addControl != null)
                {
                    m_addControl.WriteStatusMessage(MessageLevelsEnum.Error, so.Error.Message);
                }
                else
                {
                    LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error adding a SIP Provider. " + so.Error.Message);
                }

                m_riaContext.SIPProviders.Remove((SIPProvider)so.UserState);
                so.MarkErrorAsHandled();
            }
            else
            {
                if (m_addControl != null)
                {
                    SIPProvider sipProvider = (SIPProvider)so.UserState;
                    SIPProvidersPanel_Add();
                    m_addControl.WriteStatusMessage(MessageLevelsEnum.Info, "SIP Provider was successfully created for " + sipProvider.ProviderName + ".");
                }

                m_sipProvidersPanel.AssetAdded();
            }
        }
コード例 #58
0
 private void UpdateSIPProviderComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error updating the SIP provider. " + so.Error.Message);
         so.MarkErrorAsHandled();
         m_riaContext.RejectChanges();
     }
     else
     {
         if (m_editControl != null)
         {
             SIPProvider sipProvider = (SIPProvider)so.UserState;
             m_editControl.WriteStatusMessage(MessageLevelsEnum.Info, "Update completed successfully for SIP provider " + sipProvider.ProviderName + ".");
         }
     }
 }
コード例 #59
0
 private void DeleteSIPAccountComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error deleting the SIP account. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         SIPAccount sipAccount = (SIPAccount)so.UserState;
         //LogActivityMessage_External(MessageLevelsEnum.Info, "Delete completed successfully for " + sipAccount.SIPUsername + "@" + sipAccount.SIPDomain + ".");
         m_sipAccountsPanel.AssetDeleted();
     }
 }
コード例 #60
0
 private void OnSubmitCompleteds(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     else
     {               
         this.cmdLuu.IsEnabled = false;
         MessageBox.Show("Đã lưu vào cơ sở dữ liệu");
        
     }
 }