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.QBOI
|
|
{
|
|
public class SetQBChargeAs : SetBase
|
|
{
|
|
private Infragistics.Win.UltraWinEditors.UltraComboEditor cbQBItems;
|
|
private Infragistics.Win.Misc.UltraLabel lblItems;
|
|
private System.ComponentModel.IContainer components = null;
|
|
|
|
public SetQBChargeAs()
|
|
{
|
|
// This call is required by the Windows Form Designer.
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
/// <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.cbQBItems = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
|
|
((System.ComponentModel.ISupportInitialize)(this.cbQBItems)).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 = "QuickBooks item:";
|
|
//
|
|
// cbQBItems
|
|
//
|
|
this.cbQBItems.LimitToList = true;
|
|
this.cbQBItems.Location = new System.Drawing.Point(10, 313);
|
|
this.cbQBItems.MaxDropDownItems = 16;
|
|
this.cbQBItems.Name = "cbQBItems";
|
|
this.cbQBItems.Size = new System.Drawing.Size(607, 24);
|
|
this.cbQBItems.TabIndex = 31;
|
|
//
|
|
// SetQBChargeAs
|
|
//
|
|
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.cbQBItems);
|
|
this.Name = "SetQBChargeAs";
|
|
this.ShowInTaskbar = true;
|
|
this.Text = "";
|
|
this.Load += new System.EventHandler(this.SetQBChargeAs_Load);
|
|
this.Controls.SetChildIndex(this.cbQBItems, 0);
|
|
this.Controls.SetChildIndex(this.lblItems, 0);
|
|
((System.ComponentModel.ISupportInitialize)(this.cbQBItems)).EndInit();
|
|
this.ResumeLayout(false);
|
|
this.PerformLayout();
|
|
|
|
}
|
|
#endregion
|
|
|
|
private DataTable _QBItems;
|
|
private string _SelectedItem="";
|
|
|
|
private void SetQBChargeAs_Load(object sender, System.EventArgs e)
|
|
{
|
|
|
|
cbQBItems.ValueMember="ID";
|
|
cbQBItems.DisplayMember="FullName";
|
|
//Case 237
|
|
//cbQBItems.SortStyle = Infragistics.Win.ValueListSortStyle.Ascending;
|
|
this.cbQBItems.DataSource=_QBItems;
|
|
|
|
if (_SelectedItem == "")
|
|
cbQBItems.SelectedIndex = 0;
|
|
else
|
|
|
|
{
|
|
foreach(ValueListItem vi in cbQBItems.Items)
|
|
{
|
|
if((string)vi.DataValue==_SelectedItem)
|
|
{
|
|
cbQBItems.SelectedItem=vi;
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
public DataTable QBItems
|
|
{
|
|
set
|
|
{
|
|
_QBItems=value;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public string SelectedQBItem
|
|
{
|
|
get
|
|
{
|
|
return cbQBItems.SelectedItem.DataValue.ToString();
|
|
}
|
|
set
|
|
{
|
|
_SelectedItem=value;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void btnOK_Click(object sender, EventArgs e)
|
|
{
|
|
base.ClosingHandled=true;
|
|
this.DialogResult=DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
|
|
|
|
|
|
//------------------------------
|
|
}
|
|
}
|
|
|