Table load complete. Printer stub removed for actual code.
This commit is contained in:
@ -20,7 +20,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
List<Button> buttonHeads = new List<Button>();
|
||||
int page = 0;
|
||||
int pageSize = 6;
|
||||
|
||||
|
||||
public SalesForm(BillController billController)
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -76,7 +76,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
}
|
||||
case Keys.F8:
|
||||
{
|
||||
billController.LoadBillFromTable();
|
||||
billController.LoadBillFromTable(null);
|
||||
break;
|
||||
}
|
||||
case Keys.F9:
|
||||
@ -149,8 +149,31 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
txtGrossAmount.Text = "0.00";
|
||||
txtAmount.Text = "0.00";
|
||||
bindingSource.DataSource = bill.Values;
|
||||
ChangeFormState(SaleFormState.Waiting);
|
||||
}
|
||||
private void ChangeFormState(SaleFormState state)
|
||||
{
|
||||
foreach (var button in buttonList)
|
||||
button.Dispose();
|
||||
foreach (var button in buttonHeads)
|
||||
button.Dispose();
|
||||
buttonList = new List<Button>();
|
||||
buttonHeads = new List<Button>();
|
||||
if (state == SaleFormState.Billing)
|
||||
{
|
||||
btnPrevious.Visible = true;
|
||||
btnNext.Visible = true;
|
||||
page = 0;
|
||||
var list = new ProductTypeBI().GetProductTypes();
|
||||
ControlFactory.GenerateButtons(ref pnlBilling, ref buttonHeads, new Rectangle(889, 90, 85, 498), 1, pageSize, 2, page, list, new ButtonClickDelegate(productTypeButton_Click));
|
||||
}
|
||||
else
|
||||
{
|
||||
btnPrevious.Visible = false;
|
||||
btnNext.Visible = false;
|
||||
ControlFactory.GenerateTables(ref pnlBilling, ref buttonHeads, new Rectangle(390, 94, 499, 385), 6, 10, 2, new FoodTableBI().GetFoodTables(), new ButtonClickDelegate(tableButton_Click));
|
||||
}
|
||||
}
|
||||
|
||||
private void productTypeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Button button = sender as Button;
|
||||
@ -172,9 +195,10 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
Button button = sender as Button;
|
||||
if (button == null)
|
||||
return;
|
||||
int tag = (int)button.Tag;
|
||||
MessageBox.Show("Table No " + tag.ToString());
|
||||
//AddProductToGrid(tag);
|
||||
string tableName = button.Text;
|
||||
billController.LoadBillFromTable(tableName);
|
||||
txtTableID.Text = tableName;
|
||||
ChangeFormState(SaleFormState.Billing);
|
||||
}
|
||||
public void ShowAmount(decimal grossTax, decimal discount, decimal grossAmount, decimal amount, List<SalesBillItemBO> bill)
|
||||
{
|
||||
@ -225,10 +249,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
private void SalesForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
billController.FormLoad();
|
||||
//ControlFactory.GenerateButtons(ref pnlBilling, new Rectangle(489, 94, 400, 385), 5, 6, 2, new ProductBI().GetUnFilteredProducts(), new ButtonClickDelegate(productButton_Click));
|
||||
//ControlFactory.GenerateButtons(ref pnlBilling, ref buttonHeads, new Rectangle(889, 0, 80, 688), 1, pageSize, 2, page, new ProductTypeBI().GetProductTypes(), new ButtonClickDelegate(productTypeButton_Click));
|
||||
//ControlFactory.GenerateButtons(ref pnlBilling, ref buttonHeads, new Rectangle(889, 90, 85, 498), 1, pageSize, 2, page, new ProductTypeBI().GetProductTypes(), new ButtonClickDelegate(productTypeButton_Click));
|
||||
ControlFactory.GenerateButtons(ref pnlBilling, ref buttonHeads, new Rectangle(390, 94, 499, 385), 6, 10, 2, new FoodTableBI().GetFoodTables(), new ButtonClickDelegate(tableButton_Click));
|
||||
ChangeFormState(SaleFormState.Waiting);
|
||||
}
|
||||
|
||||
private void btnCustomer_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user