This commit is contained in:
483
source/WinFormApp/WorkorderSelector.cs
Normal file
483
source/WinFormApp/WorkorderSelector.cs
Normal file
@@ -0,0 +1,483 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using GZTW.AyaNova.BLL;
|
||||
using Infragistics.Win;
|
||||
using log4net;
|
||||
|
||||
namespace AyaNova
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for WorkorderSelector.
|
||||
/// </summary>
|
||||
public class WorkorderSelector : 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 Infragistics.Win.UltraWinToolbars.UltraToolbarsManager tbManager;
|
||||
private System.Windows.Forms.Panel WorkorderSelector_Fill_Panel;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _WorkorderSelector_Toolbars_Dock_Area_Left;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _WorkorderSelector_Toolbars_Dock_Area_Right;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _WorkorderSelector_Toolbars_Dock_Area_Top;
|
||||
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _WorkorderSelector_Toolbars_Dock_Area_Bottom;
|
||||
private Infragistics.Win.UltraWinEditors.UltraComboEditor cbWorkorderID;
|
||||
private Infragistics.Win.Misc.UltraLabel ultraLabel1;
|
||||
private Infragistics.Win.UltraWinEditors.UltraTextEditor edSummary;
|
||||
private Infragistics.Win.Misc.UltraLabel lblSummary;
|
||||
private System.ComponentModel.IContainer components;
|
||||
|
||||
public WorkorderSelector()
|
||||
{
|
||||
//
|
||||
// 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("UltraToolbar1");
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.OK");
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Cancel");
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Toolbar.Refresh");
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Cancel");
|
||||
Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.OK");
|
||||
Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Toolbar.Refresh");
|
||||
Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
|
||||
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
|
||||
this.tbManager = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
|
||||
this.WorkorderSelector_Fill_Panel = new System.Windows.Forms.Panel();
|
||||
this.edSummary = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
||||
this.lblSummary = new Infragistics.Win.Misc.UltraLabel();
|
||||
this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
|
||||
this.cbWorkorderID = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbManager)).BeginInit();
|
||||
this.WorkorderSelector_Fill_Panel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.edSummary)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cbWorkorderID)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tbManager
|
||||
//
|
||||
this.tbManager.DesignerFlags = 1;
|
||||
this.tbManager.DockWithinContainer = this;
|
||||
this.tbManager.DockWithinContainerBaseType = typeof(System.Windows.Forms.Form);
|
||||
ultraToolbar1.DockedColumn = 0;
|
||||
ultraToolbar1.DockedRow = 0;
|
||||
ultraToolbar1.NonInheritedTools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
|
||||
buttonTool1,
|
||||
buttonTool2,
|
||||
buttonTool3});
|
||||
ultraToolbar1.Text = "WorkorderSelectorToolbar";
|
||||
this.tbManager.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
|
||||
ultraToolbar1});
|
||||
this.tbManager.ToolbarSettings.AllowCustomize = Infragistics.Win.DefaultableBoolean.False;
|
||||
this.tbManager.ToolbarSettings.AllowFloating = Infragistics.Win.DefaultableBoolean.False;
|
||||
this.tbManager.ToolbarSettings.AllowHiding = Infragistics.Win.DefaultableBoolean.False;
|
||||
appearance2.Image = global::AyaNova.Resource1.Cancel32;
|
||||
buttonTool4.SharedPropsInternal.AppearancesLarge.Appearance = appearance2;
|
||||
appearance3.Image = global::AyaNova.Resource1.Cancel16;
|
||||
buttonTool4.SharedPropsInternal.AppearancesSmall.Appearance = appearance3;
|
||||
buttonTool4.SharedPropsInternal.Caption = "LT:UI.Command.Cancel";
|
||||
appearance4.Image = global::AyaNova.Resource1.OK32;
|
||||
buttonTool5.SharedPropsInternal.AppearancesLarge.Appearance = appearance4;
|
||||
appearance5.Image = global::AyaNova.Resource1.OK16;
|
||||
buttonTool5.SharedPropsInternal.AppearancesSmall.Appearance = appearance5;
|
||||
buttonTool5.SharedPropsInternal.Caption = "LT:UI.Command.OK";
|
||||
appearance6.Image = global::AyaNova.Resource1.Refresh32;
|
||||
buttonTool6.SharedPropsInternal.AppearancesLarge.Appearance = appearance6;
|
||||
appearance7.Image = global::AyaNova.Resource1.Refresh16;
|
||||
buttonTool6.SharedPropsInternal.AppearancesSmall.Appearance = appearance7;
|
||||
buttonTool6.SharedPropsInternal.Caption = "LT:UI.Toolbar.Refresh";
|
||||
this.tbManager.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
|
||||
buttonTool4,
|
||||
buttonTool5,
|
||||
buttonTool6});
|
||||
this.tbManager.UseLargeImagesOnToolbar = true;
|
||||
this.tbManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.tbManager_ToolClick);
|
||||
//
|
||||
// WorkorderSelector_Fill_Panel
|
||||
//
|
||||
this.WorkorderSelector_Fill_Panel.Controls.Add(this.edSummary);
|
||||
this.WorkorderSelector_Fill_Panel.Controls.Add(this.lblSummary);
|
||||
this.WorkorderSelector_Fill_Panel.Controls.Add(this.ultraLabel1);
|
||||
this.WorkorderSelector_Fill_Panel.Controls.Add(this.cbWorkorderID);
|
||||
this.WorkorderSelector_Fill_Panel.Cursor = System.Windows.Forms.Cursors.Default;
|
||||
this.WorkorderSelector_Fill_Panel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.WorkorderSelector_Fill_Panel.Location = new System.Drawing.Point(0, 43);
|
||||
this.WorkorderSelector_Fill_Panel.Name = "WorkorderSelector_Fill_Panel";
|
||||
this.WorkorderSelector_Fill_Panel.Size = new System.Drawing.Size(520, 114);
|
||||
this.WorkorderSelector_Fill_Panel.TabIndex = 0;
|
||||
//
|
||||
// edSummary
|
||||
//
|
||||
this.edSummary.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
appearance1.BackGradientStyle = Infragistics.Win.GradientStyle.None;
|
||||
this.edSummary.Appearance = appearance1;
|
||||
this.edSummary.Enabled = false;
|
||||
this.edSummary.Location = new System.Drawing.Point(3, 74);
|
||||
this.edSummary.Name = "edSummary";
|
||||
this.edSummary.Size = new System.Drawing.Size(515, 24);
|
||||
this.edSummary.TabIndex = 154;
|
||||
//
|
||||
// lblSummary
|
||||
//
|
||||
this.lblSummary.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lblSummary.Location = new System.Drawing.Point(3, 55);
|
||||
this.lblSummary.Name = "lblSummary";
|
||||
this.lblSummary.Size = new System.Drawing.Size(515, 19);
|
||||
this.lblSummary.TabIndex = 155;
|
||||
this.lblSummary.Tag = "";
|
||||
this.lblSummary.Text = "LT:Workorder.Label.Summary";
|
||||
//
|
||||
// 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(3, 0);
|
||||
this.ultraLabel1.Name = "ultraLabel1";
|
||||
this.ultraLabel1.Size = new System.Drawing.Size(505, 18);
|
||||
this.ultraLabel1.TabIndex = 150;
|
||||
this.ultraLabel1.Text = "LT:O.Workorder";
|
||||
//
|
||||
// cbWorkorderID
|
||||
//
|
||||
this.cbWorkorderID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cbWorkorderID.AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend;
|
||||
this.cbWorkorderID.LimitToList = true;
|
||||
this.cbWorkorderID.Location = new System.Drawing.Point(3, 18);
|
||||
this.cbWorkorderID.MaxDropDownItems = 24;
|
||||
this.cbWorkorderID.Name = "cbWorkorderID";
|
||||
this.cbWorkorderID.Size = new System.Drawing.Size(515, 24);
|
||||
this.cbWorkorderID.SortStyle = Infragistics.Win.ValueListSortStyle.Ascending;
|
||||
this.cbWorkorderID.TabIndex = 149;
|
||||
this.cbWorkorderID.SelectionChanged += new System.EventHandler(this.cbWorkorderID_SelectionChanged);
|
||||
this.cbWorkorderID.ValueChanged += new System.EventHandler(this.cbWorkorderID_ValueChanged);
|
||||
//
|
||||
// _WorkorderSelector_Toolbars_Dock_Area_Left
|
||||
//
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 43);
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left.Name = "_WorkorderSelector_Toolbars_Dock_Area_Left";
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 114);
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Left.ToolbarsManager = this.tbManager;
|
||||
//
|
||||
// _WorkorderSelector_Toolbars_Dock_Area_Right
|
||||
//
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(520, 43);
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right.Name = "_WorkorderSelector_Toolbars_Dock_Area_Right";
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 114);
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Right.ToolbarsManager = this.tbManager;
|
||||
//
|
||||
// _WorkorderSelector_Toolbars_Dock_Area_Top
|
||||
//
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top.Name = "_WorkorderSelector_Toolbars_Dock_Area_Top";
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(520, 43);
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Top.ToolbarsManager = this.tbManager;
|
||||
//
|
||||
// _WorkorderSelector_Toolbars_Dock_Area_Bottom
|
||||
//
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 157);
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom.Name = "_WorkorderSelector_Toolbars_Dock_Area_Bottom";
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(520, 0);
|
||||
this._WorkorderSelector_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.tbManager;
|
||||
//
|
||||
// WorkorderSelector
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
||||
this.ClientSize = new System.Drawing.Size(520, 157);
|
||||
this.Controls.Add(this.WorkorderSelector_Fill_Panel);
|
||||
this.Controls.Add(this._WorkorderSelector_Toolbars_Dock_Area_Left);
|
||||
this.Controls.Add(this._WorkorderSelector_Toolbars_Dock_Area_Right);
|
||||
this.Controls.Add(this._WorkorderSelector_Toolbars_Dock_Area_Bottom);
|
||||
this.Controls.Add(this._WorkorderSelector_Toolbars_Dock_Area_Top);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "WorkorderSelector";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Closing += new System.ComponentModel.CancelEventHandler(this.WorkorderSelector_Closing);
|
||||
this.Load += new System.EventHandler(this.WorkorderSelector_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbManager)).EndInit();
|
||||
this.WorkorderSelector_Fill_Panel.ResumeLayout(false);
|
||||
this.WorkorderSelector_Fill_Panel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.edSummary)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cbWorkorderID)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
|
||||
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
|
||||
// ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
|
||||
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
|
||||
//
|
||||
|
||||
|
||||
#region Global vars / Properties
|
||||
|
||||
private WorkorderPickList PickList=null;
|
||||
|
||||
private Guid mSelectedWorkorderID=Guid.Empty;
|
||||
public Guid SelectedWorkorderID
|
||||
{
|
||||
get{ return mSelectedWorkorderID;}
|
||||
|
||||
}
|
||||
|
||||
private Guid mClientID=Guid.Empty;
|
||||
public Guid ClientID
|
||||
{
|
||||
get{ return mClientID;}
|
||||
set{ mClientID=value;}
|
||||
|
||||
}
|
||||
|
||||
private Guid mDoNotShowWorkorderID=Guid.Empty;
|
||||
public Guid DoNotShowWorkorderID
|
||||
{
|
||||
get{ return mDoNotShowWorkorderID;}
|
||||
set{ mDoNotShowWorkorderID=value;}
|
||||
|
||||
}
|
||||
|
||||
//case 1990
|
||||
private WorkorderQuotePickList QuotePickList = null;
|
||||
//private WorkorderTypes mSelectedWorkorderType = WorkorderTypes.Service;
|
||||
//public WorkorderTypes SelectedWorkorderType
|
||||
//{
|
||||
// get { return mSelectedWorkorderType; }
|
||||
|
||||
//}
|
||||
|
||||
private bool mIncludeQuotes=false;
|
||||
public bool IncludeQuotes
|
||||
{
|
||||
get{ return mIncludeQuotes;}
|
||||
set{ mIncludeQuotes=value;}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Load / close events
|
||||
//variable to hold user form settings
|
||||
//UIUserFormSetting mFormSetting;
|
||||
|
||||
private void WorkorderSelector_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
//case 1039 //log.Debug("WorkorderSelector_Load");
|
||||
Util.LoadFormCustomization("WorkorderSelector", this, tbManager, true);
|
||||
this.Icon = Resource1.ServiceWorkorder16icon;
|
||||
Util.Localize(this);
|
||||
|
||||
LoadCombo();
|
||||
Application.Idle+= new EventHandler(Application_Idle);
|
||||
}
|
||||
|
||||
private void WorkorderSelector_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
//case 1039 //log.Debug("WorkorderSelector_Closing");
|
||||
Application.Idle-= new EventHandler(Application_Idle);
|
||||
if(mSelectedWorkorderID==Guid.Empty)
|
||||
this.DialogResult=DialogResult.Cancel;
|
||||
Util.SaveFormCustomization("WorkorderSelector", this, tbManager, true);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Idle processing
|
||||
|
||||
private void Application_Idle(object sender, EventArgs e)
|
||||
{
|
||||
tbManager.Tools["LT:UI.Command.OK"].SharedProps.Enabled=mSelectedWorkorderID!=Guid.Empty;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region UI Commands
|
||||
|
||||
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.Cancel": // ButtonTool
|
||||
mSelectedWorkorderID=Guid.Empty;
|
||||
this.DialogResult=DialogResult.Cancel;
|
||||
this.Close();
|
||||
break;
|
||||
|
||||
case "LT:UI.Command.OK": // ButtonTool
|
||||
this.DialogResult=DialogResult.OK;
|
||||
this.Close();
|
||||
break;
|
||||
|
||||
case "LT:UI.Toolbar.Refresh": // ButtonTool
|
||||
LoadCombo();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Combo box intialization / events
|
||||
|
||||
private void LoadCombo()
|
||||
{
|
||||
//case 1039 //log.Debug("LoadCombo");
|
||||
|
||||
cbWorkorderID.Items.Clear();
|
||||
|
||||
|
||||
//case 1990
|
||||
if (mIncludeQuotes)
|
||||
{
|
||||
string qs = Util.LocaleText.GetLocalizedText("O.WorkorderQuote");
|
||||
QuotePickList = WorkorderQuotePickList.GetListByClient(mClientID);
|
||||
|
||||
foreach (WorkorderQuotePickList.WorkorderQuotePickListInfo i in QuotePickList)
|
||||
{
|
||||
if (i.ID != mDoNotShowWorkorderID)
|
||||
cbWorkorderID.Items.Add(i.ID, qs + ": " + i.QuoteNumber + " - " + i.RequestedDate.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PickList=WorkorderPickList.GetListByClient(mClientID);
|
||||
|
||||
foreach(WorkorderPickList.WorkorderPickListInfo pfo in PickList)
|
||||
{
|
||||
if(pfo.ID!=mDoNotShowWorkorderID)
|
||||
cbWorkorderID.Items.Add(pfo.ID,pfo.ServiceNumber + " - " + pfo.ServiceDate.ToString());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void cbWorkorderID_ValueChanged(object sender, System.EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void cbWorkorderID_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
//case 1039 //log.Debug("cbWorkorderID_selectionChanged");
|
||||
|
||||
|
||||
mSelectedWorkorderID=(Guid)cbWorkorderID.SelectedItem.DataValue;
|
||||
foreach(WorkorderPickList.WorkorderPickListInfo pfo in PickList)
|
||||
{
|
||||
if(pfo.ID==mSelectedWorkorderID)
|
||||
{
|
||||
edSummary.Text=pfo.Summary;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//case 1990
|
||||
if (mIncludeQuotes)
|
||||
{
|
||||
foreach (WorkorderQuotePickList.WorkorderQuotePickListInfo i in QuotePickList)
|
||||
{
|
||||
if (i.ID == mSelectedWorkorderID)
|
||||
{
|
||||
edSummary.Text = i.Summary;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user