コード例 #1
0
 private ShareFileClient()
 {
     Apps                 = new AppsEntity(this);
     Favorites            = new FavoritesEntity(this);
     WebhookClients       = new WebhookClientsEntity(this);
     WebhookSubscriptions = new WebhookSubscriptionsEntity(this);
     Workflows            = new WorkflowsEntity(this);
     Policies             = new PoliciesEntity(this);
     ConnectorGroups      = new ConnectorGroupsEntity(this);
     EncryptedEmails      = new EncryptedEmailsEntity(this);
     FileLock             = new FileLockEntity(this);
     RemoteUploads        = new RemoteUploadsEntity(this);
     Reports              = new ReportsEntity(this);
     FolderTemplates      = new FolderTemplatesEntity(this);
     AccessControls       = new AccessControlsEntity(this);
     Accounts             = new AccountsEntity(this);
     AsyncOperations      = new AsyncOperationsEntity(this);
     Capabilities         = new CapabilitiesEntity(this);
     Devices              = new DevicesEntity(this);
     FavoriteFolders      = new FavoriteFoldersEntity(this);
     Groups               = new GroupsEntity(this);
     Items                = new ItemsEntity(this);
     Metadata             = new MetadataEntity(this);
     Sessions             = new SessionsEntity(this);
     Shares               = new SharesEntity(this);
     StorageCenters       = new StorageCentersEntity(this);
     Users                = new UsersEntity(this);
     Zones                = new ZonesEntity(this);
     SamlMetadata         = new SamlMetadataEntity(this);
 }
コード例 #2
0
        public static void SaveNewSessionDocument(
            SessionsEntity sessionsEntity, Word.Document document)
        {
            ///Combine path: ConfigurePath/Sang_Datetime_SessionId
            string name       = Utils.FormatDateTimeToSaveFile(sessionsEntity.meetingDay) + sessionsEntity.meetingEntity.name.Substring(0, 1);
            string folderName = Utils.fromUtf8ToAscii(sessionsEntity.meetingEntity.name) + "_" +
                                sessionsEntity.meetingDay + "_" + sessionsEntity.idSession;

            string[] combinePath     = { AppsSettings.GetInstance().DataDir, sessionsEntity.activity.name, folderName };
            string[] combineFullPath = { AppsSettings.GetInstance().DataDir, sessionsEntity.activity.name, folderName, name + ".docx" };

            if (!Directory.Exists(Path.Combine(combinePath)))
            {
                Directory.CreateDirectory(Path.Combine(combinePath));
            }

            ///Check file is exist or not
            int version = 0;

            while (File.Exists(Path.Combine(combineFullPath)) && version <= 10)
            {
                version = version + 1;
                combineFullPath[combineFullPath.Length - 1] = name + "_" + version + ".docx";
            }

            string fillFileName = Path.Combine(combineFullPath);

            ///0.Save as other document
            document.SaveAs2(fillFileName);
            ///1. Remove all document
            TextHelpers.RemoveAllContent(document);
        }
コード例 #3
0
 private ShareFileClient()
 {
     ConnectorGroups = new ConnectorGroupsEntity(this);
     FolderTemplates = new FolderTemplatesEntity(this);
     AccessControls  = new AccessControlsEntity(this);
     Accounts        = new AccountsEntity(this);
     AsyncOperations = new AsyncOperationsEntity(this);
     Capabilities    = new CapabilitiesEntity(this);
     FavoriteFolders = new FavoriteFoldersEntity(this);
     Groups          = new GroupsEntity(this);
     Items           = new ItemsEntity(this);
     Metadata        = new MetadataEntity(this);
     Sessions        = new SessionsEntity(this);
     Shares          = new SharesEntity(this);
     StorageCenters  = new StorageCentersEntity(this);
     Users           = new UsersEntity(this);
     Zones           = new ZonesEntity(this);
 }
コード例 #4
0
ファイル: SessionList.cs プロジェクト: hungnvk54/OfficeAddin
        private void ChangeSessionInfoBinding(int rowIndex)
        {
            SessionsEntity entity = null;

            if (this.mSearchSession.Count > 0 && rowIndex < this.mSearchSession.Count)
            {
                entity = this.mSearchSession[rowIndex];
            }
            else if (this.mListSession.Count > 0 && rowIndex < this.mListSession.Count)
            {
                entity = this.mListSession[rowIndex];
            }

            if (entity != null)
            {
                BindingSessionInfo(entity);
            }
        }
コード例 #5
0
        // Business Logic pass through code to Update Session
        public bool UpdateSession(SessionsEntity entity)
        {
            try
            {
                bool bOpDoneSuccessfully;
                using (var repository = new SessionsRepository())
                {
                    bOpDoneSuccessfully = repository.Update(entity);
                }

                return(bOpDoneSuccessfully);
            }
            catch (Exception ex)
            {
                //Log exception error
                _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);

                throw new Exception("BusinessLogic:SessionsBusiness::UpdateSession::Error occured.", ex);
            }
        }
コード例 #6
0
 private void InsertSession(int sitterid, int ownerid, string status, DateTime?date, decimal fee)
 {
     try
     {
         using (var sessions = new SessionsBusiness())
         {
             var entity = new SessionsEntity();
             entity.SitterID = sitterid;
             entity.OwnerID  = ownerid;
             entity.Status   = status;
             entity.Date     = date;
             entity.Fee      = fee;
             var opSuccessful = sessions.InsertSession(entity);
         }
     }
     catch (Exception ex)
     {
         //Log exception error
         _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);
     }
 }
コード例 #7
0
        public static void SaveRepresentativeDocument(
            SessionsEntity sessionsEntity, Word.Document document, string representaiveName
            )
        {
            ///Combine path: ConfigurePath/Sang_Datetime_SessionId
            string name       = representaiveName + ".docx";
            string folderName = Utils.fromUtf8ToAscii(sessionsEntity.meetingEntity.name) + "_" +
                                sessionsEntity.meetingDay + "_" + sessionsEntity.idSession;

            string[] combinePath     = { AppsSettings.GetInstance().DataDir, sessionsEntity.activity.name, folderName };
            string[] combineFullPath = { AppsSettings.GetInstance().DataDir, sessionsEntity.activity.name, folderName, name };

            if (!Directory.Exists(Path.Combine(combinePath)))
            {
                Directory.CreateDirectory(Path.Combine(combinePath));
            }
            string fillFileName = Path.Combine(combineFullPath);

            ///0.Save as other document
            document.SaveAs2(Path.Combine(fillFileName));
        }
コード例 #8
0
        private void InitForm(SessionsEntity sessionsEntity)
        {
            if (sessionsEntity != null)
            {
                this.LB_KyHop.Text       = sessionsEntity.meeting.ToString();
                this.LB_Khoa.Text        = sessionsEntity.nationalAssembly.ToString();
                this.LB_NgayHop.Text     = Utils.FormatDateTime(sessionsEntity.meetingDay);
                this.LB_Buoi.Text        = sessionsEntity.meetingEntity.name;
                this.LB_HoatDong.Text    = sessionsEntity.activity.name;
                this.LB_NguoiChuTri.Text = sessionsEntity.leadConference;
                if (sessionsEntity.activityGroup != null)
                {
                    this.LB_To.Text = sessionsEntity.activityGroup.nameActivityGroup;
                }
                this.LB_MaPhien.Text = sessionsEntity.idSession.ToString();
                switch (sessionsEntity.public_status)
                {
                case 0:
                    this.LB_XuatBan.Text      = "Chưa xuất bản";
                    this.LB_XuatBan.ForeColor = Color.Black;
                    break;

                case 1:
                    this.LB_XuatBan.Text      = "Xuất bản lỗi";
                    this.LB_XuatBan.ForeColor = Color.Red;
                    break;

                case 2:
                    this.LB_XuatBan.Text      = "Đã xuất bản";
                    this.LB_XuatBan.ForeColor = Color.Green;
                    break;

                case 3:
                    this.LB_XuatBan.Text      = "Đã thu hồi";
                    this.LB_XuatBan.ForeColor = Color.Black;
                    break;
                }
                this.RTB_NoiDung.Text = sessionsEntity.contentMeeting;
            }
        }
コード例 #9
0
ファイル: SessionList.cs プロジェクト: hungnvk54/OfficeAddin
        private void BindingSessionInfo(SessionsEntity entity)
        {
            this.LB_term.Text           = entity.nationalAssembly.ToString();
            this.LB_kyhop.Text          = entity.meeting.ToString();
            this.LB_MeetingDate.Text    = Utils.FormatDateTime(entity.meetingDay);
            this.LB_Buoi.Text           = entity.meetingEntity.name;
            this.LB_HoatDong.Text       = entity.activity.name;
            this.LB_LeadConference.Text = entity.leadConference;
            if (entity.activityGroup != null)
            {
                this.LB_To.Text = entity.activityGroup.nameActivityGroup;
            }
            this.LB_MaPhien.Text = entity.idSession.ToString();

            switch (entity.public_status)
            {
            case 0:
                this.LB_XuatBan.Text      = "Chưa xuất bản";
                this.LB_XuatBan.ForeColor = Color.Black;
                break;

            case 1:
                this.LB_XuatBan.Text      = "Xuất bản lỗi";
                this.LB_XuatBan.ForeColor = Color.Red;
                break;

            case 2:
                this.LB_XuatBan.Text      = "Đã xuất bản";
                this.LB_XuatBan.ForeColor = Color.Green;
                break;

            case 3:
                this.LB_XuatBan.Text      = "Đã thu hồi";
                this.LB_XuatBan.ForeColor = Color.Black;
                break;
            }

            this.RTB_NoiDung.Text = entity.contentMeeting;
        }
コード例 #10
0
ファイル: SessionList.cs プロジェクト: hungnvk54/OfficeAddin
        private void SelectRow(int rowIndex)
        {
            SessionsEntity entity = null;

            if (this.mSearchSession.Count > 0)
            {
                entity = this.mSearchSession[rowIndex];
            }
            else if (this.mListSession.Count > 0)
            {
                entity = this.mListSession[rowIndex];
            }

            if (entity != null)
            {
                AppsSettings.GetInstance().Session = entity;
                DialogResult = DialogResult.OK;
            }
            else
            {
                DialogResult = DialogResult.Cancel;
            }
        }
コード例 #11
0
 public SessionInformationForm(SessionsEntity sessionsEntity)
 {
     InitializeComponent();
     InitForm(sessionsEntity);
 }
コード例 #12
0
        /// <summary>
        /// Create default title.
        /// BẢN TỔNG HỢP THẢO LUẬN TẠI HỘI TRƯỜNG
        ///       (Ghi theo băng ghi âm)
        ///      Buổi sáng ngày 07/12/2020
        ///             Nội dung:
        ///                 1
        ///      Đại biểu chủ trì 2 chủ trì
        ///Người điều hành nội dung điều hành nội dung

        /// </summary>
        /// <param name="document"></param>
        /// <param name="sessionEntity"></param>
        public static void CreateDocumentTitle(Word.Document document, SessionsEntity sessionEntity)
        {
            Word.Selection selection = Globals.ThisAddIn.Application.Selection;

            /// Create title
            /// BẢN TỔNG HỢP THẢO LUẬN TẠI HỘI TRƯỜNG
            string meetingTitle = "BẢN TỔNG HỢP THẢO LUẬN TẠI HỘI TRƯỜNG";

            if (sessionEntity.activity.type == Constants.ACTIVITY_TYPE_TO)
            {
                meetingTitle = string.Format("BẢN TỔNG HỢP THẢO LUẬN TẠI {0}", sessionEntity.activityGroup.nameActivityGroup);
            }
            selection.set_Style(document.Styles[Constants.MeetingTitleStyle]);
            selection.TypeText(meetingTitle);
            selection.TypeParagraph();

            ///  (Ghi theo băng ghi âm)
            selection.set_Style(document.Styles[Constants.RecordingTitleStyle]);
            selection.TypeText("(Ghi theo băng ghi âm)");
            selection.TypeParagraph();

            ///Buổi sáng ngày 07/12/2020
            string meetingDate = string.Format("Buổi {0} ngày {1}", sessionEntity.meetingEntity.name.ToLower(), Utils.FormatDateTime(sessionEntity.meetingDay));

            selection.set_Style(document.Styles[Constants.MeetingTimeTitleStyle]);
            selection.TypeText(meetingDate);
            selection.TypeParagraph();

            /// Tieu de: Nội dung:
            selection.set_Style(document.Styles[Constants.MeetingContentTitleStyle]);
            selection.TypeText("Nội dung:");
            selection.TypeParagraph();

            /// Noi dung
            selection.set_Style(document.Styles[Constants.MeetingContentTitleStyle]);
            selection.TypeText(sessionEntity.contentMeeting);
            selection.TypeParagraph();

            if (sessionEntity.activity.type == Constants.ACTIVITY_TYPE_TO)
            {
                string contentControl = string.Format("Chủ trì: {0}", sessionEntity.leadConference);
                selection.set_Style(document.Styles[Constants.MeetingContentTitleStyle]);
                selection.TypeText(contentControl);
                selection.TypeParagraph();
                selection.set_Style(document.Styles[Constants.ContentStyle]);
            }
            else
            {
                ///Đại biểu chủ trì 2 chủ
                string leadingCoference = string.Format("{0} chủ trì", sessionEntity.leadConference);
                selection.set_Style(document.Styles[Constants.MeetingContentTitleStyle]);
                selection.TypeText(leadingCoference);
                selection.TypeParagraph();

                ///Người điều hành nội dung điều hành nội dung
                string contentControl = string.Format("{0} điều hành nội dung", sessionEntity.personContentControl);
                selection.set_Style(document.Styles[Constants.MeetingContentTitleStyle]);
                selection.TypeText(contentControl);
                selection.TypeParagraph();
                selection.set_Style(document.Styles[Constants.ContentStyle]);
            }

            if (AppsSettings.GetInstance().IsAddPageNumber == false)
            {
                Globals.ThisAddIn.Application.ActiveWindow.ActivePane.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekCurrentPageFooter;
                Globals.ThisAddIn.Application.ActiveWindow.ActivePane.Selection.Paragraphs.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
                Object CurrentPage = Word.WdFieldType.wdFieldPage;
                Globals.ThisAddIn.Application.ActiveWindow.Selection.Fields.Add(Globals.ThisAddIn.Application.ActiveWindow.Selection.Range, ref CurrentPage);

                Globals.ThisAddIn.Application.ActiveWindow.ActivePane.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekMainDocument;

                AppsSettings.GetInstance().IsAddPageNumber = true;
            }
        }