narsil/Tanshu.Accounts.PointOfSale/CurrencyCounter.cs
unknown d8ecec8bb6 Added inverse Attribute to ProductGroup.
BillInventory Renamed.
Refactored Bill to be more usable.
Added Bill Detail Report.
Added Open Bill and Bill Details Roles.
Zero Rate Products have Yellow background Color.
Refactored UserBI, FoodTableBI, ModifierBI, PrintLocationBI, ProductBI, ProductGroupBI, TaxBI, UserBI,
Cached the Products List.
Product and Product Group Form Working.
2011-06-23 18:17:48 +05:30

59 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.PointOfSale
{
public partial class CurrencyCounter : Form
{
public CurrencyCounter()
{
InitializeComponent();
}
private void btnPrint_Click(object sender, EventArgs e)
{
Dictionary<int, int> amounts = new Dictionary<int, int>();
if (txt1000.Text != "") amounts.Add(1000, Convert.ToInt32(txt1000.Text));
if (txt500.Text != "") amounts.Add(500, Convert.ToInt32(txt500.Text));
if (txt100.Text != "") amounts.Add(100, Convert.ToInt32(txt100.Text));
if (txt50.Text != "") amounts.Add(50, Convert.ToInt32(txt50.Text));
if (txt20.Text != "") amounts.Add(20, Convert.ToInt32(txt20.Text));
if (txt10.Text != "") amounts.Add(10, Convert.ToInt32(txt10.Text));
if (txt5.Text != "") amounts.Add(5, Convert.ToInt32(txt5.Text));
if (txt2.Text != "") amounts.Add(2, Convert.ToInt32(txt2.Text));
if (txt1.Text != "") amounts.Add(1, Convert.ToInt32(txt1.Text));
Accounts.Print.Thermal.PrintCash(amounts, Session.User.Name);
}
private void txt1000_TextChanged(object sender, EventArgs e)
{
try
{
int Amount = 0;
Amount += 1000 * (txt1000.Text == "" ? 0 : Convert.ToInt16(txt1000.Text));
Amount += 500 * (txt500.Text == "" ? 0 : Convert.ToInt16(txt500.Text));
Amount += 100 * (txt100.Text == "" ? 0 : Convert.ToInt16(txt100.Text));
Amount += 50 * (txt50.Text == "" ? 0 : Convert.ToInt16(txt50.Text));
Amount += 20 * (txt20.Text == "" ? 0 : Convert.ToInt16(txt20.Text));
Amount += 10 * (txt10.Text == "" ? 0 : Convert.ToInt16(txt10.Text));
Amount += 5 * (txt5.Text == "" ? 0 : Convert.ToInt16(txt5.Text));
Amount += 2 * (txt2.Text == "" ? 0 : Convert.ToInt16(txt2.Text));
Amount += 1 * (txt1.Text == "" ? 0 : Convert.ToInt16(txt1.Text));
txtTotal.Text = Amount.ToString();
}
catch (Exception ex)
{
MessageBox.Show("Error Number " + ex.Source + "\n\r" + ex.Message);
}
}
}
}