Beispiel #1
0
 private void ChangesSubmitted(SubmitOperation submitOperation)
 {
     if(submitOperation.Error != null)
     {
         // Gulp! JAS
         // throw submitOperation.Error;
     }
 }
 private void OnSubmitCompleted(SubmitOperation so)
 {
     if (so.HasError)
     {
         MessageBox.Show(string.Format("Submit Failed: {0}", so.Error.Message));
         so.MarkErrorAsHandled();
     }
     laythongtin();
 }
 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();
     }
 }
        private void AddQuestionClosed(object sender, EventArgs e)
        {
            QuestionTraceWindow questionTraceWindow = sender as QuestionTraceWindow;

            if (questionTraceWindow.DialogResult == true)
            {
                ProductDomainContext.questiontraces.Add(AddQuestionTraceEntity.QuestionTrace);
                BusyIndicator.IsBusy = true;
                SubmitOperation submitOperation = ProductDomainContext.SubmitChanges();
                submitOperation.Completed += submitOperation_Completed;
            }
        }
        private void FileTypeWindow_Closed(object sender, EventArgs e)
        {
            FileTypeWindow lFileTypeWindow = sender as FileTypeWindow;

            if (lFileTypeWindow.DialogResult == true)
            {
                IsBusy = true;
                Log.ModifyLog(documentManagerContext, selectFileTypeEntity.ToString());
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
        private void TaxPayerWindow_Closed(object sender, EventArgs e)
        {
            ChildWindow lTaxPayerWindow = sender as ChildWindow;

            if (lTaxPayerWindow.DialogResult == true)
            {
                IsBusy = true;
                Log.ModifyLog(documentManagerContext, SelectTaxPayerEntity.ToString());
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
        void DeleteTaxPayerConfirm_Closed(object sender, EventArgs e)
        {
            ConfirmWindow lConfirmWindow = sender as ConfirmWindow;

            if (lConfirmWindow.DialogResult == true)
            {
                documentManagerContext.taxpayers.Remove(SelectTaxPayerEntity.TaxPayer);
                Log.DeleteLog(documentManagerContext, SelectTaxPayerEntity.ToString());
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
Beispiel #8
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);
     }
 }
Beispiel #9
0
        private void UserFile_FinishUpdate(object sender, EventArgs e)
        {
            newEntity.FileUploadTime = DateTime.Now;
            NotifyWindow notificationWindow = new NotifyWindow("上传文件", "上传文件完成!");

            notificationWindow.Show();
            newEntity.DUpdate();
            planManagerDomainContext.plan_outline_files.Add(newEntity.PlanFiles);
            SubmitOperation submitOperation = planManagerDomainContext.SubmitChanges();

            submitOperation.Completed += SubmitOperation_Completed;
        }
Beispiel #10
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);
     }
 }
 private void DeleteComplete(SubmitOperation so)
 {
     if (so.HasError)
     {
         UIHelper.SetText(m_statusTextBlock, "Error deleting account. " + so.Error.Message);
         so.MarkErrorAsHandled();
     }
     else
     {
         Logout_External(false);
     }
 }
        public void Inherit_Run_CUD_Update_Derived()
        {
            // Inheritance is City <-- CityWithEditHistory <-- CityWithInfo
            CityDomainContext citiesContext    = new CityDomainContext(TestURIs.Cities);
            DateTime          priorLastUpdated = DateTime.Now;

            // Load all cities, not just derived ones
            LoadOperation   lo                 = citiesContext.Load(citiesContext.GetCitiesQuery());
            SubmitOperation so                 = null;
            CityWithInfo    cityWithInfo       = null;
            string          originalName       = null;
            string          originalStateName  = null;
            string          originalCountyName = null;

            // wait for Load to complete
            EnqueueConditional(() => lo.IsComplete);

            EnqueueCallback(delegate
            {
                cityWithInfo = citiesContext.Cities.OfType <CityWithInfo>().FirstOrDefault();
                Assert.IsNotNull(cityWithInfo, "expected to find at least one CityWithInfo entity");
                Assert.IsFalse(cityWithInfo.EditHistory.Contains("update"), "Did not expect edit history to be set yet.");

                originalName       = cityWithInfo.Name;
                originalStateName  = cityWithInfo.StateName;
                originalCountyName = cityWithInfo.CountyName;

                cityWithInfo.Info = "inserted new info";

                so = citiesContext.SubmitChanges();
            });
            // wait for submit to complete
            EnqueueConditional(() => so.IsComplete);
            EnqueueCallback(delegate
            {
                if (so.Error != null)
                {
                    Assert.Fail("Unexpected error on submit: " + so.Error.Message);
                }

                // verify entities are auto-synced back to the client as a result of the domain method execution on server
                CityWithInfo updatedCity = citiesContext.Cities.OfType <CityWithInfo>().SingleOrDefault <CityWithInfo>
                                               (c => (c.Name == originalName &&
                                                      c.StateName == originalStateName &&
                                                      c.CountyName == originalCountyName));
                Assert.IsNotNull(updatedCity, "Did not find modified City after the submit");
                Assert.IsTrue(updatedCity.EditHistory.Contains("update"), "EditHistory was" + updatedCity.EditHistory);
                Assert.AreEqual("inserted new info", updatedCity.Info, "Updated Info did not get applied");
            });

            EnqueueTestComplete();
        }
Beispiel #13
0
 private ServiceSubmitChangesResult CreateResult(SubmitOperation op)
 {
     if (op.HasError)
     {
         op.MarkErrorAsHandled();
     }
     return(new ServiceSubmitChangesResult(
                op.ChangeSet,
                op.EntitiesInError,
                op.Error,
                op.IsCanceled,
                op.UserState));
 }
Beispiel #14
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);
     }
 }
 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;
     }
 }
Beispiel #16
0
        void importantPartWindow_Closed(object sender, EventArgs e)
        {
            ImportantPartWindow importantPartWindow = sender as ImportantPartWindow;

            if (importantPartWindow.DialogResult == true)
            {
                ImportantPartEntityList.Add(AddImportantPartEntity);
                productDomainContext.important_parts.Add(AddImportantPartEntity.ImportantPart);
                IsBusy = true;
                SubmitOperation submitOperation = productDomainContext.SubmitChanges();
                submitOperation.Completed += submitOperation_Completed;
            }
        }
Beispiel #17
0
        private void AddTaxPayerType_Closed(object sender, EventArgs e)
        {
            TaxPayerTypeWindow lTaxPayerTypeWindow = sender as TaxPayerTypeWindow;

            if (lTaxPayerTypeWindow.DialogResult == true)
            {
                IsBusy = true;
                TaxPayerTypeList.Add(addTaxPayerTypeEntity);
                documentManagerContext.taxpayertypes.Add(addTaxPayerTypeEntity.TaxPayerType);
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
		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;
		}
Beispiel #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";
        }
Beispiel #20
0
        private void departmentWindow_Closed(object sender, EventArgs e)
        {
            DepartmentWindow departmentWindow = sender as DepartmentWindow;

            if (departmentWindow.DialogResult == true)
            {
                DepartmentEntityList.Add(AddDepartmentEntity);
                systemManageDomainContext.departments.Add(AddDepartmentEntity.Department);
                IsBusy = true;
                SubmitOperation submitOperation = systemManageDomainContext.SubmitChanges();
                submitOperation.Completed += submitOperation_Completed;
            }
        }
 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 AddFileType_Closed(object sender, EventArgs e)
        {
            FileTypeWindow lFileTypeWindow = sender as FileTypeWindow;

            if (lFileTypeWindow.DialogResult == true)
            {
                IsBusy = true;
                FileTypeList.Add(addFileTypeEntity);
                documentManagerContext.filetypes.Add(addFileTypeEntity.FileType);
                Log.AddLog(documentManagerContext, addFileTypeEntity.ToString());
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
        private string GenerateSubmitOperationErrorMessage(SubmitOperation op)
        {
            //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);
                }
            }
            return(errorMessage);
        }
        private void UserFile_FinishUpdate(object sender, EventArgs e)
        {
            Status = "完成上传,正在存储";
            App app = Application.Current as App;

            TaxPayerDocumentEntity.TaxPayerUpdateUserId = app.MainPageViewModel.User.UserID;
            TaxPayerDocumentEntity.TaxPayerUpdateTime   = DateTime.Now;
            TaxPayerDocumentEntity.DUpdate();
            documentManagerContext.taxpayerdocuments.Add(TaxPayerDocumentEntity.TaxPayerDocument);
            Log.AddLog(documentManagerContext, TaxPayerDocumentEntity.ToString());
            SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();

            lSubmitOperation.Completed += SubOperation_Completed;
        }
        private void AddUser_Closed(object sender, EventArgs e)
        {
            UserWindow lUserWindow = sender as UserWindow;

            if (lUserWindow.DialogResult == true)
            {
                IsBusy = true;
                UserList.Add(AddUserEntity);
                documentManagerContext.users.Add(AddUserEntity.User);
                Log.AddLog(documentManagerContext, AddUserEntity.ToString());
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
 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();
     }
 }
        private void AddTaxPayer_Closed(object sender, EventArgs e)
        {
            ChildWindow lTaxPayerWindow = sender as ChildWindow;

            if (lTaxPayerWindow.DialogResult == true)
            {
                IsBusy = true;
                TaxPayerList.Add(addTaxPayerEntity);
                documentManagerContext.taxpayers.Add(addTaxPayerEntity.TaxPayer);
                Log.AddLog(documentManagerContext, addTaxPayerEntity.ToString());
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
 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();
     }
 }
        void SubOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (submitOperation.HasError)
            {
                Status = "上传失败 " + submitOperation.Error;
            }
            else
            {
                Status = "上传成功";
                MultiFileUpdateStatus = Entities.MultiFileUpdateStatus.FINISH;
            }
        }
Beispiel #30
0
        void SubmitOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (!submitOperation.HasError)
            {
                using (planOutlineFilesView.DeferRefresh())
                {
                    planOutlineFilesView.MoveToFirstPage();
                }
                //LoadData();
            }
            IsBusy = false;
        }
 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();
     }
 }
Beispiel #32
0
        /// <summary>
        /// Verify successful completion of an update operation
        /// </summary>
        private void VerifySuccess(CompositionInheritanceScenarios ctxt, SubmitOperation so, IEnumerable <Entity> expectedUpdates)
        {
            // verify operation completed successfully
            TestHelperMethods.AssertOperationSuccess(so);

            // verify that all operations were executed
            EntityChangeSet cs = so.ChangeSet;

            VerifyOperationResults(cs.AddedEntities, expectedUpdates);

            // verify that all changes have been accepted
            cs = ctxt.EntityContainer.GetChanges();
            Assert.IsTrue(cs.IsEmpty);
        }
        void updateFileWindow_Closed(object sender, EventArgs e)
        {
            UpdateFileWindow updateFileWindow = sender as UpdateFileWindow;

            if (updateFileWindow.DialogResult == true)
            {
                ProjectFilesEntityList.Add(AddProjectFilesEntity);
                AddProjectFilesEntity.DUpdate();
                ProductDomainContext.project_files.Add(AddProjectFilesEntity.ProjectFiles);
                IsBusy = true;
                SubmitOperation subOperation = ProductDomainContext.SubmitChanges();
                subOperation.Completed += SubOperationCommpleted;
            }
        }
Beispiel #34
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 = "Готово";
     }
 }
        public void OnCarSaved(SubmitOperation op)
        {
            if (op.HasError)
            {
                string errorMessage = GenerateSubmitOperationErrorMessage(op);
                this.SaveUnsuccessfull(errorMessage);

                op.MarkErrorAsHandled();
                return;
            }

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

            this.SaveSuccessfull(successMessage);
        }
Beispiel #36
0
        private void FolderRenamedCallback(SubmitOperation so)
        {
            ReportGroupFolder folderToRename = so.UserState as ReportGroupFolder;

            TreeViewHelper.GetAccessLevels(WebContext.Current.User.Name, myContext.ReportGroups);
            if (so.HasError)
            {
            }
            else
            {
            }
            IsSubmittingContext       = false;
            folderToRename.IsRenaming = false;
            IsUpdatingReportGroups    = false;
        }
 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();           
     }
 }
		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();
				}
			}
		}
 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();
         }
     }
 }
 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 nhân viên :" + txtten.Text.Trim());
             this.txtten.Text = "";
             this.txtmanv.Text ="";                    
             this.txtmanv.Focus();
             //this.txtphone.Text = "";
             //checkEdit1.IsChecked = false;
         }
     }
 }
 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();
         }
     }
 }
        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();
            }
        }
Beispiel #43
0
 private void DeleteSubmitted(SubmitOperation op)
 {
     IsBusy = false;
     if (!op.HasError)
     {
         EntitySpeakerPresentations.Clear();
         SpeakerPresentations.Clear();
         SelectedPresentation = null;
         GetEventPresentationsForSpeaker(App.Event.Id, App.LoggedInPerson.Id);
     }
     else
     {
         EventAggregator.Publish(new ErrorWindowEvent { Exception = op.Error, ViewModelName = "SpeakerViewModel" });
         _loggingService.LogException(op.Error);
     }
 }
Beispiel #44
0
 /// <summary>
 /// Execute when a user was saved
 /// </summary>
 /// <param name="operation">Operation result</param>
 private void SaveCompleted(SubmitOperation operation)
 {
     HandleSubmitOperation(operation, () =>
     {
         GlobalAccessor.Instance.MessageStatus = Strings.UserUpdateStatusMessage;
         Initialize(_user.UserId, string.Concat(User.FirstName, " ", User.LastName));
         if (_user.UserName.ToLower() == App.CurrentUser.Name.ToLower())
         {
             AlertDisplay(Strings.CurrentUserUpdateInformation);
         }
         if (OnSaveCompleted != null)
             OnSaveCompleted(this, EventArgs.Empty);
     });
 }
        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();
            }
        }
        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, "Изпращане на полица"));
        }
 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();
     }
 }
 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 + ".");
         }
     }
 }
Beispiel #49
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();
            }
        }
 /// <summary>
 /// 提交元素完成
 /// </summary>
 /// <param name="result"></param>
 private void SubmitPropertyCompleted(SubmitOperation result)
 {
     tbWait.IsBusy = false;
     //AddElementNumber++;
     //if (listMonitorAddElement.Count <= AddElementNumber)
     if(!result.HasError)
     {
         if (IsShowSaveToot)
         {
             IsShowSaveToot = false;
             MessageBox.Show("保存成功!", "温馨提示", MessageBoxButton.OK);
         }
         ISBack = false;
         LoadScreenData(_CurrentScreen);
         return;
     }
     //t_Element elem = listMonitorAddElement[AddElementNumber].ScreenElement;
     //_DataContext.t_Elements.Add(elem);
     //_DataContext.SubmitChanges(SubmitCompleted, null);
 }
 private void GroupingSave_Submited(SubmitOperation result)
 {
     if (Utils.LoadOperation_Error_Handled(result.Error, "SmartMap"))
     {
         SmartMap_DomainContext context = new SmartMap_DomainContext();
         groupcounter += 1;
         ProvinceGrouping grouping = (ProvinceGrouping)result.UserState;
         if (groupcounter < _groups.Count)
         {
             ProvinceGroup group = new ProvinceGroup { Name = _groups[groupcounter].GroupName, ProvinceGroupingID = grouping.ID };
             if (_groups[groupcounter].Provinces.Count > 0)
                 group.ParentRegionMapID = _groups[groupcounter].Provinces[0].RegionMapID;
             context.ProvinceGroups.Add(group);
             foreach (RegionMap rm in _groups[groupcounter].Provinces)
             {
                 ProvinceGroupRegionMap link = new ProvinceGroupRegionMap();
                 link.ProvinceGroupID = group.ID;
                 link.RegionMapID = rm.RegionMapID;
                 context.ProvinceGroupRegionMaps.Add(link);
             }
             context.SubmitChanges(GroupingSave_Submited, grouping);
         }
         else
         {
             DoneClickedEventArgs args = new DoneClickedEventArgs(grouping);
             this.OnClosed(args);
             this.DialogResult = true;
         }
     }
 }
 private void ChangedNameGrouping_Saved(SubmitOperation result)
 {
     SmartMap_DomainContext context = new SmartMap_DomainContext();
     context.PakKonAllProductProvinceGrouping(_grouping.ID, ProductProvinceGroup_Deleted, null);
 }
 private void ProductProvinceGroupings_Submitted(SubmitOperation result)
 {
     if (Utils.LoadOperation_Error_Handled(result.Error, "SmartMap"))
     {
         DoneClickedEventArgs args = new DoneClickedEventArgs(_grouping);
         this.OnClosed(args);
         this.DialogResult = true;
     }
 }
        public void OnCarSaved(SubmitOperation op)
        {
            if (op.HasError)
            {
                string errorMessage = GenerateSubmitOperationErrorMessage(op);
                this.SaveUnsuccessfull(errorMessage);

                op.MarkErrorAsHandled();
                return;
            }

            string successMessage = "Записът е успешен!";
            this.SaveSuccessfull(successMessage);
        }
 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();
     }
 }
        private string GenerateSubmitOperationErrorMessage(SubmitOperation op)
        {
            //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);
                }

            }
            return errorMessage;
        }
        /// <summary>
        /// 提交元素完成。
        /// </summary>
        /// <param name="result"></param>
        private void SubmitCompleted(SubmitOperation result)
        {
            if (!result.HasError)
            {
                EntityChangeSet obj = result.ChangeSet;
                if (obj.AddedEntities.Count == 0 && listMonitorModifiedElement.Count == 0)
                {
                    tbWait.IsBusy = false;
                    if (IsShowSaveToot)
                    {
                        IsShowSaveToot = false;
                        MessageBox.Show("保存成功!", "温馨提示", MessageBoxButton.OK);
                    }
                    ISBack = false;
                    LoadScreenData(_CurrentScreen);
                    return;
                }

                var parentID = 0;
                var screenID = 0;
                // 新增
                if (obj.AddedEntities.Count == listMonitorAddElement.Count)
                {
                    for (int i = 0; i < obj.AddedEntities.Count; i++)
                    {
                        var addElement = obj.AddedEntities[i] as t_Element;
                        var addMonitorControl = listMonitorAddElement[i];
                        var listProperties = listMonitorAddElement[i].ListElementProp;

                        if (addElement.ControlID.HasValue
                            && addElement.ControlID.Value != -9999
                            && addElement.ScreenID.HasValue)
                        {
                            parentID = addElement.ElementID;
                            screenID = addElement.ScreenID.Value;
                        }
                        else if (!addElement.ScreenID.HasValue)
                        {
                            var editElment = _DataContext.t_Elements.FirstOrDefault(t => t.ElementID == addElement.ElementID);
                            if (null != editElment)
                            {
                                editElment.ParentID = parentID;
                                editElment.ScreenID = screenID;
                            }
                        }

                        if (addMonitorControl is RealTimeT)
                        {
                            var addRealTimeT = addMonitorControl as RealTimeT;
                            foreach (var line in addRealTimeT.ListRealTimeLine)
                            {
                                line.LineInfo.ScreenID = _CurrentScreen.ScreenID;
                                line.LineInfo.ElementID = addElement.ElementID;
                                _DataContext.t_Element_RealTimeLines.Add(line.LineInfo.Clone());
                            }
                        }

                        foreach (var ep in listProperties)
                        {
                            ep.ElementID = addElement.ElementID;
                            _DataContext.t_ElementProperties.Add(ep.Clone());
                        }
                    }
                }

                foreach (var monitorControl in listMonitorModifiedElement)
                {
                    var modifiedElement = monitorControl.ScreenElement;

                    if (monitorControl is RealTimeT)
                    {
                        var addRealTimeT = monitorControl as RealTimeT;
                        foreach (var line in addRealTimeT.ListRealTimeLine)
                        {
                            line.LineInfo.ScreenID = _CurrentScreen.ScreenID;
                            line.LineInfo.ElementID = monitorControl.ScreenElement.ElementID;
                            _DataContext.t_Element_RealTimeLines.Add(line.LineInfo.Clone());
                        }
                    }

                    foreach (var ep in monitorControl.ListElementProp)
                    {
                        ep.ElementID = modifiedElement.ElementID;
                        _DataContext.t_ElementProperties.Add(ep.Clone());
                    }
                }

                if (_DataContext.HasChanges)
                {
                    _DataContext.SubmitChanges(SubmitPropertyCompleted, null);
                }
            }
            else
            {
                tbWait.IsBusy = false;
            }
        }
        /// <summary>
        /// Callback method for SubmitChanges
        /// </summary>
        /// <param name="operation"></param>
        private void SubmitOperationCompleted(SubmitOperation operation)
        {
            HandleSubmitOperation(operation, delegate
            {
                IsBusy = false;
                if (RefeshSecurityPaperList != null)
                    RefeshSecurityPaperList(this, EventArgs.Empty);

                ExecuteCancelCommand();
            });
        }
 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();
     }
 }
 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();    
     }
 }