296 lines
9.9 KiB
C#
296 lines
9.9 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using System.Windows.Forms;
|
|
using System.Data;
|
|
|
|
namespace AyaNova.PlugIn.PTI
|
|
{
|
|
/// <summary>
|
|
/// Summary description for LinkOrImportAyaObject.
|
|
/// </summary>
|
|
public class LinkOrImportAyaObject : System.Windows.Forms.Form
|
|
{
|
|
private System.Windows.Forms.Button btnOK;
|
|
private System.Windows.Forms.Button btnCancel;
|
|
private System.Windows.Forms.Button btnImport;
|
|
private Infragistics.Win.Misc.UltraLabel lblItems;
|
|
private Infragistics.Win.UltraWinEditors.UltraComboEditor cbPTItems;
|
|
private Infragistics.Win.Misc.UltraLabel lblAyaObject;
|
|
private Infragistics.Win.Misc.UltraLabel lblOR;
|
|
/// <summary>
|
|
/// Required designer variable.
|
|
/// </summary>
|
|
private System.ComponentModel.Container components = null;
|
|
|
|
public LinkOrImportAyaObject()
|
|
{
|
|
//
|
|
// Required for Windows Form Designer support
|
|
//
|
|
InitializeComponent();
|
|
|
|
this.btnCancel.Image = Util.AyaImage("Cancel24");
|
|
this.btnOK.Image = Util.AyaImage("OK24");
|
|
}
|
|
|
|
/// <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()
|
|
{
|
|
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
|
|
this.btnOK = new System.Windows.Forms.Button();
|
|
this.btnCancel = new System.Windows.Forms.Button();
|
|
this.btnImport = new System.Windows.Forms.Button();
|
|
this.lblAyaObject = new Infragistics.Win.Misc.UltraLabel();
|
|
this.lblItems = new Infragistics.Win.Misc.UltraLabel();
|
|
this.cbPTItems = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
|
|
this.lblOR = new Infragistics.Win.Misc.UltraLabel();
|
|
((System.ComponentModel.ISupportInitialize)(this.cbPTItems)).BeginInit();
|
|
this.SuspendLayout();
|
|
//
|
|
// 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.DialogResult = System.Windows.Forms.DialogResult.OK;
|
|
this.btnOK.Location = new System.Drawing.Point(392, 203);
|
|
this.btnOK.Name = "btnOK";
|
|
this.btnOK.Size = new System.Drawing.Size(102, 41);
|
|
this.btnOK.TabIndex = 32;
|
|
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.Left)));
|
|
this.btnCancel.BackColor = System.Drawing.SystemColors.Control;
|
|
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
|
this.btnCancel.Location = new System.Drawing.Point(10, 207);
|
|
this.btnCancel.Name = "btnCancel";
|
|
this.btnCancel.Size = new System.Drawing.Size(102, 40);
|
|
this.btnCancel.TabIndex = 31;
|
|
this.btnCancel.UseVisualStyleBackColor = false;
|
|
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
|
//
|
|
// btnImport
|
|
//
|
|
this.btnImport.BackColor = System.Drawing.SystemColors.Control;
|
|
this.btnImport.DialogResult = System.Windows.Forms.DialogResult.OK;
|
|
this.btnImport.Dock = System.Windows.Forms.DockStyle.Top;
|
|
this.btnImport.Location = new System.Drawing.Point(0, 135);
|
|
this.btnImport.Name = "btnImport";
|
|
this.btnImport.Size = new System.Drawing.Size(504, 41);
|
|
this.btnImport.TabIndex = 33;
|
|
this.btnImport.Text = "Import to Peachtree";
|
|
this.btnImport.UseVisualStyleBackColor = false;
|
|
this.btnImport.Visible = false;
|
|
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
|
|
//
|
|
// lblAyaObject
|
|
//
|
|
appearance1.TextVAlignAsString = "Middle";
|
|
this.lblAyaObject.Appearance = appearance1;
|
|
this.lblAyaObject.BackColorInternal = System.Drawing.SystemColors.Window;
|
|
this.lblAyaObject.Dock = System.Windows.Forms.DockStyle.Top;
|
|
this.lblAyaObject.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
this.lblAyaObject.Location = new System.Drawing.Point(0, 0);
|
|
this.lblAyaObject.Name = "lblAyaObject";
|
|
this.lblAyaObject.Size = new System.Drawing.Size(504, 36);
|
|
this.lblAyaObject.TabIndex = 34;
|
|
this.lblAyaObject.Text = "ultraLabel1";
|
|
//
|
|
// lblItems
|
|
//
|
|
appearance2.TextVAlignAsString = "Bottom";
|
|
this.lblItems.Appearance = appearance2;
|
|
this.lblItems.Dock = System.Windows.Forms.DockStyle.Top;
|
|
this.lblItems.Location = new System.Drawing.Point(0, 36);
|
|
this.lblItems.Name = "lblItems";
|
|
this.lblItems.Size = new System.Drawing.Size(504, 37);
|
|
this.lblItems.TabIndex = 36;
|
|
this.lblItems.Text = "Link to Peachtree item:";
|
|
//
|
|
// cbPTItems
|
|
//
|
|
this.cbPTItems.Dock = System.Windows.Forms.DockStyle.Top;
|
|
this.cbPTItems.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
|
|
this.cbPTItems.LimitToList = true;
|
|
this.cbPTItems.Location = new System.Drawing.Point(0, 73);
|
|
this.cbPTItems.MaxDropDownItems = 16;
|
|
this.cbPTItems.Name = "cbPTItems";
|
|
this.cbPTItems.Nullable = false;
|
|
this.cbPTItems.Size = new System.Drawing.Size(504, 24);
|
|
this.cbPTItems.TabIndex = 35;
|
|
//
|
|
// lblOR
|
|
//
|
|
appearance3.TextVAlignAsString = "Bottom";
|
|
this.lblOR.Appearance = appearance3;
|
|
this.lblOR.Dock = System.Windows.Forms.DockStyle.Top;
|
|
this.lblOR.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
this.lblOR.Location = new System.Drawing.Point(0, 97);
|
|
this.lblOR.Name = "lblOR";
|
|
this.lblOR.Size = new System.Drawing.Size(504, 38);
|
|
this.lblOR.TabIndex = 37;
|
|
this.lblOR.Text = "Or import AyaNova item to Peachtree:";
|
|
//
|
|
// LinkOrImportAyaObject
|
|
//
|
|
this.AcceptButton = this.btnOK;
|
|
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
|
this.CancelButton = this.btnCancel;
|
|
this.ClientSize = new System.Drawing.Size(504, 269);
|
|
this.ControlBox = false;
|
|
this.Controls.Add(this.btnImport);
|
|
this.Controls.Add(this.lblOR);
|
|
this.Controls.Add(this.cbPTItems);
|
|
this.Controls.Add(this.lblItems);
|
|
this.Controls.Add(this.lblAyaObject);
|
|
this.Controls.Add(this.btnOK);
|
|
this.Controls.Add(this.btnCancel);
|
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
|
|
this.MinimumSize = new System.Drawing.Size(516, 306);
|
|
this.Name = "LinkOrImportAyaObject";
|
|
this.Text = "Resolve AyaNova object";
|
|
this.Load += new System.EventHandler(this.LinkOrImportAyaObject_Load);
|
|
((System.ComponentModel.ISupportInitialize)(this.cbPTItems)).EndInit();
|
|
this.ResumeLayout(false);
|
|
this.PerformLayout();
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
private DataTable _PTItems;
|
|
private string _AyaItem;
|
|
private bool _CanImport;
|
|
private string _Choice="CANCEL";
|
|
|
|
|
|
private void LinkOrImportAyaObject_Load(object sender, System.EventArgs e)
|
|
{
|
|
cbPTItems.ValueMember="ID";
|
|
cbPTItems.DisplayMember="FullName";
|
|
this.cbPTItems.DataSource=_PTItems;
|
|
//Case 237
|
|
//cbPTItems.SortStyle=Infragistics.Win.ValueListSortStyle.Ascending;
|
|
if(cbPTItems.SelectedIndex==-1)
|
|
cbPTItems.SelectedIndex=0;
|
|
this.lblAyaObject.Text=_AyaItem;
|
|
this.lblOR.Visible = this.btnImport.Visible=_CanImport;
|
|
|
|
}
|
|
|
|
private void btnImport_Click(object sender, System.EventArgs e)
|
|
{
|
|
_Choice="IMPORT";
|
|
this.DialogResult=DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
|
|
private void btnOK_Click(object sender, System.EventArgs e)
|
|
{
|
|
_Choice="LINK";
|
|
|
|
}
|
|
|
|
private void btnCancel_Click(object sender, System.EventArgs e)
|
|
{
|
|
_Choice="CANCEL";
|
|
}
|
|
|
|
public DataTable PTItems
|
|
{
|
|
set
|
|
{
|
|
_PTItems=value;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public string AyaItem
|
|
{
|
|
set
|
|
{
|
|
_AyaItem=value;
|
|
|
|
}
|
|
}
|
|
|
|
public bool CanImport
|
|
{
|
|
set
|
|
{
|
|
_CanImport=value;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public string SelectedPTItem
|
|
{
|
|
get
|
|
{
|
|
return cbPTItems.SelectedItem.DataValue.ToString();
|
|
}
|
|
|
|
}
|
|
|
|
public string SelectedPTItemName
|
|
{
|
|
get
|
|
{
|
|
return cbPTItems.SelectedItem.DisplayText;
|
|
}
|
|
|
|
}
|
|
|
|
public string Choice
|
|
{
|
|
get
|
|
{
|
|
return this._Choice;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|