Example #1
0
        private void btn_ResetAll_Click(object sender, RibbonControlEventArgs e)
        {
            DialogResult dialogResult = CreateInformationDialog.CreateConfirmBoxWithTwoButton("" +
                                                                                              "Tổng hợp lại toàn bộ sẽ xóa toàn bộ thay đổi trên tệp tổng hợp và ghép lại các băng đã được kiểm duyệt. Bạn có muốn tiếp tục?", "Cảnh báo");

            try
            {
                if (dialogResult == DialogResult.Yes && AppsSettings.GetInstance().Session != null)
                {
                    Debug.WriteLine("Xoa toan bo");
                    ///1. Reset merged request

                    bool resetMergedStatus = Request.ResetMergeDocument(AppsSettings.GetInstance().Session.idSession);

                    if (resetMergedStatus == true)
                    {
                        ///Call remerged document
                        //2. Goi ham merge doc
                        AudioEntity entity = Request.GetParentAudioByIdSession(AppsSettings.GetInstance().Session.idSession);
                        if (entity == null)
                        {
                            CreateInformationDialog.CreateWarningBox("Không tồn tại tệp âm thanh tổng hợp", "cảnh báo");
                        }
                        else
                        {
                            Boolean isRequestSuccessful = Request.RequestMerge(entity.idAudio);
                            if (isRequestSuccessful == true)
                            {
                                NotificationFactor.InfoNotification("Tổng hợp biên bản thành công");
                            }
                            else
                            {
                                NotificationFactor.ErrorNotification("Tổng hợp biên bản thất bại");
                            }
                        }
                        //3.Goi ham lay lai du lieu
                        //Get document Entity
                        DocumentEntity documentEntity = Request.getMergedDocument(AppsSettings.GetInstance().Session.idSession);
                        //4.Clear current document
                        AppsSettings.GetInstance().DocumentName = null; // To avoid save document when call the saveAs method
                        Word.Document document = Globals.ThisAddIn.Application.ActiveDocument;
                        WordProcessingHelper.SaveNewSessionDocument(AppsSettings.GetInstance().Session, document);
                        WordProcessingHelper.CreateDocumentTitle(document, AppsSettings.GetInstance().Session);
                        //4. day du lieu ra ma hinh
                        WordProcessingHelper.InsertDataToMergedDocument(Globals.ThisAddIn.Application.ActiveDocument, documentEntity);
                        AppsSettings.GetInstance().IsRepresentativeSplit = false;
                        AppsSettings.GetInstance().DocumentName          = document.FullName;
                    }
                    else
                    {
                        NotificationFactor.ErrorNotification("Không thể tổng hợp lại biên bản");
                    }
                }
            } catch (Exception ex)
            {
                NotificationFactor.ErrorNotification("Không thể tổng hợp lại biên bản");
            }
        }
Example #2
0
        private void Btn_ListSession_Click(object sender, RibbonControlEventArgs e)
        {
            if (AppsSettings.GetInstance().isLogin == false)
            {
                MessageBox.Show("Bạn phải đăng nhập trước khi sử dụng", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (AppsSettings.GetInstance().Session != null)
                {
                    DialogResult dialogResult = CreateInformationDialog.CreateConfirmBoxWithTwoButton(
                        "Bạn đang mở phiên họp. Bạn có muốn lưu lại nội dung phiên họp hiện tại không?",
                        "Cảnh bảo");
                    if (dialogResult == DialogResult.Yes)
                    {
                        SaveDocumentToRemoteServer(false);
                    }
                }

                DialogResult result = DialogResult.OK;
                result = this.mSessionListForm.CustomDialogShow();
                if (result == DialogResult.OK)
                {
                    ///Create new document and save as new file
                    Word.Document document = Globals.ThisAddIn.Application.ActiveDocument;
                    AppsSettings.GetInstance().DocumentName = null; //To prevent save unknow document
                    WordProcessingHelper.SaveNewSessionDocument(AppsSettings.GetInstance().Session, document);
                    ///Create default document
                    WordProcessingHelper.CreateDocumentTitle(document,
                                                             AppsSettings.GetInstance().Session);
                    AppsSettings.GetInstance().DocumentName = document.FullName;
                    //Get document Entity
                    DocumentEntity documentEntity = Request.getMergedDocument(AppsSettings.GetInstance().Session.idSession);
                    WordProcessingHelper.InsertDataToMergedDocument(document, documentEntity);
                    ///Load predefine data
                    mRepresentativeForm.FillingData();
                    AppsSettings.GetInstance().IsRepresentativeSplit = false;
                    this.FocusMainDocument();
                    this.ActiveControl();
                }
            }
        }