Regression: BillItemKey added the compare methods back

Regression: PrintLocation added the compare methods back
Breaking: Kot.Code is now integers
Breaking: Kot Update is now via Stored Procedure to get DB Values
Breaking: Reprints Insert is now via Stored Procedure to get DV Values
Breaking: Voucher.BillID and KotID are now integers
Breaking: Voucher Insert/Update is now via Stored Procedures to get DV Values also Dirty Checking for Voucher has been overwritten to set dirty for LastEditDate update
Fix: Login forms simplified
Feature: PrintLocation and Products are cached application wide.
This commit is contained in:
tanshu
2014-11-02 13:33:31 +05:30
parent 45831e2e4d
commit 3ca8b29e04
33 changed files with 528 additions and 332 deletions

View File

@ -12,25 +12,15 @@ namespace Tanshu.Accounts.PointOfSale.Sales
{
public partial class SalesForm : Form, ISaleForm
{
private readonly IDictionary<Guid, IList<Product>> _productDictionary;
private readonly IList<ProductGroup> _productGroupList;
private ProductGroup _currentProductGroup;
public SalesForm(BillController billController)
{
InitializeComponent();
_productDictionary = new Dictionary<Guid, IList<Product>>();
this._billController = billController;
_billController = billController;
billController.InitGui(this);
using (var bi = new ProductGroupBI())
_productGroupList = bi.List(x => x.IsActive);
using (var bi = new ProductBI())
foreach (var item in _productGroupList)
_productDictionary.Add(item.ProductGroupID, bi.List(x => x.ProductGroup.ProductGroupID == item.ProductGroupID && x.IsActive));
}
#region ISaleForm Members
public void SetUserName(string name)
{
Text = name;
@ -55,8 +45,11 @@ namespace Tanshu.Accounts.PointOfSale.Sales
}
else
{
txtBillID.Text = voucher.BillID;
txtKotID.Text = voucher.KotID;
if (voucher.BillID.HasValue)
{
txtBillID.Text = voucher.BillID.Value.ToString();
}
txtKotID.Text = "K-" + voucher.KotID.ToString();
txtCreationDate.Text = voucher.CreationDate.ToString("HH:mm dd-MMM-yyyy");
txtDate.Text = voucher.Date.Value.ToString("HH:mm dd-MMM-yyyy");
txtLastEditDate.Text = voucher.LastEditDate.ToString("HH:mm dd-MMM-yyyy");
@ -334,7 +327,7 @@ namespace Tanshu.Accounts.PointOfSale.Sales
flpGroup.Controls.Clear();
flpMain.Controls.Clear();
if (value == SaleFormState.Billing)
ControlFactory.GenerateGroups(ref flpGroup, new Point(75, 75), 0, _productGroupList, productTypeButton_Click, productTypePage_Click);
ControlFactory.GenerateGroups(ref flpGroup, new Point(75, 75), 0, Cache.ProductGroups(), productTypeButton_Click, productTypePage_Click);
else
using (var bi = new FoodTableBI())
ControlFactory.GenerateTables(ref flpMain, new Point(75, 75), 0, bi.List(x => x.IsActive), tableButton_Click, tablePage_Click);
@ -351,7 +344,7 @@ namespace Tanshu.Accounts.PointOfSale.Sales
return;
_currentProductGroup = item;
ControlFactory.GenerateProducts(ref flpMain, new Point(75, 75), 0,
_productDictionary[item.ProductGroupID], productButton_Click, productPage_Click);
item.Products, productButton_Click, productPage_Click);
}
private void productTypePage_Click(object sender, EventArgs e)
@ -362,7 +355,7 @@ namespace Tanshu.Accounts.PointOfSale.Sales
var start = (int)button.Tag;
if (start < 0)
start = 0;
ControlFactory.GenerateGroups(ref flpGroup, new Point(75, 75), start, _productGroupList, productTypeButton_Click, productTypePage_Click);
ControlFactory.GenerateGroups(ref flpGroup, new Point(75, 75), start, Cache.ProductGroups(), productTypeButton_Click, productTypePage_Click);
}
private void productButton_Click(object sender, EventArgs e)
@ -385,7 +378,7 @@ namespace Tanshu.Accounts.PointOfSale.Sales
var start = (int)button.Tag;
if (start < 0)
start = 0;
ControlFactory.GenerateProducts(ref flpMain, new Point(75, 75), start, _productDictionary[_currentProductGroup.ProductGroupID], productButton_Click, productPage_Click);
ControlFactory.GenerateProducts(ref flpMain, new Point(75, 75), start, _currentProductGroup.Products, productButton_Click, productPage_Click);
}
private void tableButton_Click(object sender, EventArgs e)