Table load complete. Printer stub removed for actual code.
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
<add name="connection" connectionString="Server=.;Initial Catalog=PeithoSales;User ID=sa;Password=123456" />
|
||||
</connectionStrings>
|
||||
<appSettings>
|
||||
<add key ="Location" value ="Ground"/>
|
||||
<add key ="Factory" value ="SqlServer"/>
|
||||
<add key ="LogConnection" value ="connection"/>
|
||||
<add key ="LogLevel" value ="Warn"/>
|
||||
|
||||
@ -30,9 +30,5 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
}
|
||||
}
|
||||
}
|
||||
static public string printer()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -394,22 +394,34 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
ShowAmount();
|
||||
|
||||
}
|
||||
public void LoadBillFromTable()
|
||||
public void LoadBillFromTable(string tableName)
|
||||
{
|
||||
InputBoxResult result = InputBox.Show("Enter Table Number", "Table", "0", InputBox_Validating);
|
||||
if (result.OK)
|
||||
if (!string.IsNullOrEmpty(tableName))
|
||||
{
|
||||
string tableID = result.Text.Trim();
|
||||
if ((tableID != "C") && (tableID != "") && (!tableID.Contains(".")))
|
||||
Guid? tID = new SaleVoucherBI().GetPendingVoucherID(tableName);
|
||||
if (tID.HasValue)
|
||||
{
|
||||
Guid? tID = new SaleVoucherBI().GetPendingVoucherID(tableID);
|
||||
if (tID.HasValue)
|
||||
{
|
||||
LoadBill(tID.Value);
|
||||
}
|
||||
LoadBill(tID.Value);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
InputBoxResult result = InputBox.Show("Enter Table Number", "Table", "0", InputBox_Validating);
|
||||
if (result.OK)
|
||||
{
|
||||
string tableID = result.Text.Trim();
|
||||
if ((tableID != "C") && (tableID != "") && (!tableID.Contains(".")))
|
||||
{
|
||||
Guid? tID = new SaleVoucherBI().GetPendingVoucherID(tableID);
|
||||
if (tID.HasValue)
|
||||
{
|
||||
LoadBill(tID.Value);
|
||||
}
|
||||
}
|
||||
else
|
||||
ClearBill();
|
||||
}
|
||||
else
|
||||
ClearBill();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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