using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using GZTW.AyaNova.BLL; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using log4net; namespace AyaNova { /// /// Summary description for NotifySubscriptionInfoForm. /// public class NotifySubscriptionInfoForm : 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 Infragistics.Win.UltraWinToolbars.UltraToolbarsManager tbManager; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom; private Infragistics.Win.UltraWinEditors.UltraTextEditor edEventDescription; private Infragistics.Win.UltraWinEditors.UltraNumericEditor edPendingSpan; private Infragistics.Win.UltraWinEditors.UltraComboEditor cbPendingSpanUnit; private Infragistics.Win.Misc.UltraLabel lblPendingSpan; private System.Windows.Forms.Panel panelSpanFields; private Infragistics.Win.UltraWinGrid.UltraGrid Grid; private Infragistics.Win.Misc.UltraLabel ultraLabel1; private System.Windows.Forms.Panel panelHeader; private Infragistics.Win.Misc.UltraLabel ultraLabel2; private System.Windows.Forms.Panel panelWorkorderStatus; private GZTW.WinForm.Controls.GZUltraComboEditor cbWorkorderStatus; private System.Windows.Forms.Panel panelDeliveryGrid; private System.ComponentModel.IContainer components; public NotifySubscriptionInfoForm() { // // Required for Windows Form Designer support // InitializeComponent(); } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("NotifySubscriptionEntryMenuBar"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.SaveClose"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.RecordHistory"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Save"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Delete"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Close"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.SaveClose"); Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance(); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.RecordHistory"); Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance(); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Save"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Close"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Delete"); Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance(); Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem(); Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance(); this.ckIsDirty = new System.Windows.Forms.CheckBox(); this.tbManager = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components); this.ErrorProvider = new System.Windows.Forms.ErrorProvider(this.components); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this.panelHeader = new System.Windows.Forms.Panel(); this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel(); this.edEventDescription = new Infragistics.Win.UltraWinEditors.UltraTextEditor(); this.panelSpanFields = new System.Windows.Forms.Panel(); this.edPendingSpan = new Infragistics.Win.UltraWinEditors.UltraNumericEditor(); this.cbPendingSpanUnit = new Infragistics.Win.UltraWinEditors.UltraComboEditor(); this.lblPendingSpan = new Infragistics.Win.Misc.UltraLabel(); this.Grid = new Infragistics.Win.UltraWinGrid.UltraGrid(); this.panelWorkorderStatus = new System.Windows.Forms.Panel(); this.cbWorkorderStatus = new GZTW.WinForm.Controls.GZUltraComboEditor(); this.ultraLabel2 = new Infragistics.Win.Misc.UltraLabel(); this.panelDeliveryGrid = new System.Windows.Forms.Panel(); ((System.ComponentModel.ISupportInitialize)(this.tbManager)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ErrorProvider)).BeginInit(); this.panelHeader.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.edEventDescription)).BeginInit(); this.panelSpanFields.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.edPendingSpan)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cbPendingSpanUnit)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.Grid)).BeginInit(); this.panelWorkorderStatus.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.cbWorkorderStatus)).BeginInit(); this.panelDeliveryGrid.SuspendLayout(); this.SuspendLayout(); // // ckIsDirty // this.ckIsDirty.Location = new System.Drawing.Point(-336, 28); this.ckIsDirty.Name = "ckIsDirty"; this.ckIsDirty.Size = new System.Drawing.Size(198, 27); this.ckIsDirty.TabIndex = 5; // // 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[] { buttonTool1, buttonTool2, buttonTool3, buttonTool4, buttonTool5}); ultraToolbar1.Text = "NotifySubscriptionEntryMenuBar"; 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; buttonTool6.SharedPropsInternal.AccessibleDescription = "recorddd"; appearance3.Image = global::AyaNova.Resource1.SaveExit32; buttonTool6.SharedPropsInternal.AppearancesLarge.Appearance = appearance3; appearance4.Image = global::AyaNova.Resource1.SaveExit16; buttonTool6.SharedPropsInternal.AppearancesSmall.Appearance = appearance4; buttonTool6.SharedPropsInternal.Caption = "LT:UI.Command.SaveClose"; appearance5.Image = global::AyaNova.Resource1.RecordHistory32; buttonTool7.SharedPropsInternal.AppearancesLarge.Appearance = appearance5; appearance6.Image = global::AyaNova.Resource1.RecordHistory16; buttonTool7.SharedPropsInternal.AppearancesSmall.Appearance = appearance6; buttonTool7.SharedPropsInternal.Caption = "LT:UI.Command.RecordHistory"; buttonTool8.SharedPropsInternal.Caption = "LT:UI.Command.Save"; buttonTool8.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.TextOnlyAlways; buttonTool9.SharedPropsInternal.Caption = "LT:UI.Command.Close"; buttonTool9.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.TextOnlyAlways; appearance7.Image = global::AyaNova.Resource1.Delete32; buttonTool10.SharedPropsInternal.AppearancesLarge.Appearance = appearance7; appearance8.Image = global::AyaNova.Resource1.Delete16; buttonTool10.SharedPropsInternal.AppearancesSmall.Appearance = appearance8; buttonTool10.SharedPropsInternal.Caption = "LT:UI.Command.Delete"; this.tbManager.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] { buttonTool6, buttonTool7, buttonTool8, buttonTool9, buttonTool10}); this.tbManager.UseLargeImagesOnToolbar = true; this.tbManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.tbManager_ToolClick); // // ErrorProvider // this.ErrorProvider.ContainerControl = this; // // _NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left // this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 43); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left.Name = "_NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left"; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 483); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left.ToolbarsManager = this.tbManager; // // _NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right // this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(574, 43); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right.Name = "_NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right"; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 483); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right.ToolbarsManager = this.tbManager; // // _NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top // this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top.Name = "_NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top"; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(574, 43); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top.ToolbarsManager = this.tbManager; // // _NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom // this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 526); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom.Name = "_NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom"; this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(574, 0); this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.tbManager; // // panelHeader // this.panelHeader.Controls.Add(this.ultraLabel1); this.panelHeader.Controls.Add(this.edEventDescription); this.panelHeader.Dock = System.Windows.Forms.DockStyle.Top; this.panelHeader.Location = new System.Drawing.Point(0, 43); this.panelHeader.Name = "panelHeader"; this.panelHeader.Size = new System.Drawing.Size(574, 73); this.panelHeader.TabIndex = 101; // // ultraLabel1 // this.ultraLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.ultraLabel1.Location = new System.Drawing.Point(10, 0); this.ultraLabel1.Name = "ultraLabel1"; this.ultraLabel1.Size = new System.Drawing.Size(564, 18); this.ultraLabel1.TabIndex = 155; this.ultraLabel1.Tag = ""; this.ultraLabel1.Text = "LT:NotifySubscription.Label.EventDescription"; this.ultraLabel1.WrapText = false; // // edEventDescription // this.edEventDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.edEventDescription.BorderStyle = Infragistics.Win.UIElementBorderStyle.InsetSoft; this.edEventDescription.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.edEventDescription.Location = new System.Drawing.Point(10, 18); this.edEventDescription.Multiline = true; this.edEventDescription.Name = "edEventDescription"; this.edEventDescription.ReadOnly = true; this.edEventDescription.Scrollbars = System.Windows.Forms.ScrollBars.Vertical; this.edEventDescription.Size = new System.Drawing.Size(554, 47); this.edEventDescription.TabIndex = 149; // // panelSpanFields // this.panelSpanFields.Controls.Add(this.edPendingSpan); this.panelSpanFields.Controls.Add(this.cbPendingSpanUnit); this.panelSpanFields.Controls.Add(this.lblPendingSpan); this.panelSpanFields.Dock = System.Windows.Forms.DockStyle.Top; this.panelSpanFields.Location = new System.Drawing.Point(0, 163); this.panelSpanFields.Name = "panelSpanFields"; this.panelSpanFields.Size = new System.Drawing.Size(574, 73); this.panelSpanFields.TabIndex = 154; // // edPendingSpan // this.edPendingSpan.Location = new System.Drawing.Point(10, 28); this.edPendingSpan.MinValue = 0; this.edPendingSpan.Name = "edPendingSpan"; this.edPendingSpan.PromptChar = ' '; this.edPendingSpan.Size = new System.Drawing.Size(86, 24); this.edPendingSpan.TabIndex = 151; // // cbPendingSpanUnit // this.cbPendingSpanUnit.Location = new System.Drawing.Point(106, 28); this.cbPendingSpanUnit.Name = "cbPendingSpanUnit"; this.cbPendingSpanUnit.Size = new System.Drawing.Size(172, 24); this.cbPendingSpanUnit.TabIndex = 153; // // lblPendingSpan // this.lblPendingSpan.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblPendingSpan.Location = new System.Drawing.Point(0, 0); this.lblPendingSpan.Name = "lblPendingSpan"; this.lblPendingSpan.Size = new System.Drawing.Size(564, 18); this.lblPendingSpan.TabIndex = 150; this.lblPendingSpan.Tag = ""; this.lblPendingSpan.Text = "LT:NotifySubscription.Label.PendingSpan"; this.lblPendingSpan.WrapText = false; // // Grid // this.Grid.Cursor = System.Windows.Forms.Cursors.Hand; this.Grid.DisplayLayout.AddNewBox.Hidden = false; appearance1.TextHAlignAsString = "Left"; this.Grid.DisplayLayout.CaptionAppearance = appearance1; this.Grid.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.True; this.Grid.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False; this.Grid.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True; this.Grid.Dock = System.Windows.Forms.DockStyle.Fill; this.Grid.Location = new System.Drawing.Point(0, 0); this.Grid.Name = "Grid"; this.Grid.Size = new System.Drawing.Size(574, 290); this.Grid.TabIndex = 103; this.Grid.BeforeRowInsert += new Infragistics.Win.UltraWinGrid.BeforeRowInsertEventHandler(this.Grid_BeforeRowInsert); this.Grid.DoubleClick += new System.EventHandler(this.Grid_DoubleClick); this.Grid.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Grid_KeyUp); this.Grid.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Grid_MouseDown); // // panelWorkorderStatus // this.panelWorkorderStatus.Controls.Add(this.cbWorkorderStatus); this.panelWorkorderStatus.Controls.Add(this.ultraLabel2); this.panelWorkorderStatus.Dock = System.Windows.Forms.DockStyle.Top; this.panelWorkorderStatus.Location = new System.Drawing.Point(0, 116); this.panelWorkorderStatus.Name = "panelWorkorderStatus"; this.panelWorkorderStatus.Size = new System.Drawing.Size(574, 47); this.panelWorkorderStatus.TabIndex = 155; // // cbWorkorderStatus // this.cbWorkorderStatus.AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend; this.cbWorkorderStatus.DropDownButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Never; this.cbWorkorderStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); appearance2.BackColor = System.Drawing.SystemColors.GrayText; valueListItem1.Appearance = appearance2; valueListItem1.DataValue = new System.Guid("00000000-0000-0000-0000-000000000000"); valueListItem1.DisplayText = ""; this.cbWorkorderStatus.Items.AddRange(new Infragistics.Win.ValueListItem[] { valueListItem1}); this.cbWorkorderStatus.LimitToList = true; this.cbWorkorderStatus.Location = new System.Drawing.Point(10, 18); this.cbWorkorderStatus.Name = "cbWorkorderStatus"; this.cbWorkorderStatus.ReadOnly = true; this.cbWorkorderStatus.Size = new System.Drawing.Size(566, 25); this.cbWorkorderStatus.SortStyle = Infragistics.Win.ValueListSortStyle.Ascending; this.cbWorkorderStatus.TabIndex = 152; // // ultraLabel2 // this.ultraLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.ultraLabel2.Location = new System.Drawing.Point(10, 0); this.ultraLabel2.Name = "ultraLabel2"; this.ultraLabel2.Size = new System.Drawing.Size(554, 18); this.ultraLabel2.TabIndex = 151; this.ultraLabel2.Tag = ""; this.ultraLabel2.Text = "LT:O.WorkorderStatus"; this.ultraLabel2.WrapText = false; // // panelDeliveryGrid // this.panelDeliveryGrid.Controls.Add(this.Grid); this.panelDeliveryGrid.Dock = System.Windows.Forms.DockStyle.Fill; this.panelDeliveryGrid.Location = new System.Drawing.Point(0, 236); this.panelDeliveryGrid.Name = "panelDeliveryGrid"; this.panelDeliveryGrid.Size = new System.Drawing.Size(574, 290); this.panelDeliveryGrid.TabIndex = 156; // // NotifySubscriptionInfoForm // this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); this.ClientSize = new System.Drawing.Size(574, 526); this.Controls.Add(this.panelDeliveryGrid); this.Controls.Add(this.panelSpanFields); this.Controls.Add(this.panelWorkorderStatus); this.Controls.Add(this.panelHeader); this.Controls.Add(this.ckIsDirty); this.Controls.Add(this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Left); this.Controls.Add(this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Right); this.Controls.Add(this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Bottom); this.Controls.Add(this._NotifySubscriptionInfoForm_Toolbars_Dock_Area_Top); this.MinimumSize = new System.Drawing.Size(586, 563); this.Name = "NotifySubscriptionInfoForm"; this.ShowInTaskbar = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; this.Text = "LT:O.NotifySubscription"; this.Closing += new System.ComponentModel.CancelEventHandler(this.NotifySubscriptionInfoForm_Closing); this.Load += new System.EventHandler(this.NotifySubscriptionInfoForm_Load); ((System.ComponentModel.ISupportInitialize)(this.tbManager)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ErrorProvider)).EndInit(); this.panelHeader.ResumeLayout(false); this.panelHeader.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.edEventDescription)).EndInit(); this.panelSpanFields.ResumeLayout(false); this.panelSpanFields.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.edPendingSpan)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cbPendingSpanUnit)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.Grid)).EndInit(); this.panelWorkorderStatus.ResumeLayout(false); this.panelWorkorderStatus.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.cbWorkorderStatus)).EndInit(); this.panelDeliveryGrid.ResumeLayout(false); this.ResumeLayout(false); } #endregion // __ _ _ ___ ____ __ __ __ __ __ ___ ___ // / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _) // ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _) // \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___) // #region Form Load / Close /// /// Prepare the form /// /// /// private void NotifySubscriptionInfoForm_Load(object sender, System.EventArgs e) { //case 1039 //log.Debug("NotifySubscriptionInfoForm_Load"); Cursor.Current = Cursors.WaitCursor; this.Visible=false; this.Icon = Resource1.NotificationDeliveryMethod16icon; //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 NotifySubscription edit screen from elsewhere in the program) if(AyaBizUtils.Right("Object.Notification")< (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.Notification"))); this.Close(); return; } InitializeComboBoxes(); DataBind(); InitializeGrid(); //Show the description of the current event this.edEventDescription.Text=Util.LocaleText.GetLocalizedText(this.mNotifySubscription.EventDescriptionLocalizedTextKey); //restrict UI based on security settings RestrictUI(); Util.LoadFormCustomization("NotifySubscriptionInfo", this, tbManager, false); Util.PluginInsertMenu(tbManager, new Util.PluginMenuOptionData(true, RootObjectTypes.NotifySubscription, mNotifySubscription, null));//case 941 Util.Localize(this); //Display appropriate extra info panels... if(!this.mNotifySubscription.IsUserTimeFrameSelectableEvent) { this.panelSpanFields.Visible=false; } if(!this.mNotifySubscription.IsWorkorderStatusEvent) this.panelWorkorderStatus.Visible=false; Cursor.Current = Cursors.Default; Application.Idle+= new EventHandler(Application_Idle); this.Visible=true; } /// /// Used to track whether the close was done by the program /// or done by the user clicking on the upper left corner X control /// bool bClosingHandled=false; /// /// Save form layout and grid layout for next time /// /// /// private void NotifySubscriptionInfoForm_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //case 1039 //log.Debug("NotifySubscriptionInfoForm_Closing"); if(!bClosingHandled) { //Save record if necessary //User may opt to not cancel exit if(!RecordUpdate(RecordActionType.PromptToSave) ) { e.Cancel=true; return; } } Application.Idle-= new EventHandler(Application_Idle); Util.SaveFormCustomization("NotifySubscriptionInfo", this, tbManager, false); } #endregion #region Form UI commands #region Toolbar menu items /// /// Respond to a click on a toolbar menu item /// /// /// 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:UI.Command.SaveClose": // ButtonTool RecordUpdate(RecordActionType.SaveAndExit); break; case "LT:UI.Command.RecordHistory": // ButtonTool RecordHistoryForm RH=new RecordHistoryForm(mNotifySubscription.Creator,mNotifySubscription.Modifier,mNotifySubscription.Created,mNotifySubscription.Modified); RH.ShowDialog(); RH.Dispose(); break; case "LT:UI.Command.Save": // ButtonTool RecordUpdate(RecordActionType.SaveOnly); break; case "LT:UI.Command.Close": // ButtonTool this.Close(); break; case "LT:UI.Command.Delete": // ButtonTool RecordUpdate(RecordActionType.DeleteAndExit); break; } } #endregion Toolbar menu items #endregion Form UI commands #region Form UI / Business object synchronization /// /// Synchronize the state of the UI to the BO's /// private void SyncUI() { } /// /// When the application enters an idle state /// update the UI to reflect changs in BO status /// (required because grids don't tell the UI to update when they are /// bound to a business object and are edited) /// /// /// private void Application_Idle(object sender, EventArgs e) { //SyncUI(); } /// /// Adapt UI to accomodate users security access level /// by default form is set with full rights in mind /// so this code just needs to restrict them as required /// private void RestrictUI() { //case 1039 //if(log.IsDebugEnabled) //case 1039 //log.Debug("RestrictUI: " + ((SecurityLevelTypes)AyaBizUtils.Right("Object.Notification")).ToString()); //NotifySubscription - Full but no delete tbManager.Tools["LT:UI.Command.Delete"].SharedProps.Visible=(AyaBizUtils.Right("Object.Notification")== (int)SecurityLevelTypes.ReadWrite); //NotifySubscription - Read only bool bReadOnly=AyaBizUtils.Right("Object.Notification")== (int)SecurityLevelTypes.ReadOnly; tbManager.Tools["LT:UI.Command.SaveClose"].SharedProps.Visible=!bReadOnly; tbManager.Tools["LT:UI.Command.Delete"].SharedProps.Visible=!bReadOnly; tbManager.Tools["LT:UI.Command.Save"].SharedProps.Visible=!bReadOnly; //DISABLE EDITABLE CONTROLS if(this.mNotifySubscription.IsUserTimeFrameSelectableEvent) { //Numeric editors this.edPendingSpan.ReadOnly=bReadOnly; //Combo boxes this.cbPendingSpanUnit.ReadOnly=bReadOnly; } } #endregion #region Form DataBinding and BrokenRules handling /// /// Bind controls to business objects /// private void DataBind() { //case 1039 //log.Debug("DataBind"); //Subscribe to broken rules changed event OnBrokenRulesChanged mNotifySubscription.GetBrokenRulesCollection().ListChanged += new System.ComponentModel.ListChangedEventHandler(OnBrokenRulesChanged); //=-=-=-=-=-=- Form Field bindings =-=-=-=-=-=-=-=-=-=-=-= if(mNotifySubscription.IsUserTimeFrameSelectableEvent) { //Numeric input editor Util.BindField(edPendingSpan,"Value",mNotifySubscription,"PendingSpan"); //Combo boxes Util.BindField(cbPendingSpanUnit,"Value",mNotifySubscription,"PendingSpanUnit"); } if(mNotifySubscription.IsWorkorderStatusEvent) Util.BindField(this.cbWorkorderStatus,"Value",mNotifySubscription,"GuidValue"); //Grids Util.BindField(Grid,"DataSource",mNotifySubscription,"Deliveries"); //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //Bind IsDirty property to hidden checkbox to //ensure isdirtychanged event is available //to data binding infrastructure Util.BindField(ckIsDirty,"Checked",mNotifySubscription,"IsDirty"); //Setup initial link to broken rules OnBrokenRulesChanged(null,null); } /// /// Handle a change in broken rules /// /// /// private void OnBrokenRulesChanged(object sender, System.ComponentModel.ListChangedEventArgs e) { Util.BrokenRuleFeedback(this,mNotifySubscription,ErrorProvider); } #endregion #region Business object editing / adding / deletion related code private GZTW.AyaNova.BLL.NotifySubscription mNotifySubscription; /// /// NotifySubscription record to display /// set by caller /// public GZTW.AyaNova.BLL.NotifySubscription NotifySubscriptionToEdit { get { return mNotifySubscription; } set { mNotifySubscription=value; //mNotifySubscription.BeginEdit(); } } //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; } } /// /// Update record and quit if requested /// /// /// True if handled, false if not handled private bool RecordUpdate(RecordActionType SaveType) { //case 1039 //if(log.IsDebugEnabled) //case 1039 //log.Debug("SaveHandler(Action="+SaveType.ToString()+")"); //switch the focus to a non-editable control //so that any changes in the current editable control //will get updated before attempting to save lblPendingSpan.Focus(); switch(SaveType) { case RecordActionType.DeleteAndExit: if(Util.PromptForDelete()==DialogResult.Yes) { try { //Delete, then exit GZTW.AyaNova.BLL.NotifySubscription.DeleteItem(mNotifySubscription.ID); } catch(Exception ex) { Util.ReportSQLError(ex); return false; } bClosingHandled=true; this.Close(); mbChangesMade=true; return true; } else return false; case RecordActionType.SaveAndExit: //Save if necessary and exit if(mNotifySubscription.IsSavable) { mNotifySubscription.ApplyEdit(); mNotifySubscription.Save(); bClosingHandled=true; mbChangesMade=true; this.Close(); return true; } if(mNotifySubscription.IsDirty)//dirty and unsaveable due to broken rules { if(Util.PromptForBrokenRulesCancelSave()==DialogResult.Yes) { bClosingHandled=true; this.Close(); return true; } else return false; } //not dirty so just exit bClosingHandled=true; this.Close(); return true; case RecordActionType.SaveOnly: if(mNotifySubscription.IsSavable) { mNotifySubscription.ApplyEdit(); mNotifySubscription=(GZTW.AyaNova.BLL.NotifySubscription)mNotifySubscription.Save(); DataBind(); mbChangesMade=true; return true; } return true; case RecordActionType.PromptToSave: //Prompt to save and save if //required if(mNotifySubscription.IsDirty) { DialogResult dr=Util.PromptForSave(); if(dr==DialogResult.Cancel) { //Cancel return false; } if(dr==DialogResult.Yes) { //Save before exit if(mNotifySubscription.IsSavable) { mNotifySubscription.ApplyEdit(); mNotifySubscription.Save(); mbChangesMade=true; return true; } if(mNotifySubscription.IsDirty)//dirty and unsaveable due to broken rules { if(Util.PromptForBrokenRulesCancelSave()==DialogResult.Yes) { return true; } else return false; } } } return true; } return false; } #endregion #region Form ComboBoxes (Setup / Events) private void InitializeComboBoxes() { //case 1039 //log.Debug("InitializeComboBoxes"); //Load combo boxes with initial values cbPendingSpanUnit.Items.Add(AyaUnitsOfTime.Minutes,Util.LocaleText.GetLocalizedText("UI.Label.TimeSpan.Minutes")); cbPendingSpanUnit.Items.Add(AyaUnitsOfTime.Hours,Util.LocaleText.GetLocalizedText("UI.Label.TimeSpan.Hours")); cbPendingSpanUnit.Items.Add(AyaUnitsOfTime.Days,Util.LocaleText.GetLocalizedText("UI.Label.TimeSpan.Days")); //Weeks are not supported because the concept of Week is very "weak" globally :) //and is not supported by the .net datetime.Add function for this reason //cbPendingSpanUnit.Items.Add(AyaUnitsOfTime.Weeks,Util.LocaleText.GetLocalizedText("UI.Label.TimeSpan.Weeks")); cbPendingSpanUnit.Items.Add(AyaUnitsOfTime.Months,Util.LocaleText.GetLocalizedText("UI.Label.TimeSpan.Months")); cbPendingSpanUnit.Items.Add(AyaUnitsOfTime.Years,Util.LocaleText.GetLocalizedText("UI.Label.TimeSpan.Years")); if(mNotifySubscription.IsWorkorderStatusEvent) Util.FillGZComboBoxWithNameIDList("WorkorderStatus",cbWorkorderStatus,true,this.mNotifySubscription.GuidValue, false); } #endregion #region Grid events #region Selection and Editing Infragistics.Win.UIElement ElementLastClicked; /// /// This is whacky Infragistics stuff, where normally we would /// just do someting like override Row.OnDoubleClick we can't /// do that with a grid because it's rows don't have a click event /// /// To know which row is clicked on we need to always keep /// track of what element of the grid was last clicked on /// so that later on we can (in doubleclick) pre-know what was /// clicked in the first click of the double click. /// /// /// private void Grid_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { ElementLastClicked = Grid.DisplayLayout.UIElement.ElementFromPoint(new System.Drawing.Point(e.X, e.Y)); } /// /// Ok, we already know roughly what was clicked /// we just need to refine that a bit further /// /// /// private void Grid_DoubleClick(object sender, System.EventArgs e) { UltraGridRow Row = (UltraGridRow)ElementLastClicked.GetContext(typeof(UltraGridRow)); //If row==null then something else was clicked on, maybe a header or something if(Row!=null) { EditSubscriptionDeliveryMethod(/*(Guid)Row.Cells["ID"].Value,Row.Index*/); } } /// /// Handle a key down in addition to a mouse click /// this allows user to hit enter to select from the grid /// /// /// private void Grid_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { if(e.KeyCode==Keys.Enter) { UltraGridRow Row = Grid.ActiveRow; //If row==null then something else was clicked on, maybe a header or something if(Row!=null) { EditSubscriptionDeliveryMethod(/*(Guid)Row.Cells["ID"].Value,Row.Index*/); } } } /// /// Open delivery methods form so user can edit a /// delivery method /// /// /// private void EditSubscriptionDeliveryMethod(/*Guid SubscriptionID, int nRowToScrollTo*/) { //case 1039 //log.Debug("EditSubscriptionDeliveryMethod"); NotifyDeliverySettingsForm ndsf=new NotifyDeliverySettingsForm(); ndsf.ShowDialog(); PopulateGridValueLists(); // NotifySubscription ns=NotifySubscription.GetItem(SubscriptionID); // NotifySubscriptionInfoForm nsif=new NotifySubscriptionInfoForm(); // nsif.NotifySubscriptionToEdit=ns; // nsif.ShowDialog(); // Grid.BeginUpdate(); // BindGrid(false); // if(nRowToScrollTo /// Override insert row behaviour /// /// /// private void Grid_BeforeRowInsert(object sender, Infragistics.Win.UltraWinGrid.BeforeRowInsertEventArgs e) { e.Cancel=true; //Popup delivery setting chooser form which //contains list of only delivery methods *not* chosen already NotifySubscriptionDeliverySelector nsds=new NotifySubscriptionDeliverySelector(); nsds.Subscription=this.mNotifySubscription; nsds.ShowDialog(); //Was a new delivery method added potentially? if(nsds.ListChanged) PopulateGridValueLists(); if(nsds.SelectedNotifySubscriptionDeliveryID==Guid.Empty) return; //append record this.mNotifySubscription.Deliveries.Add(this.mNotifySubscription.ID,nsds.SelectedNotifySubscriptionDeliveryID ); } #endregion #region Grid Initialization /// /// Get grid ready /// private void InitializeGrid() { //case 1039 //log.Debug("InitializeGrid"); Util.GridPreLocalize("NotifySubscriptionDelivery",Grid.DisplayLayout.Bands[0]); Util.FetchGridLayout("NotifySubscriptionDeliveries","",Grid); Util.GridHideEditableBizObjectInternalFields(Grid); Grid.DisplayLayout.Bands[0].Columns["NotifySubscriptionID"].Hidden=true; Grid.DisplayLayout.Bands[0].Columns["NotifyDeliveryMethodID"].Header.Caption=Util.LocaleText.GetLocalizedText("NotifyDeliverySetting.Label.List"); Grid.DisplayLayout.Bands[0].AddButtonCaption=Util.LocaleText.GetLocalizedText("NotifySubscriptionDelivery.Label.UI.AddNew"); Grid.DisplayLayout.AddNewBox.Style=AddNewBoxStyle.Compact; PopulateGridValueLists(); } /// /// Populate the drop down lists inside the grid /// so they display and can select the correct underlying /// value /// private void PopulateGridValueLists() { //case 1039 //log.Debug("PopulateGridValueLists"); //wipe old ones Grid.DisplayLayout.ValueLists.Clear(); ValueList vl=Grid.DisplayLayout.ValueLists.Add("DeliverySettings"); NotifyDeliverySettingPickList l = NotifyDeliverySettingPickList.GetList(User.CurrentThreadUserID); if(l.Count==0) { //Warn that there is no delivery settings and ask if want to create one now if(Util.PromptYesNoFromLocaleKey("NotifySubscription.Label.WarningNoDeliveryMethod")!=DialogResult.Yes) this.Close();//User selects no then close else {//User selects yes, so open form for adding one... NotifyDeliverySettingsForm ndsf=new NotifyDeliverySettingsForm(); ndsf.ShowDialog(); if(!ndsf.ChangesMade) this.Close();//If no changes made then exit because user didn't add one //changes made so attempt this again by calling recursively PopulateGridValueLists(); //and simply return whatever the result. return; } } foreach(NotifyDeliverySettingPickList.NotifyDeliverySettingPickListInfo di in l) { vl.ValueListItems.Add(di.ID,di.Name); } //Bind value lists to correct columns in grid Grid.DisplayLayout.Bands[0].Columns["NotifyDeliveryMethodID"].ValueList=Grid.DisplayLayout.ValueLists["DeliverySettings"]; //Set column to dropdownlist style so that user can not type an invalid value in a cell //but must select from the list only Grid.DisplayLayout.Bands[0].Columns["NotifyDeliveryMethodID"].Style=Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownValidate;//Case 96 for autocomplete (was DropDownList) Grid.DisplayLayout.Bands[0].Columns["NotifyDeliveryMethodID"].AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend; } #endregion #region Accelerator keys /// /// Case 37 /// /// /// /// protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { //Short circuit: //Only process modified keystrokes (i.e. when a modifier like ctrl-alt-or shift is also //being held down if (ModifierKeys == Keys.None) return base.ProcessCmdKey(ref msg, keyData); switch (Util.HotKeys(keyData)) { //Close form case HotKeyAction.CloseForm: this.Close(); return true; } return base.ProcessCmdKey(ref msg, keyData); } #endregion } }