Search website

How to add a new tab to Instant Info

Introduction

To add a new tab into a Instant Info would require a programmer to do 2 things. First would be to create a separate .dll file that will contain the UI class for the information to be displayed. The second would be to add some codes to call the UI class in the AutoCount Accounting system.

Creating the UI

The UI class

The following codes is for the UI design and control:

Code Snippet
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. using BCE.AutoCount.XtraUtils.LookupEditBuilder;
  8. using BCE.Data;
  9. using DevExpress.Utils.Menu;
  10. using DevExpress.Utils;
  11. using DevExpress.XtraGrid;
  12. namespace MyAutoCountProject
  13. {
  14.     ///<summary>
  15.     /// Delegate use for Item Code Inquiry.
  16.     ///</summary>
  17.     public delegate void ItemCodeChanged(string itemCode, string uom);
  18.     ///<summary>
  19.     /// Summary description for UCPriceHistory.
  20.     ///</summary>
  21.     public class UCPriceHistory : DevExpress.XtraEditors.XtraUserControl
  22.     {
  23.         private DBSetting myDbSetting;
  24.         private ItemCodeChanged myItemCodeChanged;
  25.         private string myItemCode;
  26.         private string myUom;
  27.         private object myFromDate;
  28.         private object myToDate;
  29.         private bool myShowDebtor;
  30.         private bool myShowCreditor;
  31.         ///<summary>
  32.         /// Determine this is use by InstantInfo or not.
  33.         ///</summary>
  34.         private bool myIsInstantInfo;
  35.         private PriceHistory myPriceHistoryInquiry;
  36.         private BCE.XtraUtils.MouseDownHelper myMouseDownHelper;
  37.         #region Windows Generated Variable
  38.         private DevExpress.XtraGrid.GridControl gctrPriceHistory;
  39.         private DevExpress.XtraGrid.Views.Grid.GridView gvPriceHistory;
  40.         private DevExpress.XtraGrid.Columns.GridColumn colItemCode;
  41.         private DevExpress.XtraGrid.Columns.GridColumn colDocType;
  42.         private DevExpress.XtraGrid.Columns.GridColumn colDocDate;
  43.         private DevExpress.XtraGrid.Columns.GridColumn colDocNo;
  44.         private DevExpress.XtraGrid.Columns.GridColumn colDescription;
  45.         private DevExpress.XtraGrid.Columns.GridColumn colLocation;
  46.         private DevExpress.XtraGrid.Columns.GridColumn colUOM;
  47.         private DevExpress.XtraGrid.Columns.GridColumn colQty;
  48.         private DevExpress.XtraGrid.Columns.GridColumn colUnitPrice;
  49.         private DevExpress.XtraGrid.Columns.GridColumn colDiscount;
  50.         private DevExpress.XtraGrid.Columns.GridColumn colSubTotal;
  51.         private DevExpress.XtraGrid.Columns.GridColumn colDocKey;
  52.         private DevExpress.XtraGrid.Columns.GridColumn colAccNo;
  53.         private DevExpress.XtraGrid.Columns.GridColumn colDeptNo;
  54.         private DevExpress.XtraGrid.Columns.GridColumn colProjNo;
  55.         private DevExpress.XtraGrid.Columns.GridColumn colRate;
  56.         private DevExpress.XtraGrid.Columns.GridColumn colSmallestQty;
  57.         private DevExpress.XtraGrid.Columns.GridColumn colTaxType;
  58.         private DevExpress.XtraGrid.Columns.GridColumn colBranchCode;
  59.         private DevExpress.XtraGrid.Columns.GridColumn colFOCQty;
  60.         private DevExpress.XtraEditors.PanelControl pnAccNo;
  61.         private DevExpress.XtraGrid.Columns.GridColumn colCompanyName;
  62.         private DevExpress.XtraGrid.Columns.GridColumn colFurtherDesc;
  63.         private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1;
  64.         private DevExpress.XtraGrid.Columns.GridColumn colLocalUnitPrice;
  65.         private DevExpress.XtraGrid.Columns.GridColumn colLocalSubTotal;
  66.         private DevExpress.XtraGrid.Columns.GridColumn colCurrencyRate;
  67.         private DevExpress.XtraGrid.Columns.GridColumn colCurrencyCode;
  68.         private DevExpress.XtraEditors.CheckEdit ckEdtShowCreditor;
  69.         private DevExpress.XtraEditors.CheckEdit ckEdtShowDebtor;
  70.         private System.ComponentModel.IContainer components;
  71.         #endregion
  72.         ///<summary>
  73.         /// Use to set ItemCodeChanged Delegate
  74.         ///</summary>
  75.         public ItemCodeChanged SetItemCodeChanged
  76.         {
  77.             set {myItemCodeChanged = value;}
  78.         }
  79.         public UCPriceHistory()
  80.         {
  81.             //
  82.             // Required for Windows Form Designer support
  83.             //
  84.             InitializeComponent();
  85.             gctrPriceHistory.ForceInitialize();
  86.             myIsInstantInfo = false;
  87.             Reset();
  88.             myMouseDownHelper = new BCE.XtraUtils.MouseDownHelper();
  89.             myMouseDownHelper.Init(gvPriceHistory);
  90.             BCE.XtraUtils.GridViewUtils.EnableRightMouseDownAsRowSelect(gvPriceHistory);
  91.             BCE.AutoCount.XtraUtils.FormControlUtil f = new BCE.AutoCount.XtraUtils.FormControlUtil(myDbSetting);
  92.             f.AddField(“DocDate”, BCE.AutoCount.XtraUtils.FormControlUtil.DATE_FIELD);
  93.             f.AddField(“Rate”, BCE.AutoCount.XtraUtils.FormControlUtil.QUANTITY_FIELD);
  94.             f.AddField(“Qty”, BCE.AutoCount.XtraUtils.FormControlUtil.QUANTITY_FIELD);
  95.             f.AddField(“SmallestQty”, BCE.AutoCount.XtraUtils.FormControlUtil.QUANTITY_FIELD);
  96.             f.AddField(“UnitPrice”, BCE.AutoCount.XtraUtils.FormControlUtil.PRICE_FIELD);
  97.             f.AddField(“SubTotal”, BCE.AutoCount.XtraUtils.FormControlUtil.CURRENCY_FIELD);
  98.             f.AddField(“LocalUnitPrice”, BCE.AutoCount.XtraUtils.FormControlUtil.PRICE_FIELD);
  99.             f.AddField(“LocalSubTotal”, BCE.AutoCount.XtraUtils.FormControlUtil.CURRENCY_FIELD);
  100.             f.AddField(“CurrencyRate”, BCE.AutoCount.XtraUtils.FormControlUtil.CURRENCYRATE_FIELD);
  101.             f.InitControls(this);
  102.             LoadSaveSetting();
  103.         }
  104.         private void LoadSaveSetting()
  105.         {
  106.             UCPriceHistorySetting IPHistSetting = null;
  107.             try
  108.             {
  109.                 IPHistSetting = (UCPriceHistorySetting)
  110.                     BCE.AutoCount.PersistenceUtil.LoadUserSetting(“UCPriceHistory.setting”);
  111.             }
  112.             catch{}
  113.             if (IPHistSetting == null)
  114.                 IPHistSetting = new UCPriceHistorySetting();
  115.             myShowDebtor = IPHistSetting.ShowDebtor;
  116.             myShowCreditor = IPHistSetting.ShowCreditor;
  117.             ckEdtShowDebtor.Checked = myShowDebtor;
  118.             ckEdtShowCreditor.Checked = myShowCreditor;
  119.         }
  120.         ///<summary>
  121.         /// Clean up any resources being used.
  122.         ///</summary>
  123.         protected override void Dispose( bool disposing )
  124.         {
  125.             UCPriceHistorySetting IPHistSetting = new UCPriceHistorySetting();
  126.             IPHistSetting.ShowDebtor = ckEdtShowDebtor.Checked;
  127.             IPHistSetting.ShowCreditor = ckEdtShowCreditor.Checked;
  128.             BCE.AutoCount.PersistenceUtil.SaveUserSetting(IPHistSetting, “UCPriceHistory.setting”);
  129.             if( disposing )
  130.             {
  131.                 if (components != null)
  132.                 {
  133.                     components.Dispose();
  134.                 }
  135.             }
  136.             base.Dispose( disposing );
  137.         }
  138.         #region Windows Form Designer generated code
  139.         ///<summary>
  140.         /// Required method for Designer support – do not modify
  141.         /// the contents of this method with the code editor.
  142.         ///</summary>
  143.         private void InitializeComponent()
  144.         {
  145.             this.gctrPriceHistory = new DevExpress.XtraGrid.GridControl();
  146.             this.gvPriceHistory = new DevExpress.XtraGrid.Views.Grid.GridView();
  147.             this.colAccNo = new DevExpress.XtraGrid.Columns.GridColumn();
  148.             this.colCompanyName = new DevExpress.XtraGrid.Columns.GridColumn();
  149.             this.colBranchCode = new DevExpress.XtraGrid.Columns.GridColumn();
  150.             this.colItemCode = new DevExpress.XtraGrid.Columns.GridColumn();
  151.             this.colUOM = new DevExpress.XtraGrid.Columns.GridColumn();
  152.             this.colDocType = new DevExpress.XtraGrid.Columns.GridColumn();
  153.             this.colDocDate = new DevExpress.XtraGrid.Columns.GridColumn();
  154.             this.colDocNo = new DevExpress.XtraGrid.Columns.GridColumn();
  155.             this.colDescription = new DevExpress.XtraGrid.Columns.GridColumn();
  156.             this.colLocation = new DevExpress.XtraGrid.Columns.GridColumn();
  157.             this.colQty = new DevExpress.XtraGrid.Columns.GridColumn();
  158.             this.colUnitPrice = new DevExpress.XtraGrid.Columns.GridColumn();
  159.             this.colLocalUnitPrice = new DevExpress.XtraGrid.Columns.GridColumn();
  160.             this.colDiscount = new DevExpress.XtraGrid.Columns.GridColumn();
  161.             this.colSubTotal = new DevExpress.XtraGrid.Columns.GridColumn();
  162.             this.colLocalSubTotal = new DevExpress.XtraGrid.Columns.GridColumn();
  163.             this.colDocKey = new DevExpress.XtraGrid.Columns.GridColumn();
  164.             this.colProjNo = new DevExpress.XtraGrid.Columns.GridColumn();
  165.             this.colDeptNo = new DevExpress.XtraGrid.Columns.GridColumn();
  166.             this.colRate = new DevExpress.XtraGrid.Columns.GridColumn();
  167.             this.colSmallestQty = new DevExpress.XtraGrid.Columns.GridColumn();
  168.             this.colTaxType = new DevExpress.XtraGrid.Columns.GridColumn();
  169.             this.colFOCQty = new DevExpress.XtraGrid.Columns.GridColumn();
  170.             this.colFurtherDesc = new DevExpress.XtraGrid.Columns.GridColumn();
  171.             this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
  172.             this.colCurrencyRate = new DevExpress.XtraGrid.Columns.GridColumn();
  173.             this.colCurrencyCode = new DevExpress.XtraGrid.Columns.GridColumn();
  174.             this.pnAccNo = new DevExpress.XtraEditors.PanelControl();
  175.             this.ckEdtShowCreditor = new DevExpress.XtraEditors.CheckEdit();
  176.             this.ckEdtShowDebtor = new DevExpress.XtraEditors.CheckEdit();
  177.             ((System.ComponentModel.ISupportInitialize)(this.gctrPriceHistory)).BeginInit();
  178.             ((System.ComponentModel.ISupportInitialize)(this.gvPriceHistory)).BeginInit();
  179.             ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).BeginInit();
  180.             ((System.ComponentModel.ISupportInitialize)(this.pnAccNo)).BeginInit();
  181.             this.pnAccNo.SuspendLayout();
  182.             ((System.ComponentModel.ISupportInitialize)(this.ckEdtShowCreditor.Properties)).BeginInit();
  183.             ((System.ComponentModel.ISupportInitialize)(this.ckEdtShowDebtor.Properties)).BeginInit();
  184.             this.SuspendLayout();
  185.             //
  186.             // gctrPriceHistory
  187.             //
  188.             this.gctrPriceHistory.Dock = System.Windows.Forms.DockStyle.Fill;
  189.             this.gctrPriceHistory.EmbeddedNavigator.Buttons.Append.Visible = false;
  190.             this.gctrPriceHistory.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
  191.             this.gctrPriceHistory.EmbeddedNavigator.Buttons.Edit.Visible = false;
  192.             this.gctrPriceHistory.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
  193.             this.gctrPriceHistory.EmbeddedNavigator.Buttons.Remove.Visible = false;
  194.             this.gctrPriceHistory.EmbeddedNavigator.Name = “”;
  195.             this.gctrPriceHistory.Location = new System.Drawing.Point(0, 24);
  196.             this.gctrPriceHistory.MainView = this.gvPriceHistory;
  197.             this.gctrPriceHistory.Name = “gctrPriceHistory”;
  198.             this.gctrPriceHistory.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
  199.             this.repositoryItemButtonEdit1});
  200.             this.gctrPriceHistory.Size = new System.Drawing.Size(700, 176);
  201.             this.gctrPriceHistory.TabIndex = 2;
  202.             this.gctrPriceHistory.UseEmbeddedNavigator = true;
  203.             this.gctrPriceHistory.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
  204.             this.gvPriceHistory});
  205.             //
  206.             // gvPriceHistory
  207.             //
  208.             this.gvPriceHistory.Appearance.ColumnFilterButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(221)))), ((int)(((byte)(208)))));
  209.             this.gvPriceHistory.Appearance.ColumnFilterButton.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(221)))), ((int)(((byte)(208)))));
  210.             this.gvPriceHistory.Appearance.ColumnFilterButton.ForeColor = System.Drawing.Color.Black;
  211.             this.gvPriceHistory.Appearance.ColumnFilterButton.Options.UseBackColor = true;
  212.             this.gvPriceHistory.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
  213.             this.gvPriceHistory.Appearance.ColumnFilterButton.Options.UseForeColor = true;
  214.             this.gvPriceHistory.Appearance.ColumnFilterButtonActive.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(226)))), ((int)(((byte)(216)))));
  215.             this.gvPriceHistory.Appearance.ColumnFilterButtonActive.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(226)))), ((int)(((byte)(216)))));
  216.             this.gvPriceHistory.Appearance.ColumnFilterButtonActive.ForeColor = System.Drawing.Color.Black;
  217.             this.gvPriceHistory.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
  218.             this.gvPriceHistory.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
  219.             this.gvPriceHistory.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true;
  220.             this.gvPriceHistory.Appearance.Empty.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
  221.             this.gvPriceHistory.Appearance.Empty.BackColor2 = System.Drawing.Color.White;
  222.             this.gvPriceHistory.Appearance.Empty.Options.UseBackColor = true;
  223.             this.gvPriceHistory.Appearance.EvenRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(227)))), ((int)(((byte)(245)))));
  224.             this.gvPriceHistory.Appearance.EvenRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(227)))), ((int)(((byte)(245)))));
  225.             this.gvPriceHistory.Appearance.EvenRow.ForeColor = System.Drawing.Color.Black;
  226.             this.gvPriceHistory.Appearance.EvenRow.Options.UseBackColor = true;
  227.             this.gvPriceHistory.Appearance.EvenRow.Options.UseBorderColor = true;
  228.             this.gvPriceHistory.Appearance.EvenRow.Options.UseForeColor = true;
  229.             this.gvPriceHistory.Appearance.FilterCloseButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(221)))), ((int)(((byte)(208)))));
  230.             this.gvPriceHistory.Appearance.FilterCloseButton.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(221)))), ((int)(((byte)(208)))));
  231.             this.gvPriceHistory.Appearance.FilterCloseButton.ForeColor = System.Drawing.Color.Black;
  232.             this.gvPriceHistory.Appearance.FilterCloseButton.Options.UseBackColor = true;
  233.             this.gvPriceHistory.Appearance.FilterCloseButton.Options.UseBorderColor = true;
  234.             this.gvPriceHistory.Appearance.FilterCloseButton.Options.UseForeColor = true;
  235.             this.gvPriceHistory.Appearance.FilterPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
  236.             this.gvPriceHistory.Appearance.FilterPanel.BackColor2 = System.Drawing.Color.White;
  237.             this.gvPriceHistory.Appearance.FilterPanel.ForeColor = System.Drawing.Color.Black;
  238.             this.gvPriceHistory.Appearance.FilterPanel.Options.UseBackColor = true;
  239.             this.gvPriceHistory.Appearance.FilterPanel.Options.UseForeColor = true;
  240.             this.gvPriceHistory.Appearance.FixedLine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(117)))), ((int)(((byte)(136)))), ((int)(((byte)(122)))));
  241.             this.gvPriceHistory.Appearance.FixedLine.Options.UseBackColor = true;
  242.             this.gvPriceHistory.Appearance.FocusedCell.BackColor = System.Drawing.Color.White;
  243.             this.gvPriceHistory.Appearance.FocusedCell.ForeColor = System.Drawing.Color.Black;
  244.             this.gvPriceHistory.Appearance.FocusedCell.Options.UseBackColor = true;
  245.             this.gvPriceHistory.Appearance.FocusedCell.Options.UseForeColor = true;
  246.             this.gvPriceHistory.Appearance.FocusedRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(129)))), ((int)(((byte)(171)))), ((int)(((byte)(177)))));
  247.             this.gvPriceHistory.Appearance.FocusedRow.ForeColor = System.Drawing.Color.White;
  248.             this.gvPriceHistory.Appearance.FocusedRow.Options.UseBackColor = true;
  249.             this.gvPriceHistory.Appearance.FocusedRow.Options.UseForeColor = true;
  250.             this.gvPriceHistory.Appearance.FooterPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(221)))), ((int)(((byte)(208)))));
  251.             this.gvPriceHistory.Appearance.FooterPanel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(221)))), ((int)(((byte)(208)))));
  252.             this.gvPriceHistory.Appearance.FooterPanel.ForeColor = System.Drawing.Color.Black;
  253.             this.gvPriceHistory.Appearance.FooterPanel.Options.UseBackColor = true;
  254.             this.gvPriceHistory.Appearance.FooterPanel.Options.UseBorderColor = true;
  255.             this.gvPriceHistory.Appearance.FooterPanel.Options.UseForeColor = true;
  256.             this.gvPriceHistory.Appearance.GroupButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(178)))), ((int)(((byte)(209)))), ((int)(((byte)(188)))));
  257.             this.gvPriceHistory.Appearance.GroupButton.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(178)))), ((int)(((byte)(209)))), ((int)(((byte)(188)))));
  258.             this.gvPriceHistory.Appearance.GroupButton.Options.UseBackColor = true;
  259.             this.gvPriceHistory.Appearance.GroupButton.Options.UseBorderColor = true;
  260.             this.gvPriceHistory.Appearance.GroupFooter.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(234)))), ((int)(((byte)(221)))));
  261.             this.gvPriceHistory.Appearance.GroupFooter.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(234)))), ((int)(((byte)(221)))));
  262.             this.gvPriceHistory.Appearance.GroupFooter.ForeColor = System.Drawing.Color.Black;
  263.             this.gvPriceHistory.Appearance.GroupFooter.Options.UseBackColor = true;
  264.             this.gvPriceHistory.Appearance.GroupFooter.Options.UseBorderColor = true;
  265.             this.gvPriceHistory.Appearance.GroupFooter.Options.UseForeColor = true;
  266.             this.gvPriceHistory.Appearance.GroupPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
  267.             this.gvPriceHistory.Appearance.GroupPanel.BackColor2 = System.Drawing.Color.White;
  268.             this.gvPriceHistory.Appearance.GroupPanel.ForeColor = System.Drawing.Color.Black;
  269.             this.gvPriceHistory.Appearance.GroupPanel.Options.UseBackColor = true;
  270.             this.gvPriceHistory.Appearance.GroupPanel.Options.UseForeColor = true;
  271.             this.gvPriceHistory.Appearance.GroupRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(234)))), ((int)(((byte)(221)))));
  272.             this.gvPriceHistory.Appearance.GroupRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(234)))), ((int)(((byte)(221)))));
  273.             this.gvPriceHistory.Appearance.GroupRow.ForeColor = System.Drawing.Color.Black;
  274.             this.gvPriceHistory.Appearance.GroupRow.Options.UseBackColor = true;
  275.             this.gvPriceHistory.Appearance.GroupRow.Options.UseBorderColor = true;
  276.             this.gvPriceHistory.Appearance.GroupRow.Options.UseForeColor = true;
  277.             this.gvPriceHistory.Appearance.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(226)))), ((int)(((byte)(216)))));
  278.             this.gvPriceHistory.Appearance.HeaderPanel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(226)))), ((int)(((byte)(216)))));
  279.             this.gvPriceHistory.Appearance.HeaderPanel.ForeColor = System.Drawing.Color.Black;
  280.             this.gvPriceHistory.Appearance.HeaderPanel.Options.UseBackColor = true;
  281.             this.gvPriceHistory.Appearance.HeaderPanel.Options.UseBorderColor = true;
  282.             this.gvPriceHistory.Appearance.HeaderPanel.Options.UseForeColor = true;
  283.             this.gvPriceHistory.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(186)))), ((int)(((byte)(211)))), ((int)(((byte)(215)))));
  284.             this.gvPriceHistory.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(130)))), ((int)(((byte)(134)))));
  285.             this.gvPriceHistory.Appearance.HideSelectionRow.Options.UseBackColor = true;
  286.             this.gvPriceHistory.Appearance.HideSelectionRow.Options.UseForeColor = true;
  287.             this.gvPriceHistory.Appearance.HorzLine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(172)))), ((int)(((byte)(197)))), ((int)(((byte)(180)))));
  288.             this.gvPriceHistory.Appearance.HorzLine.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(117)))), ((int)(((byte)(136)))), ((int)(((byte)(122)))));
  289.             this.gvPriceHistory.Appearance.HorzLine.Options.UseBackColor = true;
  290.             this.gvPriceHistory.Appearance.HorzLine.Options.UseBorderColor = true;
  291.             this.gvPriceHistory.Appearance.OddRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
  292.             this.gvPriceHistory.Appearance.OddRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
  293.             this.gvPriceHistory.Appearance.OddRow.ForeColor = System.Drawing.Color.Black;
  294.             this.gvPriceHistory.Appearance.OddRow.Options.UseBackColor = true;
  295.             this.gvPriceHistory.Appearance.OddRow.Options.UseBorderColor = true;
  296.             this.gvPriceHistory.Appearance.OddRow.Options.UseForeColor = true;
  297.             this.gvPriceHistory.Appearance.Preview.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(240)))));
  298.             this.gvPriceHistory.Appearance.Preview.Font = new System.Drawing.Font(“Verdana”, 7.5F);
  299.             this.gvPriceHistory.Appearance.Preview.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(130)))), ((int)(((byte)(134)))));
  300.             this.gvPriceHistory.Appearance.Preview.Options.UseBackColor = true;
  301.             this.gvPriceHistory.Appearance.Preview.Options.UseFont = true;
  302.             this.gvPriceHistory.Appearance.Preview.Options.UseForeColor = true;
  303.             this.gvPriceHistory.Appearance.Row.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
  304.             this.gvPriceHistory.Appearance.Row.ForeColor = System.Drawing.Color.Black;
  305.             this.gvPriceHistory.Appearance.Row.Options.UseBackColor = true;
  306.             this.gvPriceHistory.Appearance.Row.Options.UseForeColor = true;
  307.             this.gvPriceHistory.Appearance.RowSeparator.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
  308.             this.gvPriceHistory.Appearance.RowSeparator.BackColor2 = System.Drawing.Color.White;
  309.             this.gvPriceHistory.Appearance.RowSeparator.Options.UseBackColor = true;
  310.             this.gvPriceHistory.Appearance.SelectedRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(201)))), ((int)(((byte)(207)))));
  311.             this.gvPriceHistory.Appearance.SelectedRow.ForeColor = System.Drawing.Color.Black;
  312.             this.gvPriceHistory.Appearance.SelectedRow.Options.UseBackColor = true;
  313.             this.gvPriceHistory.Appearance.SelectedRow.Options.UseForeColor = true;
  314.             this.gvPriceHistory.Appearance.TopNewRow.BackColor = System.Drawing.Color.White;
  315.             this.gvPriceHistory.Appearance.TopNewRow.Options.UseBackColor = true;
  316.             this.gvPriceHistory.Appearance.VertLine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(172)))), ((int)(((byte)(197)))), ((int)(((byte)(180)))));
  317.             this.gvPriceHistory.Appearance.VertLine.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(117)))), ((int)(((byte)(136)))), ((int)(((byte)(122)))));
  318.             this.gvPriceHistory.Appearance.VertLine.Options.UseBackColor = true;
  319.             this.gvPriceHistory.Appearance.VertLine.Options.UseBorderColor = true;
  320.             this.gvPriceHistory.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
  321.             this.colAccNo,
  322.             this.colCompanyName,
  323.             this.colBranchCode,
  324.             this.colItemCode,
  325.             this.colUOM,
  326.             this.colDocType,
  327.             this.colDocDate,
  328.             this.colDocNo,
  329.             this.colDescription,
  330.             this.colLocation,
  331.             this.colQty,
  332.             this.colUnitPrice,
  333.             this.colLocalUnitPrice,
  334.             this.colDiscount,
  335.             this.colSubTotal,
  336.             this.colLocalSubTotal,
  337.             this.colDocKey,
  338.             this.colProjNo,
  339.             this.colDeptNo,
  340.             this.colRate,
  341.             this.colSmallestQty,
  342.             this.colTaxType,
  343.             this.colFOCQty,
  344.             this.colFurtherDesc,
  345.             this.colCurrencyRate,
  346.             this.colCurrencyCode});
  347.             this.gvPriceHistory.GridControl = this.gctrPriceHistory;
  348.             this.gvPriceHistory.Name = “gvPriceHistory”;
  349.             this.gvPriceHistory.OptionsBehavior.AllowIncrementalSearch = true;
  350.             this.gvPriceHistory.OptionsView.EnableAppearanceEvenRow = true;
  351.             this.gvPriceHistory.OptionsView.EnableAppearanceOddRow = true;
  352.             this.gvPriceHistory.OptionsView.ShowGroupPanel = false;
  353.             this.gvPriceHistory.SortInfo.AddRange(new DevExpress.XtraGrid.Columns.GridColumnSortInfo[] {
  354.             new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.colDocDate, DevExpress.Data.ColumnSortOrder.Descending)});
  355.             this.gvPriceHistory.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.gvPriceHistory_FocusedRowChanged);
  356.             this.gvPriceHistory.DoubleClick += new System.EventHandler(this.gvPriceHistory_DoubleClick);
  357.             this.gvPriceHistory.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(this.gvPriceHistory_CustomDrawCell);
  358.             //
  359.             // colAccNo
  360.             //
  361.             this.colAccNo.Caption = “Acc. No.”;
  362.             this.colAccNo.FieldName = “AccNo”;
  363.             this.colAccNo.Name = “colAccNo”;
  364.             this.colAccNo.OptionsColumn.AllowEdit = false;
  365.             this.colAccNo.OptionsColumn.ReadOnly = true;
  366.             this.colAccNo.Visible = true;
  367.             this.colAccNo.VisibleIndex = 0;
  368.             this.colAccNo.Width = 47;
  369.             //
  370.             // colCompanyName
  371.             //
  372.             this.colCompanyName.Caption = “Company Name”;
  373.             this.colCompanyName.FieldName = “CompanyName”;
  374.             this.colCompanyName.Name = “colCompanyName”;
  375.             this.colCompanyName.OptionsColumn.AllowEdit = false;
  376.             this.colCompanyName.OptionsColumn.ReadOnly = true;
  377.             this.colCompanyName.Visible = true;
  378.             this.colCompanyName.VisibleIndex = 1;
  379.             //
  380.             // colBranchCode
  381.             //
  382.             this.colBranchCode.Caption = “Branch Code”;
  383.             this.colBranchCode.FieldName = “BranchCode”;
  384.             this.colBranchCode.Name = “colBranchCode”;
  385.             this.colBranchCode.OptionsColumn.AllowEdit = false;
  386.             this.colBranchCode.OptionsColumn.ReadOnly = true;
  387.             this.colBranchCode.Visible = true;
  388.             this.colBranchCode.VisibleIndex = 2;
  389.             this.colBranchCode.Width = 51;
  390.             //
  391.             // colItemCode
  392.             //
  393.             this.colItemCode.Caption = “Item Code”;
  394.             this.colItemCode.FieldName = “ItemCode”;
  395.             this.colItemCode.Name = “colItemCode”;
  396.             this.colItemCode.OptionsColumn.AllowEdit = false;
  397.             this.colItemCode.OptionsColumn.ReadOnly = true;
  398.             this.colItemCode.OptionsFilter.AllowFilter = false;
  399.             this.colItemCode.Visible = true;
  400.             this.colItemCode.VisibleIndex = 3;
  401.             this.colItemCode.Width = 56;
  402.             //
  403.             // colUOM
  404.             //
  405.             this.colUOM.Caption = “UOM”;
  406.             this.colUOM.FieldName = “UOM”;
  407.             this.colUOM.Name = “colUOM”;
  408.             this.colUOM.OptionsColumn.AllowEdit = false;
  409.             this.colUOM.OptionsColumn.ReadOnly = true;
  410.             this.colUOM.Visible = true;
  411.             this.colUOM.VisibleIndex = 4;
  412.             this.colUOM.Width = 25;
  413.             //
  414.             // colDocType
  415.             //
  416.             this.colDocType.Caption = “T”;
  417.             this.colDocType.FieldName = “DocType”;
  418.             this.colDocType.Name = “colDocType”;
  419.             this.colDocType.OptionsColumn.AllowEdit = false;
  420.             this.colDocType.OptionsColumn.ReadOnly = true;
  421.             this.colDocType.Visible = true;
  422.             this.colDocType.VisibleIndex = 5;
  423.             this.colDocType.Width = 23;
  424.             //
  425.             // colDocDate
  426.             //
  427.             this.colDocDate.Caption = “Date”;
  428.             this.colDocDate.FieldName = “DocDate”;
  429.             this.colDocDate.Name = “colDocDate”;
  430.             this.colDocDate.OptionsColumn.AllowEdit = false;
  431.             this.colDocDate.OptionsColumn.ReadOnly = true;
  432.             this.colDocDate.Visible = true;
  433.             this.colDocDate.VisibleIndex = 6;
  434.             this.colDocDate.Width = 44;
  435.             //
  436.             // colDocNo
  437.             //
  438.             this.colDocNo.Caption = “Doc. No”;
  439.             this.colDocNo.FieldName = “DocNo”;
  440.             this.colDocNo.Name = “colDocNo”;
  441.             this.colDocNo.OptionsColumn.AllowEdit = false;
  442.             this.colDocNo.OptionsColumn.ReadOnly = true;
  443.             this.colDocNo.Visible = true;
  444.             this.colDocNo.VisibleIndex = 7;
  445.             this.colDocNo.Width = 41;
  446.             //
  447.             // colDescription
  448.             //
  449.             this.colDescription.Caption = “Description”;
  450.             this.colDescription.FieldName = “Description”;
  451.             this.colDescription.Name = “colDescription”;
  452.             this.colDescription.OptionsColumn.AllowEdit = false;
  453.             this.colDescription.OptionsColumn.ReadOnly = true;
  454.             this.colDescription.Visible = true;
  455.             this.colDescription.VisibleIndex = 8;
  456.             this.colDescription.Width = 123;
  457.             //
  458.             // colLocation
  459.             //
  460.             this.colLocation.Caption = “Location”;
  461.             this.colLocation.FieldName = “Location”;
  462.             this.colLocation.Name = “colLocation”;
  463.             this.colLocation.OptionsColumn.AllowEdit = false;
  464.             this.colLocation.OptionsColumn.ReadOnly = true;
  465.             this.colLocation.Visible = true;
  466.             this.colLocation.VisibleIndex = 9;
  467.             this.colLocation.Width = 30;
  468.             //
  469.             // colQty
  470.             //
  471.             this.colQty.Caption = “Qty”;
  472.             this.colQty.FieldName = “Qty”;
  473.             this.colQty.Name = “colQty”;
  474.             this.colQty.OptionsColumn.AllowEdit = false;
  475.             this.colQty.OptionsColumn.ReadOnly = true;
  476.             this.colQty.Visible = true;
  477.             this.colQty.VisibleIndex = 10;
  478.             this.colQty.Width = 29;
  479.             //
  480.             // colUnitPrice
  481.             //
  482.             this.colUnitPrice.Caption = “Unit Price”;
  483.             this.colUnitPrice.FieldName = “UnitPrice”;
  484.             this.colUnitPrice.Name = “colUnitPrice”;
  485.             this.colUnitPrice.OptionsColumn.AllowEdit = false;
  486.             this.colUnitPrice.OptionsColumn.ReadOnly = true;
  487.             this.colUnitPrice.Visible = true;
  488.             this.colUnitPrice.VisibleIndex = 11;
  489.             this.colUnitPrice.Width = 34;
  490.             //
  491.             // colLocalUnitPrice
  492.             //
  493.             this.colLocalUnitPrice.Caption = “Local Unit Price”;
  494.             this.colLocalUnitPrice.FieldName = “LocalUnitPrice”;
  495.             this.colLocalUnitPrice.Name = “colLocalUnitPrice”;
  496.             this.colLocalUnitPrice.OptionsColumn.AllowEdit = false;
  497.             this.colLocalUnitPrice.OptionsColumn.ReadOnly = true;
  498.             //
  499.             // colDiscount
  500.             //
  501.             this.colDiscount.Caption = “Discount”;
  502.             this.colDiscount.FieldName = “Discount”;
  503.             this.colDiscount.Name = “colDiscount”;
  504.             this.colDiscount.OptionsColumn.AllowEdit = false;
  505.             this.colDiscount.OptionsColumn.ReadOnly = true;
  506.             this.colDiscount.Visible = true;
  507.             this.colDiscount.VisibleIndex = 12;
  508.             this.colDiscount.Width = 39;
  509.             //
  510.             // colSubTotal
  511.             //
  512.             this.colSubTotal.Caption = “SubTotal”;
  513.             this.colSubTotal.FieldName = “SubTotal”;
  514.             this.colSubTotal.Name = “colSubTotal”;
  515.             this.colSubTotal.OptionsColumn.AllowEdit = false;
  516.             this.colSubTotal.OptionsColumn.ReadOnly = true;
  517.             this.colSubTotal.Visible = true;
  518.             this.colSubTotal.VisibleIndex = 13;
  519.             this.colSubTotal.Width = 44;
  520.             //
  521.             // colLocalSubTotal
  522.             //
  523.             this.colLocalSubTotal.Caption = “Local SubTotal”;
  524.             this.colLocalSubTotal.FieldName = “LocalSubTotal”;
  525.             this.colLocalSubTotal.Name = “colLocalSubTotal”;
  526.             this.colLocalSubTotal.OptionsColumn.AllowEdit = false;
  527.             this.colLocalSubTotal.OptionsColumn.ReadOnly = true;
  528.             //
  529.             // colDocKey
  530.             //
  531.             this.colDocKey.Caption = “DocKey”;
  532.             this.colDocKey.FieldName = “DocKey”;
  533.             this.colDocKey.Name = “colDocKey”;
  534.             this.colDocKey.OptionsColumn.AllowEdit = false;
  535.             this.colDocKey.OptionsColumn.ReadOnly = true;
  536.             this.colDocKey.OptionsFilter.AllowFilter = false;
  537.             this.colDocKey.Width = 49;
  538.             //
  539.             // colProjNo
  540.             //
  541.             this.colProjNo.Caption = “Proj. No”;
  542.             this.colProjNo.FieldName = “ProjNo”;
  543.             this.colProjNo.Name = “colProjNo”;
  544.             this.colProjNo.OptionsColumn.AllowEdit = false;
  545.             this.colProjNo.OptionsColumn.ReadOnly = true;
  546.             this.colProjNo.Width = 50;
  547.             //
  548.             // colDeptNo
  549.             //
  550.             this.colDeptNo.Caption = “Dept. No”;
  551.             this.colDeptNo.FieldName = “DeptNo”;
  552.             this.colDeptNo.Name = “colDeptNo”;
  553.             this.colDeptNo.OptionsColumn.AllowEdit = false;
  554.             this.colDeptNo.OptionsColumn.ReadOnly = true;
  555.             this.colDeptNo.Width = 54;
  556.             //
  557.             // colRate
  558.             //
  559.             this.colRate.Caption = “Rate”;
  560.             this.colRate.FieldName = “Rate”;
  561.             this.colRate.Name = “colRate”;
  562.             this.colRate.OptionsColumn.AllowEdit = false;
  563.             this.colRate.OptionsColumn.ReadOnly = true;
  564.             this.colRate.Width = 33;
  565.             //
  566.             // colSmallestQty
  567.             //
  568.             this.colSmallestQty.Caption = “Smallest Qty”;
  569.             this.colSmallestQty.FieldName = “SmallestQty”;
  570.             this.colSmallestQty.Name = “colSmallestQty”;
  571.             this.colSmallestQty.OptionsColumn.AllowEdit = false;
  572.             this.colSmallestQty.OptionsColumn.ReadOnly = true;
  573.             this.colSmallestQty.Width = 73;
  574.             //
  575.             // colTaxType
  576.             //
  577.             this.colTaxType.Caption = “Tax Type”;
  578.             this.colTaxType.FieldName = “TaxType”;
  579.             this.colTaxType.Name = “colTaxType”;
  580.             this.colTaxType.OptionsColumn.AllowEdit = false;
  581.             this.colTaxType.OptionsColumn.ReadOnly = true;
  582.             this.colTaxType.Width = 56;
  583.             //
  584.             // colFOCQty
  585.             //
  586.             this.colFOCQty.Caption = “FOC Qty”;
  587.             this.colFOCQty.FieldName = “FOCQty”;
  588.             this.colFOCQty.Name = “colFOCQty”;
  589.             this.colFOCQty.OptionsColumn.AllowEdit = false;
  590.             this.colFOCQty.OptionsColumn.ReadOnly = true;
  591.             //
  592.             // colFurtherDesc
  593.             //
  594.             this.colFurtherDesc.Caption = “Further Description”;
  595.             this.colFurtherDesc.ColumnEdit = this.repositoryItemButtonEdit1;
  596.             this.colFurtherDesc.FieldName = “FurtherDescription”;
  597.             this.colFurtherDesc.Name = “colFurtherDesc”;
  598.             this.colFurtherDesc.Width = 30;
  599.             //
  600.             // repositoryItemButtonEdit1
  601.             //
  602.             this.repositoryItemButtonEdit1.AutoHeight = false;
  603.             this.repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
  604.             new DevExpress.XtraEditors.Controls.EditorButton()});
  605.             this.repositoryItemButtonEdit1.Name = “repositoryItemButtonEdit1″;
  606.             this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
  607.             this.repositoryItemButtonEdit1.ButtonPressed += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.repositoryItemButtonEdit1_ButtonClick);
  608.             //
  609.             // colCurrencyRate
  610.             //
  611.             this.colCurrencyRate.Caption = “Currency Rate”;
  612.             this.colCurrencyRate.FieldName = “CurrencyRate”;
  613.             this.colCurrencyRate.Name = “colCurrencyRate”;
  614.             this.colCurrencyRate.OptionsColumn.AllowEdit = false;
  615.             this.colCurrencyRate.OptionsColumn.ReadOnly = true;
  616.             this.colCurrencyRate.Width = 35;
  617.             //
  618.             // colCurrencyCode
  619.             //
  620.             this.colCurrencyCode.Caption = “Currency Code”;
  621.             this.colCurrencyCode.FieldName = “CurrencyCode”;
  622.             this.colCurrencyCode.Name = “colCurrencyCode”;
  623.             this.colCurrencyCode.OptionsColumn.AllowEdit = false;
  624.             this.colCurrencyCode.OptionsColumn.ReadOnly = true;
  625.             this.colCurrencyCode.Width = 35;
  626.             //
  627.             // pnAccNo
  628.             //
  629.             this.pnAccNo.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
  630.             this.pnAccNo.Controls.Add(this.ckEdtShowCreditor);
  631.             this.pnAccNo.Controls.Add(this.ckEdtShowDebtor);
  632.             this.pnAccNo.Dock = System.Windows.Forms.DockStyle.Top;
  633.             this.pnAccNo.Location = new System.Drawing.Point(0, 0);
  634.             this.pnAccNo.Name = “pnAccNo”;
  635.             this.pnAccNo.Size = new System.Drawing.Size(700, 24);
  636.             this.pnAccNo.TabIndex = 0;
  637.             //
  638.             // ckEdtShowCreditor
  639.             //
  640.             this.ckEdtShowCreditor.EditValue = true;
  641.             this.ckEdtShowCreditor.Location = new System.Drawing.Point(105, 3);
  642.             this.ckEdtShowCreditor.Name = “ckEdtShowCreditor”;
  643.             this.ckEdtShowCreditor.Properties.Caption = “Show Creditor”;
  644.             this.ckEdtShowCreditor.Size = new System.Drawing.Size(93, 19);
  645.             this.ckEdtShowCreditor.TabIndex = 6;
  646.             this.ckEdtShowCreditor.CheckedChanged += new System.EventHandler(this.ckEdtShowCreditor_CheckedChanged);
  647.             //
  648.             // ckEdtShowDebtor
  649.             //
  650.             this.ckEdtShowDebtor.EditValue = true;
  651.             this.ckEdtShowDebtor.Location = new System.Drawing.Point(3, 3);
  652.             this.ckEdtShowDebtor.Name = “ckEdtShowDebtor”;
  653.             this.ckEdtShowDebtor.Properties.Caption = “Show Debtor”;
  654.             this.ckEdtShowDebtor.Size = new System.Drawing.Size(87, 19);
  655.             this.ckEdtShowDebtor.TabIndex = 5;
  656.             this.ckEdtShowDebtor.CheckedChanged += new System.EventHandler(this.ckEdtShowDebtor_CheckedChanged);
  657.             //
  658.             // UCPriceHistory
  659.             //
  660.             this.Controls.Add(this.gctrPriceHistory);
  661.             this.Controls.Add(this.pnAccNo);
  662.             this.Name = “UCPriceHistory”;
  663.             this.Size = new System.Drawing.Size(700, 200);
  664.             ((System.ComponentModel.ISupportInitialize)(this.gctrPriceHistory)).EndInit();
  665.             ((System.ComponentModel.ISupportInitialize)(this.gvPriceHistory)).EndInit();
  666.             ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).EndInit();
  667.             ((System.ComponentModel.ISupportInitialize)(this.pnAccNo)).EndInit();
  668.             this.pnAccNo.ResumeLayout(false);
  669.             ((System.ComponentModel.ISupportInitialize)(this.ckEdtShowCreditor.Properties)).EndInit();
  670.             ((System.ComponentModel.ISupportInitialize)(this.ckEdtShowDebtor.Properties)).EndInit();
  671.             this.ResumeLayout(false);
  672.         }
  673.         #endregion
  674.         ///<summary>
  675.         /// Must be call before use PriceHistory for Instant Info
  676.         ///</summary>
  677.         ///<param name=”dbSetting”></param>
  678.         ///<param name=”itemCode”></param>
  679.         ///<param name=”accNo”></param>
  680.         ///<param name=”branchCode”></param>
  681.         public void Initialize(DBSetting dbSetting, string itemCode)
  682.         {
  683.             myIsInstantInfo = true;
  684.             Initialize(dbSetting, itemCode, “”, null, null);
  685.         }
  686.         ///<summary>
  687.         /// Call by Item Inquiry
  688.         ///</summary>
  689.         ///<param name=”dbSetting”></param>
  690.         ///<param name=”itemCode”></param>
  691.         ///<param name=”accNo”></param>
  692.         ///<param name=”branchCode”></param>
  693.         ///<param name=”uom”></param>
  694.         public void Initialize(DBSetting dbSetting, string itemCode, string uom)
  695.         {
  696.             Initialize(dbSetting, itemCode, uom, null, null);
  697.         }
  698.         ///<summary>
  699.         /// Must be call before can use PriceHistory for Stock Inquiry Use
  700.         ///</summary>
  701.         ///<param name=”dbSetting”></param>
  702.         ///<param name=”itemCode”></param>
  703.         ///<param name=”accNo”></param>
  704.         ///<param name=”branchCode”></param>
  705.         ///<param name=”uom”>if uom length is 0, then it is from Stock Inquiry not Instant Info</param>
  706.         ///<param name=”fromDate”></param>
  707.         ///<param name=”toDate”></param>
  708.         public void Initialize(DBSetting dbSetting, string itemCode, string uom, object fromDate,
  709.             object toDate)
  710.         {
  711.             myDbSetting = dbSetting;
  712.             new BCE.AutoCount.XtraUtils.CustomizeGridLayout(myDbSetting, this.Name, gvPriceHistory,
  713.                 new System.EventHandler(this.ReloadAllColumns));
  714.             myPriceHistoryInquiry = PriceHistory.Create(dbSetting);
  715.             Reload(itemCode, uom, fromDate, toDate);
  716.             if (myIsInstantInfo)
  717.             {
  718.                 colAccNo.Visible = false;
  719.                 colCompanyName.Visible = false;
  720.             }
  721.             ColumnVisibility();
  722.         }
  723.         public bool IsInitialize
  724.         {
  725.             get { return myPriceHistoryInquiry != null; }
  726.         }
  727.         public void SetFilterToBlank()
  728.         {
  729.             myItemCode = string.Empty;
  730.         }
  731.         public void Reload(string itemCode)
  732.         {
  733.             Reload(itemCode, “”, null, null);
  734.         }
  735.         public void Reload(string itemCode, string uom)
  736.         {
  737.             Reload(itemCode, uom, null, null);
  738.         }
  739.         public void Reload(string itemCode, string uom, object fromDate, object toDate)
  740.         {
  741.             if (!IsInitialize)
  742.                 return;
  743.             if (itemCode.Length == 0 && uom.Length == 0)
  744.             {
  745.                 Reset();
  746.                 gctrPriceHistory.DataSource = null;
  747.                 return;
  748.             }
  749.             if ((itemCode == myItemCode) && (uom == myUom) && (myShowDebtor == ckEdtShowDebtor.Checked) && (myShowCreditor == ckEdtShowCreditor.Checked))
  750.             {
  751.                 bool changed = false;
  752.                 if ((fromDate == null && myFromDate != null) || (fromDate != null && myFromDate == null))
  753.                     changed = true;
  754.                 if ((toDate == null && myToDate != null) || (toDate != null && myToDate == null))
  755.                     changed = true;
  756.                 if (!changed)
  757.                 {
  758.                     if (fromDate == null && myFromDate == null && toDate == null && myToDate == null)
  759.                         return;
  760.                     if (fromDate.Equals(myFromDate) && toDate.Equals(myToDate))
  761.                         return;
  762.                 }
  763.             }
  764.             myItemCode = itemCode;
  765.             myUom = uom;
  766.             myFromDate = fromDate;
  767.             myToDate = toDate;
  768.             myShowDebtor = ckEdtShowDebtor.Checked;
  769.             myShowCreditor = ckEdtShowCreditor.Checked;
  770.             string[] excludeColumns = {“AccNo”, “BranchCode”, “DocType”, “Description”, “CompanyName”, “ItemCode”, “UOM”,
  771.                 “UnitPrice”, “SubTotal”, “CurrencyRate”, “LocalUnitPrice”, “LocalSubTotal”, “CurrencyCode”};
  772.             string columns = BCE.AutoCount.XtraUtils.ColumnViewUtils.BuildSQLColumnListFromColumnView(gvPriceHistory, “A”, false, null, excludeColumns);
  773.             Cursor currentCursor = Cursor.Current;
  774.             Cursor.Current = Cursors.WaitCursor;
  775.             try
  776.             {
  777.                 myPriceHistoryInquiry.Inquire(itemCode, uom, BuildDocType(),
  778.                     fromDate, toDate, columns);
  779.             }
  780.             catch (BCE.Data.DataAccessException ex)
  781.             {
  782.                 BCE.Application.AppMessage.ShowErrorMessage(ex.Message);
  783.                 Reset();
  784.                 return;
  785.             }
  786.             finally
  787.             {
  788.                 Cursor.Current = currentCursor;
  789.             }
  790.             gctrPriceHistory.DataSource = myPriceHistoryInquiry.PriceHistoryTable;
  791.         }
  792.         public void Reset()
  793.         {
  794.             myItemCode = “”;
  795.             myUom = “”;
  796.             myToDate = null;
  797.             myFromDate = null;
  798.         }
  799.         private string[] BuildDocType()
  800.         {
  801.             ArrayList docType = new ArrayList();
  802.             if (ckEdtShowDebtor.Checked)
  803.             {
  804.                 docType.Add(“QT”);
  805.                 docType.Add(“SO”);
  806.                 docType.Add(“DO”);
  807.                 docType.Add(“IV”);
  808.                 docType.Add(“CS”);
  809.                 docType.Add(“CN”);
  810.                 docType.Add(“DN”);
  811.                 docType.Add(“XS”);
  812.                 docType.Add(“DR”);
  813.             }
  814.             if (ckEdtShowCreditor.Checked)
  815.             {
  816.                 docType.Add(“PR”);
  817.                 docType.Add(“RQ”);
  818.                 docType.Add(“PO”);
  819.                 docType.Add(“GR”);
  820.                 docType.Add(“PI”);
  821.                 docType.Add(“CP”);
  822.                 docType.Add(“PR”);
  823.                 docType.Add(“XP”);
  824.                 docType.Add(“GN”);
  825.             }
  826.             string[] myDocType = new string[docType.Count];
  827.             docType.CopyTo(myDocType);
  828.             return myDocType;
  829.         }
  830.         private void ReloadAllColumns(object sender, System.EventArgs e)
  831.         {
  832.             if (!IsInitialize)
  833.                 return;
  834.             string[] excludeColumn = {“AccNo”, “BranchCode”, “DocType”, “DocKey”, “Description”, “CompanyName”, “ItemCode”,
  835.                 “UOM”, “UnitPrice”, “SubTotal”, “CurrencyRate”, “LocalUnitPrice”, “LocalSubTotal”, “CurrencyCode”};
  836.             string columns = BCE.AutoCount.XtraUtils.ColumnViewUtils.BuildSQLColumnListFromColumnView(gvPriceHistory, “A”, false, null,
  837.                 excludeColumn);
  838.             object fromDate, toDate;
  839.             if (myFromDate != null && (DateTime)myFromDate != new DateTime(1, 1, 1))
  840.                 fromDate = myFromDate;
  841.             else
  842.                 fromDate = null;
  843.             if (myToDate != null && (DateTime)myToDate != new DateTime(1, 1, 1))
  844.                 toDate = myToDate;
  845.             else
  846.                 toDate = null;
  847.             myPriceHistoryInquiry.Inquire(myItemCode, myUom, BuildDocType(), fromDate, toDate, columns);
  848.             gctrPriceHistory.DataSource = myPriceHistoryInquiry.PriceHistoryTable;
  849.         }
  850.         private void GoToDocument()
  851.         {
  852.             DevExpress.XtraGrid.Views.Base.ColumnView gv =
  853.                 (DevExpress.XtraGrid.Views.Base.ColumnView)gctrPriceHistory.FocusedView;
  854.             DataRow r = gv.GetDataRow(gv.FocusedRowHandle);
  855.             if (r != null)
  856.             {
  857.                 string sourceType = r[“DocType”].ToString();
  858.                 long sourceKey = BCE.Data.Convert.ToInt64(r[“DocKey”]);
  859.                 BCE.AutoCount.Controller.DocumentDispatcher.Open(myDbSetting, sourceType, sourceKey);
  860.             }
  861.         }
  862.         private void gvPriceHistory_DoubleClick(object sender, System.EventArgs e)
  863.         {
  864.             if (!myMouseDownHelper.IsLeftMouseDown) return;
  865.             DevExpress.XtraGrid.Views.Grid.GridView view = (DevExpress.XtraGrid.Views.Grid.GridView)sender;
  866.             DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hitInfo = BCE.XtraUtils.GridViewUtils.GetGridHitInfo(view);
  867.             if (hitInfo.InRow && BCE.AutoCount.Authentication.AccessRight.Create(myDbSetting, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDbSetting).LoginUserID).IsAccessible(BCE.AutoCount.Const.AccessRightConst.SYS_BHV_DRILLDOWN))
  868.                 GoToDocument();    
  869.         }
  870.         ///<summary>
  871.         /// Refactored from  barchkShowAllBranches_CheckedChanged
  872.         ///</summary>
  873.         private void ColumnVisibility()
  874.         {
  875.             BCE.AutoCount.Controller.ModuleController modControl = new BCE.AutoCount.Controller.ModuleController();
  876.             colLocalUnitPrice.OptionsColumn.ShowInCustomizationForm = modControl.MultiCurrency.Enable;
  877.             colLocalSubTotal.OptionsColumn.ShowInCustomizationForm = modControl.MultiCurrency.Enable;
  878.         }
  879.         private void gvPriceHistory_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
  880.         {
  881.             if (gvPriceHistory.FocusedRowHandle < 0)
  882.                 return;
  883.             DataRow row = gvPriceHistory.GetDataRow(gvPriceHistory.FocusedRowHandle);
  884.             if (myItemCodeChanged != null)
  885.             {
  886.                 myItemCodeChanged(row[“ItemCode”].ToString(), row[“UOM”].ToString());
  887.             }
  888.         }
  889.         private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
  890.         {
  891.             DataTable myTable = ((DataView)gvPriceHistory.DataSource).Table;
  892.             BCE.AutoCount.CommonForms.FormRichTextEditor form = new BCE.AutoCount.CommonForms.FormRichTextEditor(myDbSetting, myTable,
  893.                 gvPriceHistory.GetDataSourceRowIndex(gvPriceHistory.FocusedRowHandle), “FurtherDescription”, “Further Description”,
  894.                 false);            
  895.             form.ShowDialog(this);
  896.             form.Dispose();
  897.         }
  898.         public enum FilterType
  899.         {
  900.             None,
  901.             Item,
  902.             AccNo
  903.         }
  904.         private void ckEdtShowDebtor_CheckedChanged(object sender, EventArgs e)
  905.         {
  906.             Reload(myItemCode);
  907.         }
  908.         private void ckEdtShowCreditor_CheckedChanged(object sender, EventArgs e)
  909.         {
  910.             Reload(myItemCode);
  911.         }
  912.         private void gvPriceHistory_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
  913.         {
  914.             DevExpress.XtraGrid.Views.Grid.GridView gv = (DevExpress.XtraGrid.Views.Grid.GridView)sender;
  915.             DataRow row = gv.GetDataRow(e.RowHandle);
  916.             if (row == null) return;
  917.             string docType = row[“DocType”].ToString();
  918.             if (docType == “CN”)
  919.                 e.Appearance.ForeColor = Color.Blue;
  920.             else if (docType == “GR” || docType == “PI” || docType == “CP”)
  921.                 e.Appearance.ForeColor = Color.Red;
  922.         }
  923.     }
  924.     [Serializable()]
  925.     public class UCPriceHistorySetting
  926.     {
  927.         public bool ShowDebtor = true;
  928.         public bool ShowCreditor = true;
  929.     }
  930. }

The UI would look like the image below:

The UI for the user control to be added into Instant Info

The UI for the user control to be added into Instant Info

The Logic class

The following codes is to handle the logic used by the UI component:

Code Snippet
  1. using System;
  2. using System.Data;
  3. using System.Data.SqlClient;
  4. using BCE.AutoCount;
  5. using BCE.Data;
  6. namespace MyAutoCountProject
  7. {
  8.     ///<summary>
  9.     /// Summary description for PriceHistory.
  10.     ///</summary>
  11.     public class PriceHistory
  12.     {
  13.         public DBSetting myDBSetting;
  14.         protected DataTable myPriceHistoryTable;
  15.         public DataTable PriceHistoryTable
  16.         {
  17.             get { return myPriceHistoryTable; }
  18.         }
  19.         internal PriceHistory()
  20.         {
  21.             myPriceHistoryTable = new DataTable();
  22.         }
  23.         public static PriceHistory Create(DBSetting dbSetting)
  24.         {
  25.             PriceHistory priceHistory;
  26.             if (dbSetting.ServerType == DBServerType.SQL2000)
  27.                 priceHistory = new PriceHistorySQL();
  28.             else
  29.                 throw new ArgumentException(“Server type: “ + dbSetting.ServerType + ” not supported.”);
  30.             priceHistory.myDBSetting = dbSetting;
  31.             return priceHistory;
  32.         }
  33.         protected string BuildPriceHistorySQL(string itemCode, string uom,
  34.             string[] docType, string columns, IDbCommand cmd, object fromDate, object toDate)
  35.         {
  36.             string cmdTxt;
  37.             if(columns.Length > 0)
  38.             {
  39.                 columns += “, A.AccNo, A.BranchCode, A.DocType, A.DocKey, A.Description, “
  40.                     +“A.ItemCode, A.UOM, A.UnitPrice, A.SubTotal, “
  41.                     +“A.CurrencyRate, (A.UnitPrice * A.CurrencyRate) AS LocalUnitPrice, “
  42.                     + “(A.SubTotal * A.CurrencyRate) AS LocalSubTotal, B.Description AS CompanyName, B.CurrencyCode “;
  43.             }
  44.             else
  45.                 columns = “*”;
  46.             cmdTxt = “SELECT “ + columns + ” FROM IPHist A “;
  47.             cmdTxt += “LEFT OUTER JOIN GLMast B ON A.AccNo = B.AccNo “;
  48.             string tempSql = string.Empty;
  49.             if (itemCode.Length > 0)
  50.             {
  51.                 tempSql += “AND A.ItemCode = @ItemCode “;
  52.                 IDbDataParameter param = cmd.CreateParameter();
  53.                 param.ParameterName = “@ItemCode”;
  54.                 param.Value = itemCode;
  55.                 cmd.Parameters.Add(param);
  56.             }
  57.             if (uom.Length > 0)
  58.             {
  59.                 tempSql += “AND A.UOM = @UOM “;
  60.                 IDbDataParameter param = cmd.CreateParameter();
  61.                 param.ParameterName = “@UOM”;
  62.                 param.Value = uom;
  63.                 cmd.Parameters.Add(param);
  64.             }
  65.             tempSql += SubBuildDocType(docType, cmd);// + ” ORDER BY DocDate DESC”;
  66.             if (fromDate != null)
  67.             {
  68.                 tempSql += “AND A.DocDate >= @FromDate “;
  69.                 IDbDataParameter param = cmd.CreateParameter();
  70.                 param.ParameterName = “@FromDate”;
  71.                 param.Value = (DateTime)fromDate;
  72.                 cmd.Parameters.Add(param);
  73.             }
  74.             if (toDate != null)
  75.             {
  76.                 tempSql += “AND A.DocDate <= @ToDate “;
  77.                 IDbDataParameter param2 = cmd.CreateParameter();
  78.                 param2.ParameterName = “@ToDate”;
  79.                 param2.Value = (DateTime)toDate;
  80.                 cmd.Parameters.Add(param2);
  81.             }
  82.             if (tempSql.Length > 0)
  83.                 cmdTxt += “WHERE 1=1 “ +tempSql;
  84.             else
  85.                 cmdTxt += “WHERE 1=0 “;
  86.             return cmdTxt;
  87.         }
  88.         private string SubBuildDocType(string[] docType, IDbCommand cmd)
  89.         {
  90.             // If select all type
  91.             if (docType.Length == 17)
  92.                 return“”;
  93.             string subTxtDocType = “AND A.DocType IN (“;
  94.             for (int i=0; i<docType.Length; i++)
  95.             {
  96.                 IDbDataParameter param = cmd.CreateParameter();
  97.                 param.ParameterName = “@DocType”+i;
  98.                 param.Value = docType[i];
  99.                 cmd.Parameters.Add(param);
  100.                 if (i == docType.Length-1 )
  101.                     subTxtDocType += ” @DocType” +i +” )”;
  102.                 else
  103.                     subTxtDocType += ” @DocType” +i +“,”;
  104.             }
  105.             return subTxtDocType;
  106.         }
  107.         ///<summary>
  108.         /// Query to get the result
  109.         ///</summary>
  110.         ///<param name=”itemCode”></param>
  111.         ///<param name=”accNo”></param>
  112.         ///<param name=”branchCode”></param>
  113.         ///<param name=”uom”></param>
  114.         ///<param name=”showAllBranches”></param>
  115.         ///<param name=”docType”></param>
  116.         ///<param name=”myDateFilter”></param>
  117.         ///<param name=”fromDate”></param>
  118.         ///<param name=”toDate”></param>
  119.         ///<param name=”columns”>Column available in the grid</param>
  120.         ///<param name=”filterType”></param>
  121.         ///<param name=”filterString”></param>
  122.         public virtual void Inquire(string itemCode, string uom,
  123.             string[] docType, object fromDate, object toDate, string columns)
  124.         {
  125.         }
  126.         public void Inquire(string itemCode, string uom,
  127.             string[] docType)
  128.         {
  129.             Inquire(itemCode, uom, docType, null, null, “*”);
  130.         }
  131.     }
  132.     public class PriceHistorySQL : PriceHistory
  133.     {
  134.         public override void Inquire(string itemCode, string uom,
  135.             string[] docType, object fromDate, object toDate, string columns)
  136.         {
  137.             myPriceHistoryTable.Clear();
  138.             if (docType.Length == 0)
  139.                 return;
  140.             SqlConnection myConn = new SqlConnection(myDBSetting.ConnectionString);
  141.             try
  142.             {
  143.                 myConn.Open();
  144.                 SqlCommand myCmd = new SqlCommand();
  145.                 myCmd.Connection = myConn;
  146.                 string cmdTxt = BuildPriceHistorySQL(itemCode, uom, docType, columns, myCmd,
  147.                     fromDate, toDate);
  148.                 myCmd.CommandText = cmdTxt;
  149.                 SqlDataAdapter dadPriceHistory = new SqlDataAdapter(myCmd);
  150.                 dadPriceHistory.Fill(myPriceHistoryTable);
  151.             }
  152.             catch (SqlException ex)
  153.             {
  154.                 DataError.HandleSqlException(ex);
  155.             }
  156.             finally
  157.             {
  158.                 myConn.Close();
  159.                 myConn.Dispose();
  160.             }
  161.         }
  162.     }
  163. }

Compile both of the classes above into a .dll and copy it into the installation folder of AutoCount Accounting before calling the class in the script management.

Calling the created class

The following codes is to be added in the Script Maintenance window under the InstantInfo category as shown below.

The following scripts are to be placed into the following entries

The following scripts are to be placed into the following entries

For Invoicing Instant Info

This is to show the new tab in the Invoicing Instant Info. The Invoicing Instant Info is used in the following windows:

Entry Form using the UCInquiry
Credit Note Entry
Debit Note Entry
Delivery Order Entry
Quotation Entry
Sales Order Entry
Goods Received Note Entry
Purchase Order Entry
Purchase Return Entry
Request Quotation Entry
Past Sale Entry (Data Entry By Past Sales Records)

To directly copy this code snippet into the system, just copy and paste the code into the Invoicing Instant Info script under the InstantInfo category in Script Maintenance (as shown in the image previously):

Code Snippet
  1. DevExpress.XtraTab.XtraTabPage myPriceHistoryTabPage;
  2. UCPriceHistory myUCPriceHistory;
  3. ///<summary>
  4. /// Use this event to do user control initialization
  5. ///</summary>
  6. ///<param name=”e”>The event argument</param>
  7. public void OnInitialize(object sender, BCE.AutoCount.Inquiry.UserControls.UCInquiryInitializeEventArgs e)
  8. {
  9.     myPriceHistoryTabPage = e.TabControl.TabPages.Add();
  10.     myUCPriceHistory = new UCPriceHistory();
  11.     myUCPriceHistory.Location = new System.Drawing.Point(0, 0);
  12.     myUCPriceHistory.Dock = System.Windows.Forms.DockStyle.Fill;
  13.     myPriceHistoryTabPage.Text = “All Price History”;
  14.     myPriceHistoryTabPage.Controls.Add(myUCPriceHistory);
  15. }
  16. ///<summary>
  17. /// Use this event to do reload of the user control
  18. ///</summary>
  19. ///<param name=”e”>The event argument</param>
  20. public void OnReload(object sender, BCE.AutoCount.Inquiry.UserControls.UCInquiryReloadEventArgs e)
  21. {
  22.     if (!myUCPriceHistory.IsInitialize)
  23.         myUCPriceHistory.Initialize(BCE.AutoCount.Application.DBSetting, e.ItemCode, e.UOM);
  24.     else
  25.         myUCPriceHistory.Reload(e.ItemCode, e.UOM);
  26. }

For Instant Info with Consignment Info

This is to show the new tab in the Instant Info with Consignment Info. The Instant Info with Consignment Info is used in the following windows:

Entry Form using the UCInquiryCSGN
Bonus Point Redemption Entry
Cash Sale Entry
POS Cash Sale Entry
Consignment Entry
Invoice Entry
Cash Purchase Entry
Purchase Invoice Entry
Supplier Consignment Entry

 

To directly copy this code snippet into the system, just copy and paste the code into the Instant Info with Consignment Info script under the InstantInfo category in Script Maintenance (as shown in the image previously):

Code Snippet
  1. DevExpress.XtraTab.XtraTabPage myPriceHistoryTabPage;
  2. UCPriceHistory myUCPriceHistory;
  3. ///<summary>
  4. /// Use this event to do user control initialization
  5. ///</summary>
  6. ///<param name=”e”>The event argument</param>
  7. public void OnInitialize(object sender, BCE.AutoCount.Inquiry.UserControls.UCInquiryInitializeEventArgs e)
  8. {
  9.     myPriceHistoryTabPage = e.TabControl.TabPages.Add();
  10.     myUCPriceHistory = new UCPriceHistory();
  11.     myUCPriceHistory.Location = new System.Drawing.Point(0, 0);
  12.     myUCPriceHistory.Dock = System.Windows.Forms.DockStyle.Fill;
  13.     myPriceHistoryTabPage.Text = “All Price History”;
  14.     myPriceHistoryTabPage.Controls.Add(myUCPriceHistory);
  15. }
  16. ///<summary>
  17. /// Use this event to do reload of the user control
  18. ///</summary>
  19. ///<param name=”e”>The event argument</param>
  20. public void OnReload(object sender, BCE.AutoCount.Inquiry.UserControls.UCInquiryReloadEventArgs e)
  21. {
  22.     if (!myUCPriceHistory.IsInitialize)
  23.         myUCPriceHistory.Initialize(BCE.AutoCount.Application.DBSetting, e.ItemCode, e.UOM);
  24.     else
  25.         myUCPriceHistory.Reload(e.ItemCode, e.UOM);
  26. }

For Stock Instant Info

This is to show the new tab in the Stock Instant Info. The Stock Instant Info is used in the following windows:

Entry Form using the UCInquiryStock
Stock Assembly Entry
Stock Assembly Order Entry
Account Inquiry
Stock Adjustment Entry
Stock Issue Entry
Stock Receive Entry
Stock Transfer Entry
Stock Write-Off Entry

To directly copy this code snippet into the system, just copy and paste the code into the Stock Instant Info script under the InstantInfo category in Script Maintenance (as shown in the image previously):

Code Snippet
  1. DevExpress.XtraTab.XtraTabPage myPriceHistoryTabPage;
  2. UCPriceHistory myUCPriceHistory;
  3. ///<summary>
  4. /// Use this event to do user control initialization
  5. ///</summary>
  6. ///<param name=”e”>The event argument</param>
  7. public void OnInitialize(object sender, BCE.AutoCount.Inquiry.UserControls.UCInquiryInitializeEventArgs e)
  8. {
  9.     myPriceHistoryTabPage = e.TabControl.TabPages.Add();
  10.     myUCPriceHistory = new UCPriceHistory();
  11.     myUCPriceHistory.Location = new System.Drawing.Point(0, 0);
  12.     myUCPriceHistory.Dock = System.Windows.Forms.DockStyle.Fill;
  13.     myPriceHistoryTabPage.Text = “All Price History”;
  14.     myPriceHistoryTabPage.Controls.Add(myUCPriceHistory);
  15. }
  16. ///<summary>
  17. /// Use this event to do reload of the user control
  18. ///</summary>
  19. ///<param name=”e”>The event argument</param>
  20. public void OnReload(object sender, BCE.AutoCount.Inquiry.UserControls.UCInquiryReloadEventArgs e)
  21. {
  22.     if (!myUCPriceHistory.IsInitialize)
  23.         myUCPriceHistory.Initialize(BCE.AutoCount.Application.DBSetting, e.ItemCode, e.UOM);
  24.     else
  25.         myUCPriceHistory.Reload(e.ItemCode, e.UOM);
  26. }