1102 lines
49 KiB
C#
1102 lines
49 KiB
C#
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>
|
|
/// Summary description for ClientServiceRequestInfoForm.
|
|
/// </summary>
|
|
public class ClientServiceRequestInfoForm : 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 edDetails;
|
|
private System.Windows.Forms.Panel panelLeft;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager tbManager;
|
|
private Infragistics.Win.UltraWinEditors.UltraTextEditor edTitle;
|
|
private Infragistics.Win.Misc.UltraLabel lblTitle;
|
|
private Infragistics.Win.Misc.UltraLabel lblNotes;
|
|
private GZTW.WinForm.Controls.GZUltraComboEditor cbUnitID;
|
|
private Infragistics.Win.UltraWinEditors.UltraTextEditor edRef;
|
|
private Infragistics.Win.Misc.UltraLabel lblRef;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom;
|
|
private Infragistics.Win.Misc.UltraLabel lblUnit;
|
|
private System.Windows.Forms.HelpProvider helpProvider1;
|
|
private Infragistics.Win.Misc.UltraLabel lblHeader;
|
|
private Infragistics.Win.Misc.UltraLabel lblPriority;
|
|
private Infragistics.Win.UltraWinEditors.UltraTextEditor edRequestedBy;
|
|
private Infragistics.Win.Misc.UltraLabel ultraLabel1;
|
|
private System.ComponentModel.IContainer components;
|
|
|
|
|
|
public ClientServiceRequestInfoForm()
|
|
{
|
|
//
|
|
// 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.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("ClientServiceRequestEntryMenuBar");
|
|
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.SaveNew");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Save");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Delete");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Close");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:ClientServiceRequest.Label.AcceptToNew");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:ClientServiceRequest.Label.AcceptToExisting");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:ClientServiceRequest.Label.Reject");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = 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 buttonTool11 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.RecordHistory");
|
|
Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool12 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Save");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool13 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.SaveNew");
|
|
Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool14 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Close");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool15 = 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.UltraWinToolbars.ButtonTool buttonTool16 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:ClientServiceRequest.Label.AcceptToNew");
|
|
Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool17 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:ClientServiceRequest.Label.AcceptToExisting");
|
|
Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool18 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:ClientServiceRequest.Label.Reject");
|
|
Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance14 = new Infragistics.Win.Appearance();
|
|
this.ckIsDirty = new System.Windows.Forms.CheckBox();
|
|
this.tbManager = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
|
|
this.panelLeft = new System.Windows.Forms.Panel();
|
|
this.edRequestedBy = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
|
this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
|
|
this.lblPriority = new Infragistics.Win.Misc.UltraLabel();
|
|
this.lblHeader = new Infragistics.Win.Misc.UltraLabel();
|
|
this.lblUnit = new Infragistics.Win.Misc.UltraLabel();
|
|
this.edRef = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
|
this.lblRef = new Infragistics.Win.Misc.UltraLabel();
|
|
this.cbUnitID = new GZTW.WinForm.Controls.GZUltraComboEditor();
|
|
this.edTitle = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
|
this.lblTitle = new Infragistics.Win.Misc.UltraLabel();
|
|
this.lblNotes = new Infragistics.Win.Misc.UltraLabel();
|
|
this.edDetails = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
|
this.ErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
|
this.helpProvider1 = new System.Windows.Forms.HelpProvider();
|
|
((System.ComponentModel.ISupportInitialize)(this.tbManager)).BeginInit();
|
|
this.panelLeft.SuspendLayout();
|
|
((System.ComponentModel.ISupportInitialize)(this.edRequestedBy)).BeginInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edRef)).BeginInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.cbUnitID)).BeginInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edTitle)).BeginInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edDetails)).BeginInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.ErrorProvider)).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;
|
|
//
|
|
// 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,
|
|
buttonTool6,
|
|
buttonTool7,
|
|
buttonTool8,
|
|
buttonTool9});
|
|
ultraToolbar1.Text = "ClientServiceRequestEntryMenuBar";
|
|
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;
|
|
buttonTool10.SharedPropsInternal.AccessibleDescription = "recorddd";
|
|
appearance1.Image = global::AyaNova.Resource1.SaveExit32;
|
|
buttonTool10.SharedPropsInternal.AppearancesLarge.Appearance = appearance1;
|
|
appearance2.Image = global::AyaNova.Resource1.SaveExit16;
|
|
buttonTool10.SharedPropsInternal.AppearancesSmall.Appearance = appearance2;
|
|
buttonTool10.SharedPropsInternal.Caption = "LT:UI.Command.SaveClose";
|
|
appearance3.Image = global::AyaNova.Resource1.RecordHistory32;
|
|
buttonTool11.SharedPropsInternal.AppearancesLarge.Appearance = appearance3;
|
|
appearance4.Image = global::AyaNova.Resource1.RecordHistory16;
|
|
buttonTool11.SharedPropsInternal.AppearancesSmall.Appearance = appearance4;
|
|
buttonTool11.SharedPropsInternal.Caption = "LT:UI.Command.RecordHistory";
|
|
buttonTool12.SharedPropsInternal.Caption = "LT:UI.Command.Save";
|
|
buttonTool12.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.TextOnlyAlways;
|
|
appearance5.Image = global::AyaNova.Resource1.SaveNew32;
|
|
buttonTool13.SharedPropsInternal.AppearancesLarge.Appearance = appearance5;
|
|
appearance6.Image = global::AyaNova.Resource1.SaveNew16;
|
|
buttonTool13.SharedPropsInternal.AppearancesSmall.Appearance = appearance6;
|
|
buttonTool13.SharedPropsInternal.Caption = "LT:UI.Command.SaveNew";
|
|
buttonTool14.SharedPropsInternal.Caption = "LT:UI.Command.Close";
|
|
buttonTool14.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.TextOnlyAlways;
|
|
appearance7.Image = global::AyaNova.Resource1.Delete32;
|
|
buttonTool15.SharedPropsInternal.AppearancesLarge.Appearance = appearance7;
|
|
appearance8.Image = global::AyaNova.Resource1.Delete16;
|
|
buttonTool15.SharedPropsInternal.AppearancesSmall.Appearance = appearance8;
|
|
buttonTool15.SharedPropsInternal.Caption = "LT:UI.Command.Delete";
|
|
appearance9.Image = global::AyaNova.Resource1.CSRAccceptedToNewWO32;
|
|
buttonTool16.SharedPropsInternal.AppearancesLarge.Appearance = appearance9;
|
|
appearance10.Image = global::AyaNova.Resource1.CSRAccceptedToNewWO16;
|
|
buttonTool16.SharedPropsInternal.AppearancesSmall.Appearance = appearance10;
|
|
buttonTool16.SharedPropsInternal.Caption = "LT:ClientServiceRequest.Label.AcceptToNew";
|
|
appearance11.Image = global::AyaNova.Resource1.CSRAcceptedToExistingWO32;
|
|
buttonTool17.SharedPropsInternal.AppearancesLarge.Appearance = appearance11;
|
|
appearance12.Image = global::AyaNova.Resource1.CSRAcceptedToExistingWO16;
|
|
buttonTool17.SharedPropsInternal.AppearancesSmall.Appearance = appearance12;
|
|
buttonTool17.SharedPropsInternal.Caption = "LT:ClientServiceRequest.Label.AcceptToExisting";
|
|
appearance13.Image = global::AyaNova.Resource1.CSRrejected32;
|
|
buttonTool18.SharedPropsInternal.AppearancesLarge.Appearance = appearance13;
|
|
appearance14.Image = global::AyaNova.Resource1.CSRrejected16;
|
|
buttonTool18.SharedPropsInternal.AppearancesSmall.Appearance = appearance14;
|
|
buttonTool18.SharedPropsInternal.Caption = "LT:ClientServiceRequest.Label.Reject";
|
|
this.tbManager.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
|
|
buttonTool10,
|
|
buttonTool11,
|
|
buttonTool12,
|
|
buttonTool13,
|
|
buttonTool14,
|
|
buttonTool15,
|
|
buttonTool16,
|
|
buttonTool17,
|
|
buttonTool18});
|
|
this.tbManager.UseLargeImagesOnToolbar = true;
|
|
this.tbManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.tbManager_ToolClick);
|
|
//
|
|
// panelLeft
|
|
//
|
|
this.panelLeft.Controls.Add(this.edRequestedBy);
|
|
this.panelLeft.Controls.Add(this.ultraLabel1);
|
|
this.panelLeft.Controls.Add(this.lblPriority);
|
|
this.panelLeft.Controls.Add(this.lblHeader);
|
|
this.panelLeft.Controls.Add(this.lblUnit);
|
|
this.panelLeft.Controls.Add(this.edRef);
|
|
this.panelLeft.Controls.Add(this.lblRef);
|
|
this.panelLeft.Controls.Add(this.cbUnitID);
|
|
this.panelLeft.Controls.Add(this.edTitle);
|
|
this.panelLeft.Controls.Add(this.lblTitle);
|
|
this.panelLeft.Controls.Add(this.lblNotes);
|
|
this.panelLeft.Controls.Add(this.edDetails);
|
|
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(632, 554);
|
|
this.panelLeft.TabIndex = 0;
|
|
//
|
|
// edRequestedBy
|
|
//
|
|
this.edRequestedBy.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.edRequestedBy.Location = new System.Drawing.Point(14, 261);
|
|
this.edRequestedBy.Name = "edRequestedBy";
|
|
this.edRequestedBy.ReadOnly = true;
|
|
this.edRequestedBy.Size = new System.Drawing.Size(592, 24);
|
|
this.edRequestedBy.TabIndex = 134;
|
|
//
|
|
// 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(14, 242);
|
|
this.ultraLabel1.Name = "ultraLabel1";
|
|
this.ultraLabel1.Size = new System.Drawing.Size(592, 19);
|
|
this.ultraLabel1.TabIndex = 135;
|
|
this.ultraLabel1.Tag = "";
|
|
this.ultraLabel1.Text = "LT:ClientServiceRequest.Label.RequestedBy";
|
|
//
|
|
// lblPriority
|
|
//
|
|
this.lblPriority.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.lblPriority.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
this.lblPriority.Location = new System.Drawing.Point(14, 7);
|
|
this.lblPriority.Name = "lblPriority";
|
|
this.lblPriority.Size = new System.Drawing.Size(592, 51);
|
|
this.lblPriority.TabIndex = 133;
|
|
this.lblPriority.Tag = "";
|
|
this.lblPriority.Text = "LT:ClientServiceRequest.Label.Title";
|
|
//
|
|
// lblHeader
|
|
//
|
|
this.lblHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.lblHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
this.lblHeader.Location = new System.Drawing.Point(14, 65);
|
|
this.lblHeader.Name = "lblHeader";
|
|
this.lblHeader.Size = new System.Drawing.Size(592, 57);
|
|
this.lblHeader.TabIndex = 132;
|
|
this.lblHeader.Tag = "";
|
|
//
|
|
// lblUnit
|
|
//
|
|
this.lblUnit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.lblUnit.Location = new System.Drawing.Point(14, 298);
|
|
this.lblUnit.Name = "lblUnit";
|
|
this.lblUnit.Size = new System.Drawing.Size(592, 18);
|
|
this.lblUnit.TabIndex = 3;
|
|
this.lblUnit.Tag = "";
|
|
this.lblUnit.Text = "LT:Unit.Label.Serial";
|
|
//
|
|
// edRef
|
|
//
|
|
this.edRef.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.edRef.Location = new System.Drawing.Point(14, 203);
|
|
this.edRef.Name = "edRef";
|
|
this.edRef.ReadOnly = true;
|
|
this.edRef.Size = new System.Drawing.Size(592, 24);
|
|
this.edRef.TabIndex = 1;
|
|
//
|
|
// lblRef
|
|
//
|
|
this.lblRef.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.lblRef.Location = new System.Drawing.Point(14, 185);
|
|
this.lblRef.Name = "lblRef";
|
|
this.lblRef.Size = new System.Drawing.Size(592, 18);
|
|
this.lblRef.TabIndex = 131;
|
|
this.lblRef.Tag = "";
|
|
this.lblRef.Text = "LT:ClientServiceRequest.Label.CustomerReferenceNumber";
|
|
//
|
|
// cbUnitID
|
|
//
|
|
this.cbUnitID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.cbUnitID.Location = new System.Drawing.Point(14, 323);
|
|
this.cbUnitID.Name = "cbUnitID";
|
|
this.cbUnitID.ReadOnly = true;
|
|
this.cbUnitID.Size = new System.Drawing.Size(592, 24);
|
|
this.cbUnitID.TabIndex = 2;
|
|
//
|
|
// edTitle
|
|
//
|
|
this.edTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.edTitle.Location = new System.Drawing.Point(14, 148);
|
|
this.edTitle.Name = "edTitle";
|
|
this.edTitle.ReadOnly = true;
|
|
this.edTitle.Size = new System.Drawing.Size(592, 24);
|
|
this.edTitle.TabIndex = 0;
|
|
//
|
|
// lblTitle
|
|
//
|
|
this.lblTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
|
| System.Windows.Forms.AnchorStyles.Right)));
|
|
this.lblTitle.Location = new System.Drawing.Point(14, 129);
|
|
this.lblTitle.Name = "lblTitle";
|
|
this.lblTitle.Size = new System.Drawing.Size(592, 19);
|
|
this.lblTitle.TabIndex = 92;
|
|
this.lblTitle.Tag = "";
|
|
this.lblTitle.Text = "LT:ClientServiceRequest.Label.Title";
|
|
//
|
|
// 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(14, 354);
|
|
this.lblNotes.Name = "lblNotes";
|
|
this.lblNotes.Size = new System.Drawing.Size(592, 19);
|
|
this.lblNotes.TabIndex = 127;
|
|
this.lblNotes.Tag = "";
|
|
this.lblNotes.Text = "LT:ClientServiceRequest.Label.Details";
|
|
//
|
|
// edDetails
|
|
//
|
|
this.edDetails.AcceptsReturn = true;
|
|
this.edDetails.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.edDetails.Location = new System.Drawing.Point(14, 380);
|
|
this.edDetails.Multiline = true;
|
|
this.edDetails.Name = "edDetails";
|
|
this.edDetails.ReadOnly = true;
|
|
this.edDetails.Size = new System.Drawing.Size(592, 149);
|
|
this.edDetails.TabIndex = 5;
|
|
//
|
|
// ErrorProvider
|
|
//
|
|
this.ErrorProvider.ContainerControl = this;
|
|
//
|
|
// _ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left
|
|
//
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 43);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left.Name = "_ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left";
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 554);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left.ToolbarsManager = this.tbManager;
|
|
//
|
|
// _ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right
|
|
//
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(632, 43);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right.Name = "_ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right";
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 554);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right.ToolbarsManager = this.tbManager;
|
|
//
|
|
// _ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top
|
|
//
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top.Name = "_ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top";
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(632, 43);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Top.ToolbarsManager = this.tbManager;
|
|
//
|
|
// _ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom
|
|
//
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 597);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom.Name = "_ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom";
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(632, 0);
|
|
this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.tbManager;
|
|
//
|
|
// ClientServiceRequestInfoForm
|
|
//
|
|
this.AllowDrop = true;
|
|
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
|
this.ClientSize = new System.Drawing.Size(632, 597);
|
|
this.Controls.Add(this.panelLeft);
|
|
this.Controls.Add(this.ckIsDirty);
|
|
this.Controls.Add(this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Left);
|
|
this.Controls.Add(this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Right);
|
|
this.Controls.Add(this._ClientServiceRequestInfoForm_Toolbars_Dock_Area_Bottom);
|
|
this.Controls.Add(this._ClientServiceRequestInfoForm_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 = "ClientServiceRequestInfoForm";
|
|
this.helpProvider1.SetShowHelp(this, true);
|
|
this.ShowInTaskbar = false;
|
|
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
|
|
this.Closing += new System.ComponentModel.CancelEventHandler(this.ClientServiceRequestInfoForm_Closing);
|
|
this.Load += new System.EventHandler(this.ClientServiceRequestInfoForm_Load);
|
|
this.SizeChanged += new System.EventHandler(this.ClientServiceRequestInfoForm_SizeChanged);
|
|
((System.ComponentModel.ISupportInitialize)(this.tbManager)).EndInit();
|
|
this.panelLeft.ResumeLayout(false);
|
|
this.panelLeft.PerformLayout();
|
|
((System.ComponentModel.ISupportInitialize)(this.edRequestedBy)).EndInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edRef)).EndInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.cbUnitID)).EndInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edTitle)).EndInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edDetails)).EndInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.ErrorProvider)).EndInit();
|
|
this.ResumeLayout(false);
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
|
|
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
|
|
// ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
|
|
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
|
|
//
|
|
|
|
#region Form Load / Close
|
|
|
|
|
|
/// <summary>
|
|
/// Prepare the form
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void ClientServiceRequestInfoForm_Load(object sender, System.EventArgs e)
|
|
{
|
|
//case 1039 //log.Debug("ClientServiceRequestInfoForm_Load");
|
|
//
|
|
// helpProvider1
|
|
//
|
|
this.helpProvider1.HelpNamespace = Util.BaseHelpUrl + "Viewing_a_Customer_Service_Req.htm";
|
|
Cursor.Current = Cursors.WaitCursor;
|
|
this.Visible=false;
|
|
this.Icon = Resource1.CSR16icon;
|
|
|
|
//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 ClientServiceRequest edit screen from elsewhere in the program)
|
|
if(AyaBizUtils.Right("Object.ClientServiceRequest")< (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.ClientServiceRequest")));
|
|
|
|
this.Close();
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InitializeComboBoxes();
|
|
DataBind();
|
|
|
|
Util.LoadFormCustomization("ClientServiceRequestInfo", this, tbManager, false);
|
|
|
|
|
|
//case 941
|
|
Util.PluginInsertMenu(tbManager, new Util.PluginMenuOptionData(true, RootObjectTypes.ClientServiceRequest, mClientServiceRequest, null));
|
|
|
|
// InitializeGrid();
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Used to track whether the close was done by the program
|
|
/// or done by the user clicking on the upper left corner X control
|
|
/// </summary>
|
|
bool bClosingHandled=false;
|
|
/// <summary>
|
|
/// Save form layout and grid layout for next time
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void ClientServiceRequestInfoForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
//case 1039 //log.Debug("ClientServiceRequestInfoForm_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("ClientServiceRequestInfo", this, tbManager, false);
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Form Sizing
|
|
/// <summary>
|
|
/// Adjust the layout proportionately as it's sized by user
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void ClientServiceRequestInfoForm_SizeChanged(object sender, System.EventArgs e)
|
|
{
|
|
//case 1039 //log.Debug("ClientServiceRequestInfoForm_SizeChanged");
|
|
|
|
int nWidth=0;
|
|
int nHeight=(this.DisplayRectangle.Height/3)*2;
|
|
nWidth=this.DisplayRectangle.Width/2;
|
|
this.panelLeft.Width=nWidth;
|
|
this.panelLeft.Height=nHeight;
|
|
|
|
|
|
}
|
|
|
|
#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:UI.Command.SaveClose": // ButtonTool
|
|
RecordUpdate(RecordActionType.SaveAndExit);
|
|
break;
|
|
|
|
|
|
|
|
case "LT:UI.Command.RecordHistory": // ButtonTool
|
|
RecordHistoryForm RH=new RecordHistoryForm(mClientServiceRequest.Creator,mClientServiceRequest.Modifier,mClientServiceRequest.Created,mClientServiceRequest.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:ClientServiceRequest.Label.AcceptToNew": // ButtonTool
|
|
{
|
|
//Generate workorder
|
|
Workorder w = ClientServiceRequestToEdit.AcceptToNewWorkorder();
|
|
//open wo for editing
|
|
WorkorderForm f = new WorkorderForm();
|
|
f.WorkorderToEdit = w;
|
|
f.ShowDialog();
|
|
f.Dispose();
|
|
bClosingHandled = true;
|
|
this.Close();
|
|
|
|
|
|
}
|
|
break;
|
|
|
|
case "LT:ClientServiceRequest.Label.AcceptToExisting": // ButtonTool
|
|
{
|
|
|
|
WorkorderSelector ws = new WorkorderSelector();
|
|
ws.ClientID = ClientServiceRequestToEdit.ClientID;
|
|
ws.DoNotShowWorkorderID = Guid.Empty;
|
|
|
|
DialogResult result = ws.ShowDialog();
|
|
if (result == DialogResult.Cancel) return;
|
|
if (ws.SelectedWorkorderID == Guid.Empty) return;
|
|
|
|
//Generate workorder
|
|
Workorder w = ClientServiceRequestToEdit.AcceptToWorkorder(ws.SelectedWorkorderID);
|
|
ws.Dispose();
|
|
|
|
//open wo for editing
|
|
WorkorderForm f = new WorkorderForm();
|
|
f.WorkorderToEdit = w;
|
|
f.ShowDialog();
|
|
f.Dispose();
|
|
bClosingHandled = true;
|
|
this.Close();
|
|
|
|
|
|
|
|
}
|
|
break;
|
|
|
|
case "LT:ClientServiceRequest.Label.Reject": // ButtonTool
|
|
ClientServiceRequestToEdit.Reject();
|
|
bClosingHandled = true;
|
|
this.Close();
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion Toolbar menu items
|
|
|
|
#region Form UI / Business object synchronization
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Synchronize the state of the UI to the BO's
|
|
/// </summary>
|
|
private void SyncUI()
|
|
{
|
|
|
|
|
|
//display ClientServiceRequest name in title bar
|
|
this.Text=mClientServiceRequest.Title;
|
|
|
|
|
|
|
|
}
|
|
/// <summary>
|
|
/// 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)
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void Application_Idle(object sender, EventArgs e)
|
|
{
|
|
SyncUI();
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 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
|
|
/// </summary>
|
|
private void RestrictUI()
|
|
{
|
|
//case 1039 //if(log.IsDebugEnabled) //case 1039 //log.Debug("RestrictUI: " + ((SecurityLevelTypes)AyaBizUtils.Right("Object.ClientServiceRequest")).ToString());
|
|
bool bReadOnly = !ClientServiceRequestToEdit.IsEditable;
|
|
|
|
tbManager.Tools["LT:UI.Command.Delete"].SharedProps.Visible=false;
|
|
|
|
|
|
|
|
tbManager.Tools["LT:UI.Command.SaveClose"].SharedProps.Visible=false;
|
|
tbManager.Tools["LT:UI.Command.SaveNew"].SharedProps.Visible=false;
|
|
tbManager.Tools["LT:UI.Command.Save"].SharedProps.Visible=false;
|
|
|
|
//Case 181
|
|
tbManager.Tools["LT:UI.Command.Close"].SharedProps.Visible=false;
|
|
|
|
tbManager.Tools["LT:ClientServiceRequest.Label.AcceptToNew"].SharedProps.Visible = !bReadOnly;
|
|
tbManager.Tools["LT:ClientServiceRequest.Label.AcceptToExisting"].SharedProps.Visible = !bReadOnly;
|
|
//case 1936
|
|
tbManager.Tools["LT:ClientServiceRequest.Label.Reject"].SharedProps.Visible = !bReadOnly && mClientServiceRequest.Status != ClientServiceRequestStatus.Declined;
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region Form DataBinding and BrokenRules handling
|
|
|
|
|
|
/// <summary>
|
|
/// Bind controls to business objects
|
|
/// </summary>
|
|
private void DataBind()
|
|
{
|
|
//case 1039 //log.Debug("DataBind");
|
|
|
|
|
|
//Subscribe to broken rules changed event OnBrokenRulesChanged
|
|
mClientServiceRequest.GetBrokenRulesCollection().ListChanged += new System.ComponentModel.ListChangedEventHandler(OnBrokenRulesChanged);
|
|
|
|
|
|
//=-=-=-=-=-=- Form Field bindings =-=-=-=-=-=-=-=-=-=-=-=
|
|
|
|
//Text editors
|
|
Util.BindField(edTitle,"Text",mClientServiceRequest,"Title");
|
|
Util.BindField(edDetails,"Text",mClientServiceRequest,"Details");
|
|
Util.BindField(edRef, "Text", mClientServiceRequest, "ClientRef");
|
|
Util.BindField(edRequestedBy, "Text", mClientServiceRequest, "RequestedBy");
|
|
|
|
|
|
//Combo boxes
|
|
Util.BindField(cbUnitID,"Value",mClientServiceRequest,"UnitID");
|
|
DisplayHeader();
|
|
|
|
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
|
|
|
|
//Bind IsDirty property to hidden checkbox to
|
|
//ensure isdirtychanged event is available
|
|
//to data binding infrastructure
|
|
Util.BindField(ckIsDirty,"Checked",mClientServiceRequest,"IsDirty");
|
|
|
|
//Setup initial link to broken rules
|
|
OnBrokenRulesChanged(null,null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Handle a change in broken rules
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void OnBrokenRulesChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
|
|
{
|
|
Util.BrokenRuleFeedback(this,mClientServiceRequest,ErrorProvider);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region Business object editing / adding / deletion related code
|
|
|
|
|
|
private ClientServiceRequest mClientServiceRequest;
|
|
/// <summary>
|
|
/// ClientServiceRequest record to display
|
|
/// set by caller
|
|
/// </summary>
|
|
public ClientServiceRequest ClientServiceRequestToEdit
|
|
{
|
|
get
|
|
{
|
|
return mClientServiceRequest;
|
|
}
|
|
set
|
|
{
|
|
mClientServiceRequest=value;
|
|
//mClientServiceRequest.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;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Update record and quit if requested
|
|
///
|
|
/// </summary>
|
|
/// <returns>True if handled, false if not handled</returns>
|
|
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
|
|
lblTitle.Focus();
|
|
|
|
switch(SaveType)
|
|
{
|
|
//case RecordActionType.DeleteAndExit:
|
|
// if(Util.PromptForDelete()==DialogResult.Yes)
|
|
// {
|
|
// try
|
|
// {
|
|
// //Delete, then exit
|
|
// ClientServiceRequest.DeleteItem(mClientServiceRequest.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(mClientServiceRequest.IsSavable)
|
|
{
|
|
mClientServiceRequest.ApplyEdit();
|
|
mClientServiceRequest.Save();
|
|
bClosingHandled=true;
|
|
mbChangesMade=true;
|
|
this.Close();
|
|
return true;
|
|
}
|
|
if(mClientServiceRequest.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(mClientServiceRequest.IsSavable)
|
|
// {
|
|
// mClientServiceRequest.ApplyEdit();
|
|
// mClientServiceRequest.Save();
|
|
// AddNewClientServiceRequest();
|
|
// mbChangesMade=true;
|
|
// return true;
|
|
|
|
// }
|
|
// if(mClientServiceRequest.IsDirty)//dirty and unsaveable due to broken rules
|
|
// {
|
|
// //User says that's ok, continue on?
|
|
// if(Util.PromptForBrokenRulesCancelSave()==DialogResult.Yes)
|
|
// {
|
|
// //Ok, add new ClientServiceRequest and don't save old record
|
|
// AddNewClientServiceRequest();
|
|
// return true;
|
|
// }
|
|
// else return false;
|
|
|
|
// }
|
|
|
|
// //Current record isn't dirty so just add a new ClientServiceRequest
|
|
// AddNewClientServiceRequest();
|
|
// return true;
|
|
|
|
case RecordActionType.SaveOnly:
|
|
if(mClientServiceRequest.IsSavable)
|
|
{
|
|
mClientServiceRequest.ApplyEdit();
|
|
mClientServiceRequest=(ClientServiceRequest)mClientServiceRequest.Save();
|
|
DataBind();
|
|
mbChangesMade=true;
|
|
return true;
|
|
|
|
}
|
|
return true;
|
|
|
|
case RecordActionType.PromptToSave:
|
|
//Prompt to save and save if
|
|
//required
|
|
if(mClientServiceRequest.IsDirty)
|
|
{
|
|
DialogResult dr=Util.PromptForSave();
|
|
if(dr==DialogResult.Cancel)
|
|
{
|
|
//Cancel
|
|
return false;
|
|
}
|
|
if(dr==DialogResult.Yes)
|
|
{
|
|
//Save before exit
|
|
|
|
if(mClientServiceRequest.IsSavable)
|
|
{
|
|
mClientServiceRequest.ApplyEdit();
|
|
mClientServiceRequest.Save();
|
|
mbChangesMade=true;
|
|
return true;
|
|
}
|
|
if(mClientServiceRequest.IsDirty)//dirty and unsaveable due to broken rules
|
|
{
|
|
if(Util.PromptForBrokenRulesCancelSave()==DialogResult.Yes)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
///Creates a new ClientServiceRequest record and opens it for editing
|
|
/// </summary>
|
|
//private void AddNewClientServiceRequest()
|
|
//{
|
|
// //case 1039 //log.Debug("AddNewClientServiceRequest");
|
|
|
|
// try
|
|
// {
|
|
// mClientServiceRequest=ClientServiceRequest.NewItem();
|
|
// //mClientServiceRequest.BeginEdit();
|
|
// DataBind();
|
|
// }
|
|
// catch(Exception ex)
|
|
// {
|
|
// log.Error("AddNewClientServiceRequest",ex);
|
|
// MessageBox.Show(ex.Message+"\r\n"+ex.Source);
|
|
// }
|
|
//}
|
|
|
|
|
|
#endregion
|
|
|
|
#region Form ComboBoxes (Setup / Events)
|
|
|
|
private void InitializeComboBoxes()
|
|
{
|
|
cbUnitID.Items.Add(ClientServiceRequestToEdit.UnitID, UnitNameFetcher.GetUnitNameFromUnitID(ClientServiceRequestToEdit.UnitID));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region header display
|
|
private void DisplayHeader()
|
|
{
|
|
//client, created, status
|
|
System.Text.StringBuilder sb=new System.Text.StringBuilder();
|
|
sb.Append(Util.LocaleText.GetLocalizedText("O.Client"));
|
|
sb.Append(": ");
|
|
sb.Append(NameFetcher.GetItem("Client", "Name", ClientServiceRequestToEdit.ClientID).RecordName);
|
|
sb.Append("\r\n");
|
|
|
|
sb.Append(Util.LocaleText.GetLocalizedText("Common.Label.Created"));
|
|
sb.Append(": ");
|
|
sb.Append(ClientServiceRequestToEdit.Created);
|
|
sb.Append("\r\n");
|
|
|
|
|
|
sb.Append(Util.LocaleText.GetLocalizedText("ClientServiceRequest.Label.Status"));
|
|
sb.Append(": ");
|
|
sb.Append(Util.GetNonBizName("ClientServiceRequestStatus", (int)ClientServiceRequestToEdit.Status));
|
|
sb.Append("\r\n");
|
|
|
|
lblHeader.Text = sb.ToString();
|
|
|
|
lblPriority.Text = Util.GetNonBizName("ClientServiceRequestPriority", (int)ClientServiceRequestToEdit.Priority);
|
|
switch (ClientServiceRequestToEdit.Priority)
|
|
{
|
|
case ClientServiceRequestPriority.NotUrgent:
|
|
lblPriority.Appearance.ForeColor = System.Drawing.Color.Green;
|
|
break;
|
|
case ClientServiceRequestPriority.ASAP:
|
|
lblPriority.Appearance.ForeColor = System.Drawing.Color.Orange;
|
|
break;
|
|
case ClientServiceRequestPriority.Emergency:
|
|
lblPriority.Appearance.ForeColor = System.Drawing.Color.Red;
|
|
break;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Accelerator keys
|
|
/// <summary>
|
|
/// Case 37
|
|
/// </summary>
|
|
/// <param name="msg"></param>
|
|
/// <param name="keyData"></param>
|
|
/// <returns></returns>
|
|
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
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|