This commit is contained in:
164
source/Plugins/AyaNova.Plugin.PTI/SetWOStatus.cs
Normal file
164
source/Plugins/AyaNova.Plugin.PTI/SetWOStatus.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using GZTW.AyaNova.BLL;
|
||||
namespace AyaNova.PlugIn.PTI
|
||||
{
|
||||
public class SetWOStatus : AyaNova.PlugIn.PTI.SetBase
|
||||
{
|
||||
private Infragistics.Win.UltraWinEditors.UltraComboEditor cbStatus;
|
||||
private Infragistics.Win.Misc.UltraLabel lblStatus;
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
public SetWOStatus()
|
||||
{
|
||||
// This call is required by the Windows Form Designer.
|
||||
InitializeComponent();
|
||||
|
||||
// TODO: Add any initialization after the InitializeComponent call
|
||||
}
|
||||
|
||||
/// <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 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.cbStatus = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
|
||||
this.lblStatus = new Infragistics.Win.Misc.UltraLabel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cbStatus)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// cbStatus
|
||||
//
|
||||
this.cbStatus.LimitToList = true;
|
||||
this.cbStatus.Location = new System.Drawing.Point(32, 312);
|
||||
this.cbStatus.Name = "cbStatus";
|
||||
this.cbStatus.Size = new System.Drawing.Size(557, 24);
|
||||
this.cbStatus.TabIndex = 29;
|
||||
//
|
||||
// lblStatus
|
||||
//
|
||||
this.lblStatus.Location = new System.Drawing.Point(32, 293);
|
||||
this.lblStatus.Name = "lblStatus";
|
||||
this.lblStatus.Size = new System.Drawing.Size(557, 19);
|
||||
this.lblStatus.TabIndex = 30;
|
||||
//
|
||||
// SetWOStatus
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
||||
this.ClientSize = new System.Drawing.Size(637, 408);
|
||||
this.Controls.Add(this.lblStatus);
|
||||
this.Controls.Add(this.cbStatus);
|
||||
this.Name = "SetWOStatus";
|
||||
this.Text = "";
|
||||
this.Closing += new System.ComponentModel.CancelEventHandler(this.SetWOStatus_Closing);
|
||||
this.Load += new System.EventHandler(this.SetWOStatus_Load);
|
||||
this.Controls.SetChildIndex(this.cbStatus, 0);
|
||||
this.Controls.SetChildIndex(this.lblStatus, 0);
|
||||
((System.ComponentModel.ISupportInitialize)(this.cbStatus)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
private Guid _SelectedStatus=Guid.Empty;
|
||||
public Guid SelectedStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Guid)cbStatus.SelectedItem.DataValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
_SelectedStatus=value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private bool _Pre=true;
|
||||
/// <summary>
|
||||
/// Used to indicate if dialog should display for post or pre
|
||||
/// status
|
||||
/// </summary>
|
||||
public bool PreStatus
|
||||
{
|
||||
|
||||
set
|
||||
{
|
||||
_Pre=value;
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void SetWOStatus_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
this.lblStatus.Text=Util.LocaleText.GetLocalizedText("O.WorkorderStatus");
|
||||
//NVCHANGED
|
||||
GenericNVList ls=GenericNVList.GetList("aWorkorderStatus","aID","aName",true,false,false);
|
||||
|
||||
if(_Pre)
|
||||
this.cbStatus.SelectedItem=this.cbStatus.Items.Add(Guid.Empty,"< Any status >");
|
||||
else
|
||||
this.cbStatus.SelectedItem=this.cbStatus.Items.Add(Guid.Empty,"< Do not change status >");
|
||||
|
||||
|
||||
foreach(DictionaryEntry d in ls.BindableList)
|
||||
{
|
||||
Guid gItem=new Guid(d.Key.ToString());
|
||||
Infragistics.Win.ValueListItem v=this.cbStatus.Items.Add(gItem,d.Value.ToString());
|
||||
if(_SelectedStatus==gItem)
|
||||
{
|
||||
this.cbStatus.SelectedItem=v;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void SetWOStatus_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
//MessageBox.Show("Closing");
|
||||
}
|
||||
|
||||
public override void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
base.ClosingHandled=true;
|
||||
this.DialogResult=DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user