using System; using System.Windows.Forms; using GZTW.AyaNova.BLL; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; namespace AyaNova { /// /// Summary description for ProjectInfoForm. /// public class ProjectInfoForm : 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.UltraWinEditors.UltraTextEditor edNotes; private Infragistics.Win.UltraWinEditors.UltraCheckEditor ckActive; private System.Windows.Forms.Panel panelLeft; private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager tbManager; private System.Windows.Forms.Panel panelCustom; private Infragistics.Win.UltraWinGrid.UltraGrid gridCustom; private Infragistics.Win.UltraWinEditors.UltraTextEditor edName; private Infragistics.Win.Misc.UltraLabel lblName; private Infragistics.Win.Misc.UltraLabel lblNotes; private GZTW.WinForm.Controls.GZUltraComboEditor cbProjectOverseerID; private Infragistics.Win.Misc.UltraLabel lblDateStarted; private Infragistics.Win.Misc.UltraLabel lblDateCompleted; private Infragistics.Win.UltraWinEditors.UltraTextEditor edAccountNumber; private Infragistics.Win.Misc.UltraLabel lblAccountNumber; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _ProjectInfoForm_Toolbars_Dock_Area_Left; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _ProjectInfoForm_Toolbars_Dock_Area_Right; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _ProjectInfoForm_Toolbars_Dock_Area_Top; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _ProjectInfoForm_Toolbars_Dock_Area_Bottom; private GZTW.WinForm.Controls.GZDateTimePicker dtDateStarted; private GZTW.WinForm.Controls.GZDateTimePicker dtDateCompleted; private Infragistics.Win.Misc.UltraLabel lblProjectOverseerID; private System.Windows.Forms.HelpProvider helpProvider1; private GZTW.WinForm.Controls.GZUltraComboEditor cbRegion; private Infragistics.Win.Misc.UltraLabel lblRegionID; private System.ComponentModel.IContainer components; public ProjectInfoForm() { // // 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("ProjectEntryMenuBar"); 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:AssignedDoc.Label.List"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool15 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:O.WikiPage"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.RecordHistory"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.SaveNew"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Save"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Delete"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Close"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.SaveClose"); Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance(); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:AssignedDoc.Label.List"); Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance(); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = 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 buttonTool11 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Save"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool12 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.SaveNew"); Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance(); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool13 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Close"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool14 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Delete"); Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance(); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool16 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:O.WikiPage"); Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance(); this.ckIsDirty = new System.Windows.Forms.CheckBox(); this.panelLeft = new System.Windows.Forms.Panel(); this.cbRegion = new GZTW.WinForm.Controls.GZUltraComboEditor(); this.lblRegionID = new Infragistics.Win.Misc.UltraLabel(); this.lblProjectOverseerID = new Infragistics.Win.Misc.UltraLabel(); this.dtDateCompleted = new GZTW.WinForm.Controls.GZDateTimePicker(); this.dtDateStarted = new GZTW.WinForm.Controls.GZDateTimePicker(); this.edAccountNumber = new Infragistics.Win.UltraWinEditors.UltraTextEditor(); this.lblAccountNumber = new Infragistics.Win.Misc.UltraLabel(); this.lblDateCompleted = new Infragistics.Win.Misc.UltraLabel(); this.cbProjectOverseerID = new GZTW.WinForm.Controls.GZUltraComboEditor(); this.edName = new Infragistics.Win.UltraWinEditors.UltraTextEditor(); this.lblName = new Infragistics.Win.Misc.UltraLabel(); this.ckActive = new Infragistics.Win.UltraWinEditors.UltraCheckEditor(); this.lblDateStarted = new Infragistics.Win.Misc.UltraLabel(); this.lblNotes = new Infragistics.Win.Misc.UltraLabel(); this.edNotes = new Infragistics.Win.UltraWinEditors.UltraTextEditor(); this.ErrorProvider = new System.Windows.Forms.ErrorProvider(this.components); this.panelCustom = new System.Windows.Forms.Panel(); this.gridCustom = new Infragistics.Win.UltraWinGrid.UltraGrid(); this._ProjectInfoForm_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this.tbManager = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components); this._ProjectInfoForm_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this._ProjectInfoForm_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this._ProjectInfoForm_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this.helpProvider1 = new System.Windows.Forms.HelpProvider(); this.panelLeft.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.cbRegion)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dtDateCompleted)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dtDateStarted)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.edAccountNumber)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cbProjectOverseerID)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.edName)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ckActive)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.edNotes)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ErrorProvider)).BeginInit(); this.panelCustom.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridCustom)).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(187, 27); this.ckIsDirty.TabIndex = 5; // // panelLeft // this.panelLeft.Controls.Add(this.cbRegion); this.panelLeft.Controls.Add(this.lblRegionID); this.panelLeft.Controls.Add(this.lblProjectOverseerID); this.panelLeft.Controls.Add(this.dtDateCompleted); this.panelLeft.Controls.Add(this.dtDateStarted); this.panelLeft.Controls.Add(this.edAccountNumber); this.panelLeft.Controls.Add(this.lblAccountNumber); this.panelLeft.Controls.Add(this.lblDateCompleted); this.panelLeft.Controls.Add(this.cbProjectOverseerID); this.panelLeft.Controls.Add(this.edName); this.panelLeft.Controls.Add(this.lblName); this.panelLeft.Controls.Add(this.ckActive); this.panelLeft.Controls.Add(this.lblDateStarted); this.panelLeft.Controls.Add(this.lblNotes); this.panelLeft.Controls.Add(this.edNotes); this.panelLeft.Dock = System.Windows.Forms.DockStyle.Left; this.panelLeft.Location = new System.Drawing.Point(0, 43); this.panelLeft.Name = "panelLeft"; this.panelLeft.Size = new System.Drawing.Size(300, 483); this.panelLeft.TabIndex = 0; // // cbRegion // this.cbRegion.AllowEmptySelection = false; this.cbRegion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbRegion.Location = new System.Drawing.Point(10, 113); this.cbRegion.Name = "cbRegion"; this.cbRegion.Size = new System.Drawing.Size(276, 24); this.cbRegion.TabIndex = 141; this.cbRegion.NeedMoreData += new GZTW.WinForm.Controls.NeedMoreDataHandler(this.cbRegion_NeedMoreData); // // lblRegionID // this.lblRegionID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblRegionID.Location = new System.Drawing.Point(10, 96); this.lblRegionID.Name = "lblRegionID"; this.lblRegionID.Size = new System.Drawing.Size(276, 18); this.lblRegionID.TabIndex = 142; this.lblRegionID.Tag = ""; this.lblRegionID.Text = "LT:O.Region"; this.lblRegionID.WrapText = false; // // lblProjectOverseerID // this.lblProjectOverseerID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblProjectOverseerID.Location = new System.Drawing.Point(10, 213); this.lblProjectOverseerID.Name = "lblProjectOverseerID"; this.lblProjectOverseerID.Size = new System.Drawing.Size(276, 19); this.lblProjectOverseerID.TabIndex = 3; this.lblProjectOverseerID.Tag = ""; this.lblProjectOverseerID.Text = "LT:Project.Label.ProjectOverseerID"; // // dtDateCompleted // this.dtDateCompleted.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.dtDateCompleted.GZEnabled = true; this.dtDateCompleted.GZReadOnly = false; this.dtDateCompleted.Location = new System.Drawing.Point(10, 351); this.dtDateCompleted.Name = "dtDateCompleted"; this.dtDateCompleted.Size = new System.Drawing.Size(276, 24); this.dtDateCompleted.TabIndex = 4; // // dtDateStarted // this.dtDateStarted.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.dtDateStarted.GZEnabled = true; this.dtDateStarted.GZReadOnly = false; this.dtDateStarted.Location = new System.Drawing.Point(10, 295); this.dtDateStarted.Name = "dtDateStarted"; this.dtDateStarted.Size = new System.Drawing.Size(276, 24); this.dtDateStarted.TabIndex = 3; // // edAccountNumber // this.edAccountNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.edAccountNumber.Location = new System.Drawing.Point(10, 173); this.edAccountNumber.Name = "edAccountNumber"; this.edAccountNumber.Size = new System.Drawing.Size(276, 24); this.edAccountNumber.TabIndex = 1; // // lblAccountNumber // this.lblAccountNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblAccountNumber.Location = new System.Drawing.Point(10, 155); this.lblAccountNumber.Name = "lblAccountNumber"; this.lblAccountNumber.Size = new System.Drawing.Size(276, 18); this.lblAccountNumber.TabIndex = 131; this.lblAccountNumber.Tag = ""; this.lblAccountNumber.Text = "LT:Project.Label.AccountNumber"; // // lblDateCompleted // this.lblDateCompleted.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblDateCompleted.Location = new System.Drawing.Point(10, 332); this.lblDateCompleted.Name = "lblDateCompleted"; this.lblDateCompleted.Size = new System.Drawing.Size(276, 19); this.lblDateCompleted.TabIndex = 129; this.lblDateCompleted.Tag = ""; this.lblDateCompleted.Text = "LT:Project.Label.DateCompleted"; // // cbProjectOverseerID // this.cbProjectOverseerID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbProjectOverseerID.Location = new System.Drawing.Point(10, 232); this.cbProjectOverseerID.Name = "cbProjectOverseerID"; this.cbProjectOverseerID.Size = new System.Drawing.Size(276, 24); this.cbProjectOverseerID.TabIndex = 2; // // edName // this.edName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.edName.Location = new System.Drawing.Point(10, 60); this.edName.Name = "edName"; this.edName.Size = new System.Drawing.Size(276, 24); this.edName.TabIndex = 0; // // lblName // this.lblName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblName.Location = new System.Drawing.Point(10, 42); this.lblName.Name = "lblName"; this.lblName.Size = new System.Drawing.Size(259, 18); this.lblName.TabIndex = 92; this.lblName.Tag = ""; this.lblName.Text = "LT:Project.Label.Name"; // // ckActive // this.ckActive.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.ckActive.Checked = true; this.ckActive.CheckState = System.Windows.Forms.CheckState.Checked; this.ckActive.Location = new System.Drawing.Point(10, 9); this.ckActive.Name = "ckActive"; this.ckActive.Size = new System.Drawing.Size(259, 19); this.ckActive.TabIndex = 6; this.ckActive.Tag = ""; this.ckActive.Text = "LT:Common.Label.Active"; // // lblDateStarted // this.lblDateStarted.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblDateStarted.Location = new System.Drawing.Point(10, 277); this.lblDateStarted.Name = "lblDateStarted"; this.lblDateStarted.Size = new System.Drawing.Size(276, 18); this.lblDateStarted.TabIndex = 120; this.lblDateStarted.Tag = ""; this.lblDateStarted.Text = "LT:Project.Label.DateStarted"; // // lblNotes // this.lblNotes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblNotes.Location = new System.Drawing.Point(10, 406); this.lblNotes.Name = "lblNotes"; this.lblNotes.Size = new System.Drawing.Size(276, 19); this.lblNotes.TabIndex = 127; this.lblNotes.Tag = ""; this.lblNotes.Text = "LT:Project.Label.Notes"; // // edNotes // this.edNotes.AcceptsReturn = true; this.edNotes.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))); this.edNotes.Location = new System.Drawing.Point(10, 425); this.edNotes.Multiline = true; this.edNotes.Name = "edNotes"; this.edNotes.Size = new System.Drawing.Size(276, 43); this.edNotes.TabIndex = 5; // // ErrorProvider // this.ErrorProvider.ContainerControl = this; // // panelCustom // this.panelCustom.Controls.Add(this.gridCustom); this.panelCustom.Dock = System.Windows.Forms.DockStyle.Fill; this.panelCustom.Location = new System.Drawing.Point(300, 43); this.panelCustom.Name = "panelCustom"; this.panelCustom.Size = new System.Drawing.Size(302, 483); this.panelCustom.TabIndex = 108; // // gridCustom // this.gridCustom.Cursor = System.Windows.Forms.Cursors.Default; this.gridCustom.Dock = System.Windows.Forms.DockStyle.Fill; this.gridCustom.Location = new System.Drawing.Point(0, 0); this.gridCustom.Name = "gridCustom"; this.gridCustom.Size = new System.Drawing.Size(302, 483); this.gridCustom.TabIndex = 0; this.gridCustom.Tag = ""; this.gridCustom.Text = "LT:ObjectCustomField.Label.CustomGrid"; this.gridCustom.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(this.gridCustom_AfterCellUpdate); // // _ProjectInfoForm_Toolbars_Dock_Area_Left // this._ProjectInfoForm_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._ProjectInfoForm_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control; this._ProjectInfoForm_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left; this._ProjectInfoForm_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText; this._ProjectInfoForm_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 43); this._ProjectInfoForm_Toolbars_Dock_Area_Left.Name = "_ProjectInfoForm_Toolbars_Dock_Area_Left"; this._ProjectInfoForm_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 483); this._ProjectInfoForm_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[] { buttonTool1, buttonTool2, buttonTool15, buttonTool3, buttonTool4, buttonTool5, buttonTool6, buttonTool7}); ultraToolbar1.Text = "ProjectEntryMenuBar"; 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; buttonTool8.SharedPropsInternal.AccessibleDescription = "recorddd"; appearance1.Image = global::AyaNova.Resource1.SaveExit32; buttonTool8.SharedPropsInternal.AppearancesLarge.Appearance = appearance1; appearance2.Image = global::AyaNova.Resource1.SaveExit16; buttonTool8.SharedPropsInternal.AppearancesSmall.Appearance = appearance2; buttonTool8.SharedPropsInternal.Caption = "LT:UI.Command.SaveClose"; appearance3.Image = global::AyaNova.Resource1.Documents32; buttonTool9.SharedPropsInternal.AppearancesLarge.Appearance = appearance3; appearance4.Image = global::AyaNova.Resource1.Documents16; buttonTool9.SharedPropsInternal.AppearancesSmall.Appearance = appearance4; buttonTool9.SharedPropsInternal.Caption = "LT:AssignedDoc.Label.List"; appearance5.Image = global::AyaNova.Resource1.RecordHistory32; buttonTool10.SharedPropsInternal.AppearancesLarge.Appearance = appearance5; appearance6.Image = global::AyaNova.Resource1.RecordHistory16; buttonTool10.SharedPropsInternal.AppearancesSmall.Appearance = appearance6; buttonTool10.SharedPropsInternal.Caption = "LT:UI.Command.RecordHistory"; buttonTool11.SharedPropsInternal.Caption = "LT:UI.Command.Save"; buttonTool11.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.TextOnlyAlways; appearance7.Image = global::AyaNova.Resource1.SaveNew32; buttonTool12.SharedPropsInternal.AppearancesLarge.Appearance = appearance7; appearance8.Image = global::AyaNova.Resource1.SaveNew16; buttonTool12.SharedPropsInternal.AppearancesSmall.Appearance = appearance8; buttonTool12.SharedPropsInternal.Caption = "LT:UI.Command.SaveNew"; buttonTool13.SharedPropsInternal.Caption = "LT:UI.Command.Close"; buttonTool13.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.TextOnlyAlways; appearance9.Image = global::AyaNova.Resource1.Delete32; buttonTool14.SharedPropsInternal.AppearancesLarge.Appearance = appearance9; appearance10.Image = global::AyaNova.Resource1.Delete16; buttonTool14.SharedPropsInternal.AppearancesSmall.Appearance = appearance10; buttonTool14.SharedPropsInternal.Caption = "LT:UI.Command.Delete"; appearance11.Image = global::AyaNova.Resource1.Wiki32; buttonTool16.SharedPropsInternal.AppearancesLarge.Appearance = appearance11; appearance12.Image = global::AyaNova.Resource1.Wiki16; buttonTool16.SharedPropsInternal.AppearancesSmall.Appearance = appearance12; buttonTool16.SharedPropsInternal.Caption = "LT:O.WikiPage"; this.tbManager.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] { buttonTool8, buttonTool9, buttonTool10, buttonTool11, buttonTool12, buttonTool13, buttonTool14, buttonTool16}); this.tbManager.UseLargeImagesOnToolbar = true; this.tbManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.tbManager_ToolClick); // // _ProjectInfoForm_Toolbars_Dock_Area_Right // this._ProjectInfoForm_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._ProjectInfoForm_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control; this._ProjectInfoForm_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right; this._ProjectInfoForm_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText; this._ProjectInfoForm_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(602, 43); this._ProjectInfoForm_Toolbars_Dock_Area_Right.Name = "_ProjectInfoForm_Toolbars_Dock_Area_Right"; this._ProjectInfoForm_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 483); this._ProjectInfoForm_Toolbars_Dock_Area_Right.ToolbarsManager = this.tbManager; // // _ProjectInfoForm_Toolbars_Dock_Area_Top // this._ProjectInfoForm_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._ProjectInfoForm_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control; this._ProjectInfoForm_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top; this._ProjectInfoForm_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText; this._ProjectInfoForm_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0); this._ProjectInfoForm_Toolbars_Dock_Area_Top.Name = "_ProjectInfoForm_Toolbars_Dock_Area_Top"; this._ProjectInfoForm_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(602, 43); this._ProjectInfoForm_Toolbars_Dock_Area_Top.ToolbarsManager = this.tbManager; // // _ProjectInfoForm_Toolbars_Dock_Area_Bottom // this._ProjectInfoForm_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping; this._ProjectInfoForm_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control; this._ProjectInfoForm_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom; this._ProjectInfoForm_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText; this._ProjectInfoForm_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 526); this._ProjectInfoForm_Toolbars_Dock_Area_Bottom.Name = "_ProjectInfoForm_Toolbars_Dock_Area_Bottom"; this._ProjectInfoForm_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(602, 0); this._ProjectInfoForm_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.tbManager; // // ProjectInfoForm // this.AllowDrop = true; this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); this.ClientSize = new System.Drawing.Size(602, 526); this.Controls.Add(this.panelCustom); this.Controls.Add(this.panelLeft); this.Controls.Add(this.ckIsDirty); this.Controls.Add(this._ProjectInfoForm_Toolbars_Dock_Area_Left); this.Controls.Add(this._ProjectInfoForm_Toolbars_Dock_Area_Right); this.Controls.Add(this._ProjectInfoForm_Toolbars_Dock_Area_Bottom); this.Controls.Add(this._ProjectInfoForm_Toolbars_Dock_Area_Top); this.helpProvider1.SetHelpKeyword(this, ""); this.helpProvider1.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic); this.MinimumSize = new System.Drawing.Size(614, 563); this.Name = "ProjectInfoForm"; this.helpProvider1.SetShowHelp(this, true); this.ShowInTaskbar = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; this.Closing += new System.ComponentModel.CancelEventHandler(this.ProjectInfoForm_Closing); this.Load += new System.EventHandler(this.ProjectInfoForm_Load); this.SizeChanged += new System.EventHandler(this.ProjectInfoForm_SizeChanged); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form_DragEnter); this.panelLeft.ResumeLayout(false); this.panelLeft.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.cbRegion)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dtDateCompleted)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dtDateStarted)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.edAccountNumber)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cbProjectOverseerID)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.edName)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ckActive)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.edNotes)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ErrorProvider)).EndInit(); this.panelCustom.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridCustom)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbManager)).EndInit(); this.ResumeLayout(false); } #endregion // __ _ _ ___ ____ __ __ __ __ __ ___ ___ // / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _) // ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _) // \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___) // #region Form Load / Close //variable to hold user form settings //UIUserFormSetting mFormSetting; /// /// Prepare the form /// /// /// private void ProjectInfoForm_Load(object sender, System.EventArgs e) { // // helpProvider1 // this.helpProvider1.HelpNamespace = Util.BaseHelpUrl + "projects.htm"; //case 1039 //log.Debug("ProjectInfoForm_Load"); Cursor.Current = Cursors.WaitCursor; this.Visible=false; this.Icon = Resource1.Project16icon; //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 Project edit screen from elsewhere in the program) if(AyaBizUtils.Right("Object.Project")< (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.Project"))); this.Close(); return; } InitializeComboBoxes(); DataBind(); Util.LoadFormCustomization("ProjectInfo", this, tbManager, false); Util.PluginInsertMenu(tbManager, new Util.PluginMenuOptionData(true, RootObjectTypes.Project, mProject, null));//case 941 Util.LocalizeHelperInsertMenu(tbManager, this); //case 1810 Util.Localize(this); //restrict UI based on security settings RestrictUI(); Cursor.Current = Cursors.Default; //Case 152 (new TabOrderManager(this)).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst); 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 ProjectInfoForm_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //case 1039 //log.Debug("ProjectInfoForm_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("ProjectInfo", this, tbManager, false); } #endregion #region Form Sizing /// /// Adjust the layout proportionately as it's sized by user /// /// /// private void ProjectInfoForm_SizeChanged(object sender, System.EventArgs e) { //case 1039 //log.Debug("ProjectInfoForm_SizeChanged"); int nWidth=0; int nHeight=(this.DisplayRectangle.Height/3)*2; if(bShowCustomFields) //there are two panels nWidth=this.DisplayRectangle.Width/2; else//there is one panel nWidth=this.DisplayRectangle.Width/1; this.panelLeft.Width=nWidth; if(bShowCustomFields) this.panelCustom.Width=nWidth; this.panelLeft.Height=nHeight; this.panelCustom.Height=nHeight; } #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:AssignedDoc.Label.List": // ButtonTool DocsForm d=new DocsForm(); d.DocsToEdit=mProject.Docs; d.RootObjectID=mProject.ID; d.ExactObjectType = d.RootObjectType = RootObjectTypes.Project; d.ShowDialog(); break; case "LT:UI.Command.RecordHistory": // ButtonTool RecordHistoryForm RH=new RecordHistoryForm(mProject.Creator,mProject.Modifier,mProject.Created,mProject.Modified); RH.ShowDialog(); RH.Dispose(); break; case "LT:UI.Command.Save": // ButtonTool RecordUpdate(RecordActionType.SaveOnly); break; case "LT:UI.Command.SaveNew": // ButtonTool RecordUpdate(RecordActionType.SaveAndNew); break; case "LT:UI.Command.Close": // ButtonTool this.Close(); break; case "LT:UI.Command.Delete": // ButtonTool RecordUpdate(RecordActionType.DeleteAndExit); break; case "LT:O.WikiPage": { Util.OpenWikiPage(RootObjectTypes.Project, mProject.ID, false); break; } } } #endregion Toolbar menu items #endregion #region Form UI / Business object synchronization private int mLastDocsCount=-1; /// /// Synchronize the state of the UI to the BO's /// private void SyncUI() { //display Project name in title bar this.Text=mProject.Name; //Indicate if any docs in icon //case 918 if (this.mLastDocsCount != mProject.Docs.Count) { this.mLastDocsCount = mProject.Docs.Count; Util.AssignedDocsSetImage(tbManager, (mLastDocsCount > 0)); } } /// /// When the application enters an idle state /// update the UI to reflect changes 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.Project")).ToString()); bool bDelete=AyaBizUtils.Right("Object.Project")== (int)SecurityLevelTypes.ReadWriteDelete; bool bReadOnly=AyaBizUtils.Right("Object.Project") < (int)SecurityLevelTypes.ReadWrite; tbManager.Tools["LT:UI.Command.Delete"].SharedProps.Visible=bDelete; if(bDelete) { gridCustom.DisplayLayout.Override.AllowDelete=DefaultableBoolean.True; } else { gridCustom.DisplayLayout.Override.AllowDelete=DefaultableBoolean.False; } //Grids if(bReadOnly) { gridCustom.DisplayLayout.Override.AllowAddNew=AllowAddNew.No; gridCustom.DisplayLayout.Override.AllowUpdate=DefaultableBoolean.False; } else { gridCustom.DisplayLayout.Override.AllowAddNew=AllowAddNew.TemplateOnBottom; gridCustom.DisplayLayout.Override.AllowUpdate=DefaultableBoolean.True; } tbManager.Tools["LT:UI.Command.SaveClose"].SharedProps.Visible=!bReadOnly; tbManager.Tools["LT:UI.Command.SaveNew"].SharedProps.Visible=!bReadOnly; tbManager.Tools["LT:UI.Command.Save"].SharedProps.Visible=!bReadOnly; //Case 181 tbManager.Tools["LT:UI.Command.Close"].SharedProps.Visible=false; //case 73 tbManager.Tools["LT:O.WikiPage"].SharedProps.Visible = mProject.CanWiki; //case 1172 tbManager.Tools["LT:AssignedDoc.Label.List"].SharedProps.Visible = !AyaBizUtils.Lite; //DISABLE EDITABLE CONTROLS //Text editors edName.Enabled=!bReadOnly; edNotes.Enabled=!bReadOnly; this.edAccountNumber.Enabled=!bReadOnly; //Combo boxes cbProjectOverseerID.Enabled=!bReadOnly; //Check boxes ckActive.Enabled=!bReadOnly; //Date dtDateStarted.Enabled=!bReadOnly; dtDateCompleted.Enabled=!bReadOnly; } #endregion #region Form DataBinding and BrokenRules handling bool bShowCustomFields=false; /// /// Bind controls to business objects /// private void DataBind() { //case 1039 //log.Debug("DataBind"); //Custom fields are not databound, but must be initiated manually... FillCustomFieldGrid(); //Subscribe to broken rules changed event OnBrokenRulesChanged mProject.GetBrokenRulesCollection().ListChanged += new System.ComponentModel.ListChangedEventHandler(OnBrokenRulesChanged); //=-=-=-=-=-=- Form Field bindings =-=-=-=-=-=-=-=-=-=-=-= //Text editors Util.BindField(edName,"Text",mProject,"Name"); Util.BindField(edNotes,"Text",mProject,"Notes"); //Added:02-Aug-2006 //apparently no one ever used this field before //I found it myself, no bug reports at all //maybe we shouldn't have bothered... :) Util.BindField(this.edAccountNumber, "Text", mProject, "AccountNumber"); //Combo boxes Util.BindField(cbProjectOverseerID,"Value",mProject,"ProjectOverseerID"); Util.BindField(cbRegion, "Value", mProject, "RegionID");//case 58 //Check boxes Util.BindField(ckActive,"Checked",mProject,"Active"); //Date Util.BindField(dtDateStarted, "Value", mProject, "DateStarted"); Util.BindField(dtDateCompleted, "Value", mProject, "DateCompleted"); //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //Bind IsDirty property to hidden checkbox to //ensure isdirtychanged event is available //to data binding infrastructure Util.BindField(ckIsDirty,"Checked",mProject,"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,mProject,ErrorProvider); } #endregion #region Business object editing / adding / deletion related code private Project mProject; /// /// Project record to display /// set by caller /// public Project ProjectToEdit { get { return mProject; } set { mProject=value; //mProject.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 lblNotes.Focus(); switch(SaveType) { case RecordActionType.DeleteAndExit: if(Util.PromptForDelete()==DialogResult.Yes) { try { //Delete, then exit Project.DeleteItem(mProject.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(mProject.IsSavable) { mProject.ApplyEdit(); mProject.Save(); bClosingHandled=true; mbChangesMade=true; this.Close(); return true; } if(mProject.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.SaveAndNew: if(mProject.IsSavable) { mProject.ApplyEdit(); mProject.Save(); AddNewProject(); mbChangesMade=true; return true; } if(mProject.IsDirty)//dirty and unsaveable due to broken rules { //User says that's ok, continue on? if(Util.PromptForBrokenRulesCancelSave()==DialogResult.Yes) { //Ok, add new Project and don't save old record AddNewProject(); return true; } else return false; } //Current record isn't dirty so just add a new Project AddNewProject(); return true; case RecordActionType.SaveOnly: if(mProject.IsSavable) { mProject.ApplyEdit(); mProject=(Project)mProject.Save(); DataBind(); mbChangesMade=true; return true; } return true; case RecordActionType.PromptToSave: //Prompt to save and save if //required if(mProject.IsDirty) { DialogResult dr=Util.PromptForSave(); if(dr==DialogResult.Cancel) { //Cancel return false; } if(dr==DialogResult.Yes) { //Save before exit if(mProject.IsSavable) { mProject.ApplyEdit(); mProject.Save(); mbChangesMade=true; return true; } if(mProject.IsDirty)//dirty and unsaveable due to broken rules { if(Util.PromptForBrokenRulesCancelSave()==DialogResult.Yes) { return true; } else return false; } } } return true; } return false; } /// /// ///Creates a new Project record and opens it for editing /// private void AddNewProject() { //case 1039 //log.Debug("AddNewProject"); try { mProject=Project.NewItem(); //mProject.BeginEdit(); DataBind(); } catch(Exception ex) { //log.Error("AddNewProject",ex); MessageBox.Show(ex.Message+"\r\n"+ex.Source); } } #endregion #region Form ComboBoxes (Setup / Events) private void InitializeComboBoxes() { //case 1039 //log.Debug("InitializeComboBoxes"); Util.FillGZComboBoxWithNameIDList("Region", cbRegion, true, mProject.RegionID, true); UserPickList UList= UserPickList.GetList(true); foreach(UserPickList.UserPickListInfo ui in UList) { if(ui.Active) cbProjectOverseerID.Items.Add(ui.ID,ui.Name); else if(ui.ID==this.mProject.ProjectOverseerID) { ValueListItem vi=cbProjectOverseerID.Items.Add(ui.ID,ui.Name); vi.Appearance.ForeColor=System.Drawing.SystemColors.GrayText; } } } private void cbRegion_NeedMoreData() { Util.FillGZComboBoxWithNameIDList("Region", cbRegion, false, Guid.Empty, true); } #endregion #region Custom fields /// /// put custom field data into custom grid and show it if applicable /// private void FillCustomFieldGrid() { //case 1039 //log.Debug("FillCustomFieldGrid"); bShowCustomFields=Util.PrepareCustomFieldsGrid("Project",gridCustom); if(bShowCustomFields) { this.panelCustom.Visible=true; Util.GridFromCustomFields(mProject,gridCustom); } else { this.panelCustom.Visible=false; } } private void gridCustom_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { Util.GridToCustomFields(mProject,gridCustom); } #endregion #region Drag and drop docs private void Form_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) { Util.DragEnter(e); } private void Form_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { Util.DragDrop(e, mProject.Docs, RootObjectTypes.Project, mProject.ID, RootObjectTypes.Project); } #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 } }