This commit is contained in:
139
source/Plugins/AyaNova.Plugin.QBI/SetQBInvoiceTemplate.cs
Normal file
139
source/Plugins/AyaNova.Plugin.QBI/SetQBInvoiceTemplate.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
|
||||
namespace AyaNova.PlugIn.QBI
|
||||
{
|
||||
public class SetQBInvoiceTemplate : SetBase
|
||||
{
|
||||
private Infragistics.Win.Misc.UltraLabel lblItems;
|
||||
private Infragistics.Win.UltraWinEditors.UltraComboEditor cbQBItems;
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
public SetQBInvoiceTemplate()
|
||||
{
|
||||
// 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.cbQBItems = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cbQBItems)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblItems
|
||||
//
|
||||
this.lblItems.Location = new System.Drawing.Point(13, 299);
|
||||
this.lblItems.Name = "lblItems";
|
||||
this.lblItems.Size = new System.Drawing.Size(613, 18);
|
||||
this.lblItems.TabIndex = 34;
|
||||
this.lblItems.Text = "QuickBooks Invoice template:";
|
||||
//
|
||||
// cbQBItems
|
||||
//
|
||||
this.cbQBItems.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
|
||||
this.cbQBItems.LimitToList = true;
|
||||
this.cbQBItems.Location = new System.Drawing.Point(13, 317);
|
||||
this.cbQBItems.MaxDropDownItems = 16;
|
||||
this.cbQBItems.Name = "cbQBItems";
|
||||
this.cbQBItems.Nullable = false;
|
||||
this.cbQBItems.Size = new System.Drawing.Size(613, 24);
|
||||
this.cbQBItems.TabIndex = 33;
|
||||
//
|
||||
// SetQBInvoiceTemplate
|
||||
//
|
||||
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 = "SetQBInvoiceTemplate";
|
||||
this.Text = "";
|
||||
this.Load += new System.EventHandler(this.SetQBInvoiceTemplate_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 _QBInvoiceTemplates;
|
||||
|
||||
private void SetQBInvoiceTemplate_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
cbQBItems.ValueMember="ID";
|
||||
cbQBItems.DisplayMember="FullName";
|
||||
this.cbQBItems.DataSource=_QBInvoiceTemplates;
|
||||
//Case 237
|
||||
//cbQBItems.SortStyle=Infragistics.Win.ValueListSortStyle.Ascending;
|
||||
|
||||
if(!string.IsNullOrEmpty(_SelectedTemplate))
|
||||
cbQBItems.Value = _SelectedTemplate;
|
||||
else
|
||||
cbQBItems.SelectedIndex=0;
|
||||
}
|
||||
|
||||
public DataTable QBInvoiceTemplates
|
||||
{
|
||||
set
|
||||
{
|
||||
_QBInvoiceTemplates=value;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
string _SelectedTemplate = "";
|
||||
public string SelectedQBInvoiceTemplate
|
||||
{
|
||||
get
|
||||
{
|
||||
return cbQBItems.SelectedItem.DataValue.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
_SelectedTemplate = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
base.ClosingHandled=true;
|
||||
this.DialogResult=DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
//---------------
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user