2011-12-05 09:41:02 +00:00
|
|
|
|
using System.Collections.Generic;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
|
using Tanshu.Data;
|
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Helpers
|
|
|
|
|
{
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public class SelectProduct : Tanshu.Data.BaseSelector<ProductDisplaySmall>
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public SelectProduct(GetData<ProductDisplaySmall> getData, bool autoClose)
|
2010-03-02 17:56:21 +00:00
|
|
|
|
: base(getData, true, "List of Products")
|
|
|
|
|
{
|
2011-12-05 09:41:02 +00:00
|
|
|
|
var filters = new List<string> {"Name", "Type"};
|
2010-03-02 17:56:21 +00:00
|
|
|
|
SetFilterColumns(filters);
|
|
|
|
|
grid.Columns["ProductID"].Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void FilterChanged(Dictionary<string, string> filter)
|
|
|
|
|
{
|
|
|
|
|
data = getData(filter);
|
|
|
|
|
bindingSource.DataSource = data;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
protected override void UpdateDisplay(ProductDisplaySmall item)
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-12-05 09:41:02 +00:00
|
|
|
|
DisplayLabel = item == null ? "" : string.Format("Chosen Product {0} with rate Rs. {1}", item.Name, item.Price);
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
2011-12-05 09:41:02 +00:00
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
protected override ProductDisplaySmall HandleKeydown(object sender, ExtendedKeyEventArgs e)
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
|
|
|
|
e.Handled = false;
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
#region Designer Code
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Required designer variable.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private System.ComponentModel.IContainer components = null;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Clean up any resources being used.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
if (disposing && (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()
|
|
|
|
|
{
|
|
|
|
|
this.components = new System.ComponentModel.Container();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|