154 lines
4.0 KiB
C#
154 lines
4.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using System.Data;
|
|
using Infragistics.Win;
|
|
|
|
namespace AyaNova.PlugIn.PTI
|
|
{
|
|
public class SetPTChargeAs : AyaNova.PlugIn.PTI.SetBase
|
|
{
|
|
private Infragistics.Win.UltraWinEditors.UltraComboEditor cbPTItems;
|
|
private Infragistics.Win.Misc.UltraLabel lblItems;
|
|
private System.ComponentModel.IContainer components = null;
|
|
|
|
public SetPTChargeAs()
|
|
{
|
|
// 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.lblItems = new Infragistics.Win.Misc.UltraLabel();
|
|
this.cbPTItems = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
|
|
((System.ComponentModel.ISupportInitialize)(this.cbPTItems)).BeginInit();
|
|
this.SuspendLayout();
|
|
//
|
|
// lblItems
|
|
//
|
|
this.lblItems.Location = new System.Drawing.Point(10, 294);
|
|
this.lblItems.Name = "lblItems";
|
|
this.lblItems.Size = new System.Drawing.Size(613, 19);
|
|
this.lblItems.TabIndex = 32;
|
|
this.lblItems.Text = "Peachtree item:";
|
|
//
|
|
// cbPTItems
|
|
//
|
|
this.cbPTItems.LimitToList = true;
|
|
this.cbPTItems.Location = new System.Drawing.Point(10, 313);
|
|
this.cbPTItems.MaxDropDownItems = 16;
|
|
this.cbPTItems.Name = "cbPTItems";
|
|
this.cbPTItems.Size = new System.Drawing.Size(607, 24);
|
|
this.cbPTItems.TabIndex = 31;
|
|
//
|
|
// SetPTChargeAs
|
|
//
|
|
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
|
this.ClientSize = new System.Drawing.Size(637, 408);
|
|
this.Controls.Add(this.lblItems);
|
|
this.Controls.Add(this.cbPTItems);
|
|
this.Name = "SetPTChargeAs";
|
|
this.Text = "";
|
|
this.Load += new System.EventHandler(this.SetQBChargeAs_Load);
|
|
this.Controls.SetChildIndex(this.cbPTItems, 0);
|
|
this.Controls.SetChildIndex(this.lblItems, 0);
|
|
((System.ComponentModel.ISupportInitialize)(this.cbPTItems)).EndInit();
|
|
this.ResumeLayout(false);
|
|
this.PerformLayout();
|
|
|
|
}
|
|
#endregion
|
|
|
|
private DataTable _PTItems;
|
|
private string _SelectedItem="";
|
|
|
|
private void SetQBChargeAs_Load(object sender, System.EventArgs e)
|
|
{
|
|
|
|
cbPTItems.ValueMember="ID";
|
|
cbPTItems.DisplayMember="FullName";
|
|
//Case 237
|
|
//cbPTItems.SortStyle = Infragistics.Win.ValueListSortStyle.Ascending;
|
|
this.cbPTItems.DataSource=_PTItems;
|
|
|
|
if (_SelectedItem == "")
|
|
cbPTItems.SelectedIndex = 0;
|
|
else
|
|
|
|
{
|
|
foreach(ValueListItem vi in cbPTItems.Items)
|
|
{
|
|
if((string)vi.DataValue==_SelectedItem)
|
|
{
|
|
cbPTItems.SelectedItem=vi;
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
public DataTable PTItems
|
|
{
|
|
set
|
|
{
|
|
_PTItems=value;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public string SelectedPTItem
|
|
{
|
|
get
|
|
{
|
|
return cbPTItems.SelectedItem.DataValue.ToString();
|
|
}
|
|
set
|
|
{
|
|
_SelectedItem=value;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void btnOK_Click(object sender, EventArgs e)
|
|
{
|
|
base.ClosingHandled=true;
|
|
this.DialogResult=DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
|
|
|
|
|
|
//------------------------------
|
|
}
|
|
}
|
|
|