This commit is contained in:
213
source/Plugins/AyaNova.Plugin.PTI/SetBase.cs
Normal file
213
source/Plugins/AyaNova.Plugin.PTI/SetBase.cs
Normal file
@@ -0,0 +1,213 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AyaNova.PlugIn.PTI
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for SetPreWOStatus.
|
||||
/// </summary>
|
||||
public class SetBase : System.Windows.Forms.Form
|
||||
{
|
||||
private Infragistics.Win.Misc.UltraLabel lblDescription;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private Infragistics.Win.Misc.UltraLabel lblTitle;
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
public SetBase()
|
||||
{
|
||||
//
|
||||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add any constructor code after 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 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.lblTitle = new Infragistics.Win.Misc.UltraLabel();
|
||||
this.lblDescription = new Infragistics.Win.Misc.UltraLabel();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblTitle
|
||||
//
|
||||
this.lblTitle.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblTitle.Location = new System.Drawing.Point(10, 15);
|
||||
this.lblTitle.Name = "lblTitle";
|
||||
this.lblTitle.Size = new System.Drawing.Size(615, 35);
|
||||
this.lblTitle.TabIndex = 0;
|
||||
this.lblTitle.Text = "Billable workorder status";
|
||||
//
|
||||
// lblDescription
|
||||
//
|
||||
this.lblDescription.BackColorInternal = System.Drawing.SystemColors.Window;
|
||||
this.lblDescription.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblDescription.Location = new System.Drawing.Point(10, 58);
|
||||
this.lblDescription.Name = "lblDescription";
|
||||
this.lblDescription.Size = new System.Drawing.Size(615, 190);
|
||||
this.lblDescription.TabIndex = 1;
|
||||
this.lblDescription.Text = "Description of option";
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnOK.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.btnOK.Location = new System.Drawing.Point(524, 350);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(90, 40);
|
||||
this.btnOK.TabIndex = 28;
|
||||
this.btnOK.UseVisualStyleBackColor = false;
|
||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnCancel.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.btnCancel.Location = new System.Drawing.Point(419, 350);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(90, 40);
|
||||
this.btnCancel.TabIndex = 27;
|
||||
this.btnCancel.UseVisualStyleBackColor = false;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// SetBase
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
||||
this.ClientSize = new System.Drawing.Size(637, 408);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.lblDescription);
|
||||
this.Controls.Add(this.lblTitle);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "SetBase";
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "AyaNova PTI - Setup";
|
||||
this.Closing += new System.ComponentModel.CancelEventHandler(this.SetBase_Closing);
|
||||
this.Load += new System.EventHandler(this.SetBase_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
|
||||
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
|
||||
// ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
|
||||
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
|
||||
//************************************************************
|
||||
|
||||
private string _DialogTitle="";
|
||||
private string _OptionTitle="";
|
||||
private string _OptionDescription="";
|
||||
|
||||
public string DialogTitle
|
||||
{
|
||||
set{_DialogTitle=value;}
|
||||
}
|
||||
|
||||
public string OptionTitle
|
||||
{
|
||||
set{_OptionTitle=value;}
|
||||
}
|
||||
|
||||
public string OptionDescription
|
||||
{
|
||||
set{_OptionDescription=value;}
|
||||
}
|
||||
|
||||
|
||||
private void SetBase_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
this.btnCancel.Image = Util.AyaImage("Cancel24");
|
||||
this.btnOK.Image = Util.AyaImage("OK24");
|
||||
this.Text=_DialogTitle;
|
||||
this.lblDescription.Text=_OptionDescription;
|
||||
this.lblTitle.Text=_OptionTitle;
|
||||
|
||||
}
|
||||
|
||||
public bool bClosingHandled=false;
|
||||
public bool ClosingHandled
|
||||
{
|
||||
set{ bClosingHandled=value;}
|
||||
}
|
||||
private void btnCancel_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
HandleBail();
|
||||
|
||||
}
|
||||
|
||||
private void SetBase_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
if(!bClosingHandled)
|
||||
{
|
||||
HandleBail();
|
||||
e.Cancel=true;
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleBail()
|
||||
{
|
||||
if(MessageBox.Show(
|
||||
"Are you sure you wish to cancel?",
|
||||
_DialogTitle,
|
||||
MessageBoxButtons.RetryCancel,MessageBoxIcon.Information)==DialogResult.Cancel)
|
||||
{
|
||||
this.DialogResult=DialogResult.Cancel;
|
||||
bClosingHandled=true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Virtual OK click to override in derived forms
|
||||
//to validate entry etc
|
||||
public virtual void btnOK_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
bClosingHandled=true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user