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 } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// 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; /// /// Used to indicate if dialog should display for post or pre /// status /// public bool PreStatus { set { _Pre=value; } } /// /// /// /// /// 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(); } //--------------------------------------------- } }