This commit is contained in:
502
source/WinFormApp/MemoReaderForm.cs
Normal file
502
source/WinFormApp/MemoReaderForm.cs
Normal file
@@ -0,0 +1,502 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using GZTW.AyaNova.BLL;
|
||||
using Infragistics.Win;
|
||||
using log4net;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace AyaNova
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for MemoReaderForm.
|
||||
/// </summary>
|
||||
public class MemoReaderForm : System.Windows.Forms.Form
|
||||
{
|
||||
// Create a logger for use in this class
|
||||
//case 1039 private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private System.Windows.Forms.CheckBox ckIsDirty;
|
||||
private System.Windows.Forms.ErrorProvider ErrorProvider;
|
||||
private System.Windows.Forms.Panel panelLeft;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager tbManager;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _MemoReaderForm_Toolbars_Dock_Area_Left;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _MemoReaderForm_Toolbars_Dock_Area_Right;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _MemoReaderForm_Toolbars_Dock_Area_Top;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _MemoReaderForm_Toolbars_Dock_Area_Bottom;
|
||||
private Infragistics.Win.UltraWinEditors.UltraTextEditor edMessage;
|
||||
private Infragistics.Win.UltraWinEditors.UltraTextEditor edHeader;
|
||||
private System.ComponentModel.IContainer components;
|
||||
|
||||
|
||||
public MemoReaderForm()
|
||||
{
|
||||
//
|
||||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose( bool disposing )
|
||||
{
|
||||
if( disposing )
|
||||
{
|
||||
if(components != null)
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose( disposing );
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("MemoReaderToolbar");
|
||||
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool1 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("LT:UI.Toolbar.Print");
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:Memo.Label.Command.Reply");
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:Memo.Label.Command.Forward");
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Delete");
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:Memo.Label.Command.Reply");
|
||||
Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:Memo.Label.Command.Forward");
|
||||
Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Delete");
|
||||
Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool2 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("LT:UI.Toolbar.Print");
|
||||
Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.UltraWinToolbars.ListTool listTool1 = new Infragistics.Win.UltraWinToolbars.ListTool("REPORTLIST");
|
||||
Infragistics.Win.UltraWinToolbars.ListTool listTool2 = new Infragistics.Win.UltraWinToolbars.ListTool("REPORTLIST");
|
||||
this.ckIsDirty = new System.Windows.Forms.CheckBox();
|
||||
this.panelLeft = new System.Windows.Forms.Panel();
|
||||
this.edHeader = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
||||
this.edMessage = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
||||
this.ErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
||||
this.tbManager = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
||||
this.panelLeft.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.edHeader)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.edMessage)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ErrorProvider)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbManager)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// ckIsDirty
|
||||
//
|
||||
this.ckIsDirty.Location = new System.Drawing.Point(-336, 28);
|
||||
this.ckIsDirty.Name = "ckIsDirty";
|
||||
this.ckIsDirty.Size = new System.Drawing.Size(196, 27);
|
||||
this.ckIsDirty.TabIndex = 5;
|
||||
//
|
||||
// panelLeft
|
||||
//
|
||||
this.panelLeft.Controls.Add(this.edHeader);
|
||||
this.panelLeft.Controls.Add(this.edMessage);
|
||||
this.panelLeft.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panelLeft.Location = new System.Drawing.Point(0, 43);
|
||||
this.panelLeft.Name = "panelLeft";
|
||||
this.panelLeft.Size = new System.Drawing.Size(294, 214);
|
||||
this.panelLeft.TabIndex = 96;
|
||||
//
|
||||
// edHeader
|
||||
//
|
||||
this.edHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.edHeader.BorderStyle = Infragistics.Win.UIElementBorderStyle.None;
|
||||
this.edHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.edHeader.Location = new System.Drawing.Point(10, 18);
|
||||
this.edHeader.Multiline = true;
|
||||
this.edHeader.Name = "edHeader";
|
||||
this.edHeader.ReadOnly = true;
|
||||
this.edHeader.Scrollbars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.edHeader.Size = new System.Drawing.Size(275, 74);
|
||||
this.edHeader.TabIndex = 148;
|
||||
//
|
||||
// edMessage
|
||||
//
|
||||
this.edMessage.AlwaysInEditMode = true;
|
||||
this.edMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
appearance1.BackColor = System.Drawing.SystemColors.Window;
|
||||
appearance1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
this.edMessage.Appearance = appearance1;
|
||||
this.edMessage.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.edMessage.BorderStyle = Infragistics.Win.UIElementBorderStyle.None;
|
||||
this.edMessage.Location = new System.Drawing.Point(10, 92);
|
||||
this.edMessage.Multiline = true;
|
||||
this.edMessage.Name = "edMessage";
|
||||
this.edMessage.ReadOnly = true;
|
||||
this.edMessage.Scrollbars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.edMessage.Size = new System.Drawing.Size(275, 65);
|
||||
this.edMessage.TabIndex = 93;
|
||||
//
|
||||
// ErrorProvider
|
||||
//
|
||||
this.ErrorProvider.ContainerControl = this;
|
||||
//
|
||||
// _MemoReaderForm_Toolbars_Dock_Area_Left
|
||||
//
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 43);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left.Name = "_MemoReaderForm_Toolbars_Dock_Area_Left";
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 214);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Left.ToolbarsManager = this.tbManager;
|
||||
//
|
||||
// tbManager
|
||||
//
|
||||
this.tbManager.DesignerFlags = 1;
|
||||
this.tbManager.DockWithinContainer = this;
|
||||
this.tbManager.DockWithinContainerBaseType = typeof(System.Windows.Forms.Form);
|
||||
this.tbManager.ShowFullMenusDelay = 500;
|
||||
ultraToolbar1.DockedColumn = 0;
|
||||
ultraToolbar1.DockedRow = 0;
|
||||
ultraToolbar1.NonInheritedTools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
|
||||
popupMenuTool1,
|
||||
buttonTool1,
|
||||
buttonTool2,
|
||||
buttonTool3});
|
||||
this.tbManager.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
|
||||
ultraToolbar1});
|
||||
this.tbManager.ToolbarSettings.AllowCustomize = Infragistics.Win.DefaultableBoolean.False;
|
||||
this.tbManager.ToolbarSettings.AllowFloating = Infragistics.Win.DefaultableBoolean.False;
|
||||
this.tbManager.ToolbarSettings.AllowHiding = Infragistics.Win.DefaultableBoolean.False;
|
||||
appearance2.Image = global::AyaNova.Resource1.MemoRepliedTo32;
|
||||
buttonTool4.SharedPropsInternal.AppearancesLarge.Appearance = appearance2;
|
||||
appearance3.Image = global::AyaNova.Resource1.MemoRepliedTo16;
|
||||
buttonTool4.SharedPropsInternal.AppearancesSmall.Appearance = appearance3;
|
||||
buttonTool4.SharedPropsInternal.Caption = "LT:Memo.Label.Command.Reply";
|
||||
appearance4.Image = global::AyaNova.Resource1.MemoForwarded32;
|
||||
buttonTool5.SharedPropsInternal.AppearancesLarge.Appearance = appearance4;
|
||||
appearance5.Image = global::AyaNova.Resource1.MemoForwarded16;
|
||||
buttonTool5.SharedPropsInternal.AppearancesSmall.Appearance = appearance5;
|
||||
buttonTool5.SharedPropsInternal.Caption = "LT:Memo.Label.Command.Forward";
|
||||
appearance6.Image = global::AyaNova.Resource1.Delete32;
|
||||
buttonTool6.SharedPropsInternal.AppearancesLarge.Appearance = appearance6;
|
||||
appearance7.Image = global::AyaNova.Resource1.Delete16;
|
||||
buttonTool6.SharedPropsInternal.AppearancesSmall.Appearance = appearance7;
|
||||
buttonTool6.SharedPropsInternal.Caption = "LT:UI.Command.Delete";
|
||||
popupMenuTool2.Settings.ToolDisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
|
||||
appearance8.Image = global::AyaNova.Resource1.Print32;
|
||||
popupMenuTool2.SharedPropsInternal.AppearancesLarge.Appearance = appearance8;
|
||||
appearance9.Image = global::AyaNova.Resource1.Print16;
|
||||
popupMenuTool2.SharedPropsInternal.AppearancesSmall.Appearance = appearance9;
|
||||
popupMenuTool2.SharedPropsInternal.Caption = "LT:UI.Toolbar.Print";
|
||||
popupMenuTool2.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageOnlyOnToolbars;
|
||||
popupMenuTool2.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
|
||||
listTool1});
|
||||
listTool2.DisplayCheckmark = false;
|
||||
listTool2.SharedPropsInternal.Caption = "REPORTLIST";
|
||||
this.tbManager.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
|
||||
buttonTool4,
|
||||
buttonTool5,
|
||||
buttonTool6,
|
||||
popupMenuTool2,
|
||||
listTool2});
|
||||
this.tbManager.UseLargeImagesOnToolbar = true;
|
||||
this.tbManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.tbManager_ToolClick);
|
||||
//
|
||||
// _MemoReaderForm_Toolbars_Dock_Area_Right
|
||||
//
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(294, 43);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right.Name = "_MemoReaderForm_Toolbars_Dock_Area_Right";
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 214);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Right.ToolbarsManager = this.tbManager;
|
||||
//
|
||||
// _MemoReaderForm_Toolbars_Dock_Area_Top
|
||||
//
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top.Name = "_MemoReaderForm_Toolbars_Dock_Area_Top";
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(294, 43);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Top.ToolbarsManager = this.tbManager;
|
||||
//
|
||||
// _MemoReaderForm_Toolbars_Dock_Area_Bottom
|
||||
//
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 257);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom.Name = "_MemoReaderForm_Toolbars_Dock_Area_Bottom";
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(294, 0);
|
||||
this._MemoReaderForm_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.tbManager;
|
||||
//
|
||||
// MemoReaderForm
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
||||
this.ClientSize = new System.Drawing.Size(294, 257);
|
||||
this.Controls.Add(this.panelLeft);
|
||||
this.Controls.Add(this.ckIsDirty);
|
||||
this.Controls.Add(this._MemoReaderForm_Toolbars_Dock_Area_Left);
|
||||
this.Controls.Add(this._MemoReaderForm_Toolbars_Dock_Area_Right);
|
||||
this.Controls.Add(this._MemoReaderForm_Toolbars_Dock_Area_Bottom);
|
||||
this.Controls.Add(this._MemoReaderForm_Toolbars_Dock_Area_Top);
|
||||
this.MinimumSize = new System.Drawing.Size(306, 294);
|
||||
this.Name = "MemoReaderForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
|
||||
this.Closing += new System.ComponentModel.CancelEventHandler(this.MemoReaderForm_Closing);
|
||||
this.Load += new System.EventHandler(this.MemoReaderForm_Load);
|
||||
this.panelLeft.ResumeLayout(false);
|
||||
this.panelLeft.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.edHeader)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.edMessage)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ErrorProvider)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbManager)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
|
||||
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
|
||||
// ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
|
||||
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
|
||||
//
|
||||
|
||||
#region Form Load / Close
|
||||
//variable to hold user form settings
|
||||
//UIUserFormSetting mFormSetting;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Prepare the form
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void MemoReaderForm_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
//case 1039 //log.Debug("MemoReaderForm_Load");
|
||||
|
||||
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
this.Visible=false;
|
||||
this.Icon = Resource1.Memo16icon;
|
||||
|
||||
//See if user has any rights to be here...
|
||||
//(this is done here to ensure that no matter what happens if a user has no rights they can't get here
|
||||
//useful in case we miss a way of getting to a Memo edit screen from elsewhere in the program)
|
||||
if(AyaBizUtils.Right("Object.Memo")< (int)SecurityLevelTypes.ReadOnly)//Less than read only instead of NoAccess to catch records where it's zero instead of 1
|
||||
{
|
||||
//Inform them of their wicked ways and boot them out of here...
|
||||
|
||||
MessageBox.Show(string.Format(
|
||||
Util.LocaleText.GetLocalizedText("Error.Security.NotAuthorizedToRetrieve"),
|
||||
Util.LocaleText.GetLocalizedText("O.Memo")));
|
||||
|
||||
this.Close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
DisplayMemo();
|
||||
Util.LoadFormCustomization("MemoReader", this, tbManager, false);
|
||||
Util.PluginInsertMenu(tbManager, new Util.PluginMenuOptionData(true, RootObjectTypes.Memo, mMemo, null));//case 941
|
||||
if (AyaBizUtils.Right("Object.Report") < (int)SecurityLevelTypes.ReadOnly)
|
||||
{
|
||||
tbManager.Tools["LT:UI.Toolbar.Print"].SharedProps.Visible = false;
|
||||
}//LT:UI.Toolbar.Print
|
||||
else
|
||||
{
|
||||
tbManager.Tools["LT:UI.Toolbar.Print"].SharedProps.Visible = true;
|
||||
Util.ReportFillList(this.tbManager.Tools["REPORTLIST"], MemoList.ReportKey, MemoList.DetailedReportKey);
|
||||
}
|
||||
Util.LocalizeHelperInsertMenu(tbManager, this); //case 1810
|
||||
Util.Localize(this);
|
||||
Cursor.Current = Cursors.Default;
|
||||
this.Visible=true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Save form layout and grid layout for next time
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void MemoReaderForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
//case 1039 //log.Debug("MemoReaderForm_Closing");
|
||||
Util.SaveFormCustomization("MemoReader", this, tbManager, false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Display
|
||||
|
||||
/// <summary>
|
||||
/// Fill in the form fields with the memo
|
||||
/// data
|
||||
/// </summary>
|
||||
private void DisplayMemo()
|
||||
{
|
||||
|
||||
|
||||
this.edHeader.Text=mMemo.Header;
|
||||
|
||||
//Message
|
||||
this.edMessage.Text=mMemo.Message;
|
||||
|
||||
//Since the user is about to view it, flag it as viewed
|
||||
if(mMemo.Viewed==false)
|
||||
{
|
||||
Memo.FlagMessageRead(mMemo.ID);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Toolbar menu items
|
||||
|
||||
/// <summary>
|
||||
/// Respond to a click on a toolbar menu item
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void tbManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
|
||||
{
|
||||
//case 1039 //if(log.IsDebugEnabled) //case 1039 //log.Debug("ToolClick: "+e.Tool.Key);
|
||||
|
||||
switch (e.Tool.Key)
|
||||
{
|
||||
case "LT:Memo.Label.Command.Reply": // ButtonTool
|
||||
{
|
||||
MemoComposerForm mcf=new MemoComposerForm();
|
||||
mcf.MemoToEdit=mMemo.ReplyForward(false);
|
||||
|
||||
mcf.Visible=false;
|
||||
mcf.ShowDialog();
|
||||
if(mcf.ChangesMade)
|
||||
Memo.FlagMessageReplied(mMemo.ID);
|
||||
this.Close();
|
||||
}
|
||||
break;
|
||||
|
||||
case "LT:Memo.Label.Command.Forward": // ButtonTool
|
||||
{
|
||||
MemoComposerForm mcf=new MemoComposerForm();
|
||||
mcf.MemoToEdit=mMemo.ReplyForward(true);
|
||||
|
||||
mcf.Visible=false;
|
||||
mcf.ShowDialog();
|
||||
if(mcf.ChangesMade)
|
||||
Memo.FlagMessageReplied(mMemo.ID);
|
||||
|
||||
this.Close();
|
||||
}
|
||||
break;
|
||||
|
||||
case "LT:UI.Command.Delete": // ButtonTool
|
||||
Memo.DeleteItem(mMemo.ID);
|
||||
mbChangesMade = true;//case 1880
|
||||
this.Close();
|
||||
break;
|
||||
|
||||
case "REPORTLIST":
|
||||
{
|
||||
if (Util.ReportHandleToolClickIsSummary(e.Tool))
|
||||
Util.ReportHandleToolClick(e.Tool, MemoList.ReportKey,
|
||||
MemoList.GetListForSingleItem(mMemo.ID));
|
||||
//else
|
||||
//{
|
||||
// Util.ReportHandleToolClick(e.Tool, MemoListDetailed.ReportKey,
|
||||
// MemoListDetailed.GetListForSingleItem(mMemo.ID));
|
||||
//}
|
||||
Util.ReportFillList(this.tbManager.Tools["REPORTLIST"], MemoList.ReportKey,
|
||||
MemoList.DetailedReportKey);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion Toolbar menu items
|
||||
|
||||
|
||||
|
||||
|
||||
#region Global vars / props
|
||||
|
||||
|
||||
|
||||
|
||||
private GZTW.AyaNova.BLL.MemoFetcher mMemo;
|
||||
/// <summary>
|
||||
/// Memo record to display
|
||||
/// set by caller
|
||||
/// </summary>
|
||||
public GZTW.AyaNova.BLL.MemoFetcher MemoToRead
|
||||
{
|
||||
|
||||
set
|
||||
{
|
||||
mMemo=value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Used to signal to main form that there are changes
|
||||
//which could affect it if true
|
||||
private bool mbChangesMade = false;
|
||||
public bool ChangesMade
|
||||
{
|
||||
get
|
||||
{
|
||||
return mbChangesMade;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user