/// <summary> /// UploadDocument Callback Method /// </summary> /// <param name="result">usl of uploaded document</param> private void UploadDocumentCallbackMethod(String result) { string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name); Logging.LogBeginMethod(logger, methodNamespace); try { if (result != null && result != String.Empty) { Logging.LogMethodParameter(logger, methodNamespace, result, 1); if (DbInteractivity != null) { DbInteractivity.SetUploadFileInfo(UserSession.SessionManager.SESSION.UserName, uploadWindow.UploadFileName , result, uploadWindow.UploadFileCompanyInfo, null, null , EnumUtils.GetDescriptionFromEnumValue <DocumentCategoryType>(uploadWindow.UploadFileType) , uploadWindow.UploadFileTags, uploadWindow.UploadFileNotes, SetUploadFileInfoCallbackMethod); } } else { Logging.LogMethodParameterNull(logger, methodNamespace, 1); BusyIndicatorNotification(); } } catch (Exception ex) { Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK); Logging.LogException(logger, ex); BusyIndicatorNotification(); } Logging.LogEndMethod(logger, methodNamespace); }
/// <summary> /// SetDocumentComment Callback Method /// </summary> /// <param name="result">True if successful</param> public void SetDocumentCommentCallbackMethod(Boolean?result) { string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name); Logging.LogBeginMethod(logger, methodNamespace); try { if (result == true) { Logging.LogMethodParameter(logger, methodNamespace, result, 1); if (SearchStringText != null && DbInteractivity != null) { BusyIndicatorNotification(true, "Updating Search Results..."); DbInteractivity.RetrieveDocumentsData(SearchStringText, RetrieveDocumentsDataCallbackMethod); } } else { Logging.LogMethodParameterNull(logger, methodNamespace, 1); } } catch (Exception ex) { Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK); Logging.LogException(logger, ex); } Logging.LogEndMethod(logger, methodNamespace); }
/// <summary> /// DocumentSearchCommand execution method /// </summary> /// <param name="param"></param> private void DocumentSearchCommandMethod(object param) { if (SearchStringText != null && DbInteractivity != null) { BusyIndicatorNotification(true, "Retrieving Search Results..."); DbInteractivity.RetrieveDocumentsData(SearchStringText, RetrieveDocumentsDataCallbackMethod); } }
/// <summary> /// uploadWindow Unloaded EventHandler /// </summary> /// <param name="sender"></param> /// <param name="e">RoutedEventArgs</param> void uploadWindow_Unloaded(object sender, RoutedEventArgs e) { if (uploadWindow.DialogResult == true) { if (DbInteractivity != null) { BusyIndicatorNotification(true, "Uploading Document..."); DbInteractivity.UploadDocument(uploadWindow.UploadFileName, uploadWindow.UploadFileByteStream, String.Empty, UploadDocumentCallbackMethod); } } }
/// <summary> /// DocumentEditDeleteCommand execution method /// </summary> /// <param name="param"></param> private void DocumentEditDeleteCommandMethod(object param) { ChildViewDocumentsEditDelete editDeleteWindow = new ChildViewDocumentsEditDelete(DbInteractivity, logger, CompanyInfo); editDeleteWindow.Show(); editDeleteWindow.Unloaded += (se, e) => { if (SearchStringText != null && DbInteractivity != null) { BusyIndicatorNotification(true, "Retrieving Search Results..."); DbInteractivity.RetrieveDocumentsData(SearchStringText, RetrieveDocumentsDataCallbackMethod); } }; }
/// <summary> /// SetUploadFileInfo Callback Method /// </summary> /// <param name="result">True if successful</param> private void SetUploadFileInfoCallbackMethod(Boolean?result) { string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name); Logging.LogBeginMethod(logger, methodNamespace); try { if (result != null) { Logging.LogMethodParameter(logger, methodNamespace, result, 1); if (uploadWindow.UserAlertEmails != null && uploadWindow.UserAlertEmails.Count != 0) { BusyIndicatorNotification(true, "Updation messaging queue..."); String emailTo = String.Join("|", uploadWindow.UserAlertEmails.ToArray()); String emailSubject = "Document Upload Alert"; String emailMessageBody = "Document upload notification. Please find the details below:\n" + "Name - " + uploadWindow.UploadFileName + "\n" + "Company - " + uploadWindow.UploadFileCompanyInfo + "\n" + "Type - " + EnumUtils.GetDescriptionFromEnumValue <DocumentCategoryType>(uploadWindow.UploadFileType) + "\n" + "Tags - " + uploadWindow.UploadFileTags + "\n" + "Notes - " + uploadWindow.UploadFileNotes; DbInteractivity.SetMessageInfo(emailTo, null, emailSubject, emailMessageBody, null , UserSession.SessionManager.SESSION.UserName, SetMessageInfoCallbackMethod); } else if (SearchStringText != null && DbInteractivity != null) { BusyIndicatorNotification(true, "Retrieving Search Results..."); DbInteractivity.RetrieveDocumentsData(SearchStringText, RetrieveDocumentsDataCallbackMethod); } else { BusyIndicatorNotification(); } } else { Logging.LogMethodParameterNull(logger, methodNamespace, 1); BusyIndicatorNotification(); } } catch (Exception ex) { Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK); Logging.LogException(logger, ex); BusyIndicatorNotification(); } Logging.LogEndMethod(logger, methodNamespace); }
/// <summary> /// RetrieveCompanyData Callback Method /// </summary> /// <param name="result">list of issuers</param> private void RetrieveCompanyDataCallbackMethod(List <String> result) { string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name); Logging.LogBeginMethod(logger, methodNamespace); try { if (result != null) { Logging.LogMethodParameter(logger, methodNamespace, result, 1); CompanyInfo = result; if (DbInteractivity != null && UserInfo == null) { BusyIndicatorNotification(true, "Retrieving User Information..."); DbInteractivity.GetAllUsers(GetAllUsersCallbackMethod); } else { if (uploadWindow == null) { uploadWindow = new ChildViewDocumentsUpload(DbInteractivity, logger, CompanyInfo, UserInfo); uploadWindow.Unloaded += new RoutedEventHandler(uploadWindow_Unloaded); BusyIndicatorNotification(); } } } else { Logging.LogMethodParameterNull(logger, methodNamespace, 1); BusyIndicatorNotification(); } } catch (Exception ex) { Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK); Logging.LogException(logger, ex); BusyIndicatorNotification(); } finally { Logging.LogEndMethod(logger, methodNamespace); } }