private void SetUIVisibleByUserRights() { pbAuditTrail.Visible = Common.IsAuthorized(RightsText.ViewAuditTrail); dataManager.PnSignHis.Visible = dataManager.BtnSign.Visible = Common.IsAuthorized(RightsText.SignRecords); viewManager.PnSignHis.Visible = viewManager.BtnSign.Visible = Common.IsAuthorized(RightsText.SignRecords); viewManager.PbDeviceConfig.Visible = Common.IsAuthorized(RightsText.ConfigurateDevices); dataManager.TbCmt.Enabled = Common.IsAuthorized(RightsText.CommentRecords); }
protected void checkWhetherSectionShouldBeShown() { if (this.device != null) { if (SoftwareVersions.Pro == Common.Versions && Common.GlobalProfile != null && Common.GlobalProfile.IsShowHeader) { byte[] logoByte = Common.GlobalProfile.Logo; string contactInfo = Common.GlobalProfile.ContactInfo; if (logoByte != null || !string.IsNullOrWhiteSpace(contactInfo)) { this.isHeaderShown = true; } } if (this.device.AlarmMode != 0) { this.isAlarmShown = true; } if (Common.IsAuthorized(RightsText.CommentRecords)) { if (!string.IsNullOrWhiteSpace(this.CurrentComment) && this.CurrentComment != ReportConstString.CommentDefaultString) { this.isCommentShown = true; } } if (this.device.DeviceID < 200) { this.isDescriptionShown = false; } if (this.device.AlarmMode > 0 && this.device.tempList.Count > 0) { if (IsDeviceAlarming(this.device)) { this.reportTitleIconStatus = ReportTitleIconStatus.Alarm; } else { this.reportTitleIconStatus = ReportTitleIconStatus.OK; } } if (this.signatureList != null && this.signatureList.Count > 0) { this.isSignatureShown = true; } } }
public ReportEditorExporter(DeviceDataFrom deviceDataFrom, SuperDevice device, IList <DigitalSignature> signatureList, Panel documentPanel, TextBox tbReportTitle, TextBox tbReportComment, Label lblReportEditorTip) : base(deviceDataFrom, device, signatureList) { if (Common.IsAuthorized(RightsText.CommentRecords)) { this.isCommentShown = true; } this.tbReportTitle = tbReportTitle; this.tbReportComment = tbReportComment; this.lblReportEditorTip = lblReportEditorTip; this.documentPanel = documentPanel; this.calculateSectionMargin(); documentPanel.SizeChanged += new EventHandler(documentPanel_SizeChanged); documentPanel.Controls.Clear(); this.AddNewPage(); if (this.tbReportTitle != null) { this.tbReportTitle.TextChanged += new EventHandler(tbReportTitle_TextChanged); } }
protected override void GenerateComments() { if (Common.IsAuthorized(RightsText.CommentRecords) && this.tbReportComment != null) { int heightBetweenTitleAndContent = 5; int tbCommentContentheight = 51; Label lblCommentTitle = new Label(); lblCommentTitle.Font = SectionTitleFont; lblCommentTitle.Text = "Comments"; this.AddSection(lblCommentTitle); this.tbReportComment.Multiline = true; this.tbReportComment.ScrollBars = ScrollBars.None; this.tbReportComment.Font = new Font("Arial", 9); this.tbReportComment.Width = DefaultSectionWidth; this.tbReportComment.Height = tbCommentContentheight; this.tbReportComment.Top = lblCommentTitle.Bottom + heightBetweenTitleAndContent; //this.tbReportComment.MaxLength = 200; this.AddSection(this.tbReportComment); } }