Initial Commit

This commit is contained in:
unknown
2010-03-02 23:26:21 +05:30
commit 232a62f8ca
214 changed files with 25010 additions and 0 deletions

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Tanshu.Accounts.Helpers;
using System.Data.SqlClient;
using System.Configuration;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.PointOfSale
{
public partial class AdjustAdvanceForm : Form
{
bool loading = true;
public AdjustAdvanceForm()
{
InitializeComponent();
}
private void AdjustAdvancesForm_Load(object sender, EventArgs e)
{
dtpFrom.Format = DateTimePickerFormat.Custom;
dtpFrom.CustomFormat = "dd-MMM-yyyy";
dtpFrom.Value = DateTime.Now;
dtpTo.Format = DateTimePickerFormat.Custom;
dtpTo.CustomFormat = "dd-MMM-yyyy";
dtpTo.Value = DateTime.Now;
loading = false;
FillDataGrid();
}
private void FillDataGrid()
{
dgExpenses.DataSource = new AdvanceBI().GetAdvances(dtpFrom.Value, dtpTo.Value, false);
}
private void dtpFrom_ValueChanged(object sender, EventArgs e)
{
if (!loading)
FillDataGrid();
}
private void btnSelect_Click(object sender, EventArgs e)
{
try
{
AdvanceDisplayBO item = (AdvanceDisplayBO)dgExpenses.SelectedRows[0].DataBoundItem;
txtCashier.Text = item.Cashier;
txtNarration.Tag = item.AdvanceID;
txtNarration.Text = item.Narration;
txtAmount.Text = item.Amount.ToString();
}
catch { }
}
private void btnAdjust_Click(object sender, EventArgs e)
{
new AdvanceBI().Adjust((Guid)txtNarration.Tag, CurrentUser.user.UserID);
FillDataGrid();
}
}
}

View File

@ -0,0 +1,270 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class AdjustAdvanceForm
{
/// <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.btnAdjust = new System.Windows.Forms.Button();
this.btnSelect = new System.Windows.Forms.Button();
this.Label7 = new System.Windows.Forms.Label();
this.txtNarration = new System.Windows.Forms.TextBox();
this.txtAmount = new System.Windows.Forms.TextBox();
this.lblAmount = new System.Windows.Forms.Label();
this.txtCashier = new System.Windows.Forms.TextBox();
this.Label5 = new System.Windows.Forms.Label();
this.txtVoid = new System.Windows.Forms.TextBox();
this.txtAmt = new System.Windows.Forms.TextBox();
this.Label4 = new System.Windows.Forms.Label();
this.Label3 = new System.Windows.Forms.Label();
this.Label2 = new System.Windows.Forms.Label();
this.Label1 = new System.Windows.Forms.Label();
this.dtpTo = new System.Windows.Forms.DateTimePicker();
this.dtpFrom = new System.Windows.Forms.DateTimePicker();
this.dgExpenses = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dgExpenses)).BeginInit();
this.SuspendLayout();
//
// btnAdjust
//
this.btnAdjust.Location = new System.Drawing.Point(142, 113);
this.btnAdjust.Name = "btnAdjust";
this.btnAdjust.Size = new System.Drawing.Size(75, 21);
this.btnAdjust.TabIndex = 111;
this.btnAdjust.Text = "&Adjust";
this.btnAdjust.Click += new System.EventHandler(this.btnAdjust_Click);
//
// btnSelect
//
this.btnSelect.Location = new System.Drawing.Point(61, 113);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(75, 21);
this.btnSelect.TabIndex = 110;
this.btnSelect.Text = "&Select";
this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
//
// Label7
//
this.Label7.AutoSize = true;
this.Label7.Location = new System.Drawing.Point(6, 92);
this.Label7.Name = "Label7";
this.Label7.Size = new System.Drawing.Size(50, 13);
this.Label7.TabIndex = 109;
this.Label7.Text = "Narration";
//
// txtNarration
//
this.txtNarration.Location = new System.Drawing.Point(61, 90);
this.txtNarration.Name = "txtNarration";
this.txtNarration.ReadOnly = true;
this.txtNarration.Size = new System.Drawing.Size(330, 20);
this.txtNarration.TabIndex = 108;
//
// txtAmount
//
this.txtAmount.Location = new System.Drawing.Point(61, 68);
this.txtAmount.Name = "txtAmount";
this.txtAmount.ReadOnly = true;
this.txtAmount.Size = new System.Drawing.Size(100, 20);
this.txtAmount.TabIndex = 107;
//
// lblAmount
//
this.lblAmount.AutoSize = true;
this.lblAmount.Location = new System.Drawing.Point(11, 71);
this.lblAmount.Name = "lblAmount";
this.lblAmount.Size = new System.Drawing.Size(43, 13);
this.lblAmount.TabIndex = 106;
this.lblAmount.Text = "Amount";
//
// txtCashier
//
this.txtCashier.Location = new System.Drawing.Point(61, 47);
this.txtCashier.Name = "txtCashier";
this.txtCashier.ReadOnly = true;
this.txtCashier.Size = new System.Drawing.Size(330, 20);
this.txtCashier.TabIndex = 105;
//
// Label5
//
this.Label5.AutoSize = true;
this.Label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label5.Location = new System.Drawing.Point(56, 501);
this.Label5.Name = "Label5";
this.Label5.Size = new System.Drawing.Size(40, 16);
this.Label5.TabIndex = 104;
this.Label5.Text = "Void";
//
// txtVoid
//
this.txtVoid.BackColor = System.Drawing.Color.Black;
this.txtVoid.ForeColor = System.Drawing.Color.Lime;
this.txtVoid.Location = new System.Drawing.Point(112, 499);
this.txtVoid.Name = "txtVoid";
this.txtVoid.ReadOnly = true;
this.txtVoid.Size = new System.Drawing.Size(100, 20);
this.txtVoid.TabIndex = 103;
this.txtVoid.Text = "0.00";
this.txtVoid.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// txtAmt
//
this.txtAmt.BackColor = System.Drawing.Color.Black;
this.txtAmt.ForeColor = System.Drawing.Color.Lime;
this.txtAmt.Location = new System.Drawing.Point(281, 500);
this.txtAmt.Name = "txtAmt";
this.txtAmt.ReadOnly = true;
this.txtAmt.Size = new System.Drawing.Size(110, 20);
this.txtAmt.TabIndex = 102;
this.txtAmt.Text = "0.00";
this.txtAmt.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label4
//
this.Label4.AutoSize = true;
this.Label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label4.Location = new System.Drawing.Point(232, 502);
this.Label4.Name = "Label4";
this.Label4.Size = new System.Drawing.Size(44, 16);
this.Label4.TabIndex = 101;
this.Label4.Text = "Total";
//
// Label3
//
this.Label3.AutoSize = true;
this.Label3.Location = new System.Drawing.Point(13, 52);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(42, 13);
this.Label3.TabIndex = 100;
this.Label3.Text = "Cashier";
//
// Label2
//
this.Label2.AutoSize = true;
this.Label2.Location = new System.Drawing.Point(171, 18);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(20, 13);
this.Label2.TabIndex = 97;
this.Label2.Text = "To";
//
// Label1
//
this.Label1.AutoSize = true;
this.Label1.Location = new System.Drawing.Point(21, 18);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(30, 13);
this.Label1.TabIndex = 95;
this.Label1.Text = "From";
//
// dtpTo
//
this.dtpTo.Location = new System.Drawing.Point(191, 18);
this.dtpTo.Name = "dtpTo";
this.dtpTo.Size = new System.Drawing.Size(90, 20);
this.dtpTo.TabIndex = 98;
//
// dtpFrom
//
this.dtpFrom.Location = new System.Drawing.Point(61, 18);
this.dtpFrom.Name = "dtpFrom";
this.dtpFrom.Size = new System.Drawing.Size(90, 20);
this.dtpFrom.TabIndex = 96;
this.dtpFrom.ValueChanged += new System.EventHandler(this.dtpFrom_ValueChanged);
//
// dgExpenses
//
this.dgExpenses.AllowUserToAddRows = false;
this.dgExpenses.AllowUserToDeleteRows = false;
this.dgExpenses.AllowUserToResizeRows = false;
this.dgExpenses.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgExpenses.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgExpenses.Location = new System.Drawing.Point(13, 140);
this.dgExpenses.Name = "dgExpenses";
this.dgExpenses.ReadOnly = true;
this.dgExpenses.RowHeadersVisible = false;
this.dgExpenses.RowTemplate.Height = 19;
this.dgExpenses.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgExpenses.Size = new System.Drawing.Size(378, 356);
this.dgExpenses.TabIndex = 112;
//
// AdjustAdvanceForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(402, 536);
this.Controls.Add(this.dgExpenses);
this.Controls.Add(this.btnAdjust);
this.Controls.Add(this.btnSelect);
this.Controls.Add(this.Label7);
this.Controls.Add(this.txtNarration);
this.Controls.Add(this.txtAmount);
this.Controls.Add(this.lblAmount);
this.Controls.Add(this.txtCashier);
this.Controls.Add(this.Label5);
this.Controls.Add(this.txtVoid);
this.Controls.Add(this.txtAmt);
this.Controls.Add(this.Label4);
this.Controls.Add(this.Label3);
this.Controls.Add(this.Label2);
this.Controls.Add(this.Label1);
this.Controls.Add(this.dtpTo);
this.Controls.Add(this.dtpFrom);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AdjustAdvanceForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Payment Details";
this.Load += new System.EventHandler(this.AdjustAdvancesForm_Load);
((System.ComponentModel.ISupportInitialize)(this.dgExpenses)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
internal System.Windows.Forms.Button btnAdjust;
internal System.Windows.Forms.Button btnSelect;
internal System.Windows.Forms.Label Label7;
internal System.Windows.Forms.TextBox txtNarration;
internal System.Windows.Forms.TextBox txtAmount;
internal System.Windows.Forms.Label lblAmount;
internal System.Windows.Forms.TextBox txtCashier;
internal System.Windows.Forms.Label Label5;
internal System.Windows.Forms.TextBox txtVoid;
internal System.Windows.Forms.TextBox txtAmt;
internal System.Windows.Forms.Label Label4;
internal System.Windows.Forms.Label Label3;
internal System.Windows.Forms.Label Label2;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.DateTimePicker dtpTo;
internal System.Windows.Forms.DateTimePicker dtpFrom;
private System.Windows.Forms.DataGridView dgExpenses;
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,236 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanshu.Common;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
using System.Windows.Forms;
using System.Threading;
namespace Tanshu.Accounts.PointOfSale
{
public static class BillHelperFunctions
{
#region Discount
public static void SetDiscount(Guid productID, decimal discount, CustomerBO customer, Dictionary<BillItemKey, SalesBillItemBO> bill)
{
#region InputBox
if (discount == -1)
{
InputBoxResult result = InputBox.Show("Discount Rate", "Discount", "0", InputBox_Validating);
if (result.OK)
{
if (!decimal.TryParse(result.Text, out discount))
return;
discount /= 100;
}
}
if (discount == -1)
return;
#endregion
#region Max Discount
decimal maxDiscount = new SaleVoucherBI().GetProductDiscountLimit(productID);
if ((discount > maxDiscount) && customer.CustomerID != new Guid("F016CBAD-206C-42C0-BB1D-6006CE57BAB5"))
{
MessageBox.Show(string.Format("Maximum discount for this product is {0:P}", maxDiscount), "Excessive Discount", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if ((discount > maxDiscount) && customer.CustomerID == new Guid("F016CBAD-206C-42C0-BB1D-6006CE57BAB5"))
{
MessageBox.Show(string.Format("Maximum discount for this product is {0:P} Discount Disallowed", maxDiscount), "Excessive Discount", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
#endregion
if (bill.ContainsKey(new BillItemKey(productID, true)))
SetDiscount(bill[new BillItemKey(productID, true)], discount);
if (bill.ContainsKey(new BillItemKey(productID, false)))
SetDiscount(bill[new BillItemKey(productID, false)], discount);
return;
}
private static void SetDiscount(SalesBillItemBO product, decimal discount)
{
product.Discount = discount;
}
#endregion
#region Add Product
public static SalesBillItemBO AddProductToGrid(Guid productID, BindingSource bindingSource, Dictionary<BillItemKey, SalesBillItemBO> bill)
{
SalesBillItemBO product;
if ((!bill.ContainsKey(new BillItemKey(productID, true))) && (!bill.ContainsKey(new BillItemKey(productID, false))))
{
//No new or old
product = AddNewProduct(productID, bindingSource, bill);
}
else if (bill.ContainsKey(new BillItemKey(productID, true)))
{
//Has new or both
BillItemKey key = new BillItemKey(productID, true);
bindingSource.CurrencyManager.Position = ProductPosition(key, bill);
product = bill[key];
SetQuantity(product, 1, false);
}
else
{
//Has only old
product = bill[new BillItemKey(productID, false)];
if (product.Additional <= -1)
SetQuantity(product, 1, false);
else if (product.Additional < 0)
{
decimal quantity = 1 + product.Additional;
SetQuantity(product, 1, false);
decimal rate = bill[new BillItemKey(productID, false)].Discount;
decimal discount = bill[new BillItemKey(productID, false)].Price;
product = AddNewProduct(productID, bindingSource, bill);
SetDiscount(product, discount);
SetRate(productID, rate, bill);
SetQuantity(product, quantity, true);
}
else
{
decimal discount = bill[new BillItemKey(productID, false)].Discount;
decimal rate = bill[new BillItemKey(productID, false)].Price;
product = AddNewProduct(productID, bindingSource, bill);
SetDiscount(product, discount);
SetRate(productID, rate, bill);
}
}
return product;
}
private static SalesBillItemBO AddNewProduct(Guid productID, BindingSource bindingSource, Dictionary<BillItemKey, SalesBillItemBO> bill)
{
BillItemKey key = new BillItemKey(productID, true);
SalesBillItemBO product = new SaleVoucherBI().GetDefaultSaleBillItem(productID);
product.Quantity = 1;
bill.Add(key, product);
bindingSource.DataSource = bill.Values;
bindingSource.CurrencyManager.Position = bindingSource.CurrencyManager.Count + 1;
return product;
}
private static int ProductPosition(BillItemKey key, Dictionary<BillItemKey, SalesBillItemBO> bill)
{
for (int i = 0; i < bill.Count; i++)
{
if (bill.Keys.ElementAt(i) == key)
return i;
}
return 0;
}
#endregion
#region Quantity
public static void SetQuantity(SalesBillItemBO product, decimal quantity, bool absolute, bool prompt, BindingSource bindingSource, Dictionary<BillItemKey, SalesBillItemBO> bill)
{
#region Prompt
if (prompt)
{
InputBoxResult result = InputBox.Show("Enter Quantity", "Quantity", (product.Quantity + 1).ToString(), InputBox_Validating);
if (result.OK)
{
if (!decimal.TryParse(result.Text, out quantity))
return;
absolute = true;
}
}
if (quantity == 0)
return;
#endregion
CheckQuantity(product, quantity, absolute);
if (product.Printed == 0)
{
SetQuantity(product, quantity, absolute);
}
else if (bill.ContainsKey(new BillItemKey(product.productID, true)))
{
SalesBillItemBO otherProduct = bill[new BillItemKey(product.productID, true)];
if (absolute)
SetQuantity(otherProduct, quantity - product.Printed, absolute);
else
SetQuantity(otherProduct, quantity, absolute);
}
else
{
if (product.Additional < 0)
{
if (!absolute)
quantity += product.Additional;
product.Quantity = product.Printed;
}
if (absolute)
quantity -= product.Quantity;
if (quantity > 0)
{
SalesBillItemBO otherProduct = AddProductToGrid(product.productID, bindingSource, bill);
SetQuantity(otherProduct, quantity, true);
}
else if ((quantity < 0) && (Thread.CurrentPrincipal.IsInRole("Sales/EditPrintedProduct")))
{
SetQuantity(product, quantity, false);
}
}
}
private static bool CheckQuantity(SalesBillItemBO product, decimal quantity, bool absolute)
{
if (!absolute)
quantity = product.Quantity + quantity;
if (quantity < 0)
return false;
else if ((quantity < product.Printed) && (!Thread.CurrentPrincipal.IsInRole("Sales/EditPrintedProduct")))
return false;
else
return true;
}
private static void SetQuantity(SalesBillItemBO product, decimal quantity, bool absolute)
{
if (!absolute)
{
quantity = product.Quantity + quantity;
}
if (quantity <= 0)
return;
product.Quantity = quantity;
}
#endregion
#region Amount
public static void SetAmount(SalesBillItemBO product, decimal amount, BindingSource bindingSource, Dictionary<BillItemKey, SalesBillItemBO> bill)
{
if (amount == -1)
{
InputBoxResult result = InputBox.Show("Enter Amount", "Amount", (product.Value).ToString(), InputBox_Validating);
if (result.OK)
{
amount = Convert.ToDecimal(result.Text);
}
}
if (amount == -1)
return;
else
{
SetQuantity(product, amount / (product.Price * (1 + product.Tax) * (1 - product.Discount)), true, false, bindingSource, bill);
}
}
#endregion
#region Rate
public static void SetRate(Guid productID, decimal rate, Dictionary<BillItemKey, SalesBillItemBO> bill)
{
if (bill.ContainsKey(new BillItemKey(productID, true)))
bill[new BillItemKey(productID, true)].Price = rate;
if (bill.ContainsKey(new BillItemKey(productID, false)))
bill[new BillItemKey(productID, false)].Price = rate;
}
#endregion
private static void InputBox_Validating(object sender, InputBoxValidatingArgs e)
{
}
}
}

View File

@ -0,0 +1,481 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class Cashier_Checkout_Form
{
/// <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.label18 = new System.Windows.Forms.Label();
this.txtClosingCash = new System.Windows.Forms.TextBox();
this.dtpFinish = new System.Windows.Forms.DateTimePicker();
this.dtpStart = new System.Windows.Forms.DateTimePicker();
this.label17 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.btnCalculate = new System.Windows.Forms.Button();
this.btnPrint = new System.Windows.Forms.Button();
this.txtStatus = new System.Windows.Forms.TextBox();
this.txtSales = new System.Windows.Forms.TextBox();
this.txtDeposited = new System.Windows.Forms.TextBox();
this.txtPending = new System.Windows.Forms.TextBox();
this.cmbCashier = new System.Windows.Forms.ComboBox();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtPayments = new System.Windows.Forms.TextBox();
this.txtAdvanceAdjusted = new System.Windows.Forms.TextBox();
this.txtCCReceipts = new System.Windows.Forms.TextBox();
this.txtAdditionalVoids = new System.Windows.Forms.TextBox();
this.txtVoidsInSystem = new System.Windows.Forms.TextBox();
this.txtDiscounts = new System.Windows.Forms.TextBox();
this.txtRates = new System.Windows.Forms.TextBox();
this.txtAdvanceReceived = new System.Windows.Forms.TextBox();
this.txtReceipts = new System.Windows.Forms.TextBox();
this.txtOpening = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(12, 380);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(68, 13);
this.label18.TabIndex = 71;
this.label18.Text = "Closing Cash";
//
// txtClosingCash
//
this.txtClosingCash.Location = new System.Drawing.Point(99, 377);
this.txtClosingCash.Name = "txtClosingCash";
this.txtClosingCash.ReadOnly = true;
this.txtClosingCash.Size = new System.Drawing.Size(200, 20);
this.txtClosingCash.TabIndex = 55;
//
// dtpFinish
//
this.dtpFinish.Location = new System.Drawing.Point(189, 12);
this.dtpFinish.Name = "dtpFinish";
this.dtpFinish.Size = new System.Drawing.Size(110, 20);
this.dtpFinish.TabIndex = 42;
this.dtpFinish.ValueChanged += new System.EventHandler(this.dtpFinish_ValueChanged);
//
// dtpStart
//
this.dtpStart.Location = new System.Drawing.Point(15, 11);
this.dtpStart.Name = "dtpStart";
this.dtpStart.Size = new System.Drawing.Size(110, 20);
this.dtpStart.TabIndex = 41;
this.dtpStart.ValueChanged += new System.EventHandler(this.dtpStart_ValueChanged);
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(12, 276);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(85, 13);
this.label17.TabIndex = 67;
this.label17.Text = "Discounts Given";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(12, 302);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(81, 13);
this.label16.TabIndex = 68;
this.label16.Text = "Rates Changed";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(12, 354);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(53, 13);
this.label15.TabIndex = 70;
this.label15.Text = "Net Sales";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(12, 406);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(82, 13);
this.label14.TabIndex = 72;
this.label14.Text = "Cash Deposited";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(12, 432);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(37, 13);
this.label13.TabIndex = 73;
this.label13.Text = "Status";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(12, 328);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(62, 13);
this.label12.TabIndex = 69;
this.label12.Text = "Bill Pending";
//
// btnCalculate
//
this.btnCalculate.Location = new System.Drawing.Point(12, 455);
this.btnCalculate.Name = "btnCalculate";
this.btnCalculate.Size = new System.Drawing.Size(287, 23);
this.btnCalculate.TabIndex = 39;
this.btnCalculate.Text = "&Calculate";
this.btnCalculate.UseVisualStyleBackColor = true;
this.btnCalculate.Click += new System.EventHandler(this.btnCalculate_Click);
//
// btnPrint
//
this.btnPrint.Location = new System.Drawing.Point(12, 484);
this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(287, 23);
this.btnPrint.TabIndex = 40;
this.btnPrint.Text = "&Print";
this.btnPrint.UseVisualStyleBackColor = true;
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// txtStatus
//
this.txtStatus.Location = new System.Drawing.Point(99, 429);
this.txtStatus.Name = "txtStatus";
this.txtStatus.ReadOnly = true;
this.txtStatus.Size = new System.Drawing.Size(200, 20);
this.txtStatus.TabIndex = 56;
//
// txtSales
//
this.txtSales.Location = new System.Drawing.Point(99, 351);
this.txtSales.Name = "txtSales";
this.txtSales.ReadOnly = true;
this.txtSales.Size = new System.Drawing.Size(200, 20);
this.txtSales.TabIndex = 54;
this.txtSales.TextChanged += new System.EventHandler(this.txtSales_TextChanged);
//
// txtDeposited
//
this.txtDeposited.Location = new System.Drawing.Point(99, 403);
this.txtDeposited.Name = "txtDeposited";
this.txtDeposited.Size = new System.Drawing.Size(200, 20);
this.txtDeposited.TabIndex = 38;
//
// txtPending
//
this.txtPending.Location = new System.Drawing.Point(99, 325);
this.txtPending.Name = "txtPending";
this.txtPending.ReadOnly = true;
this.txtPending.Size = new System.Drawing.Size(200, 20);
this.txtPending.TabIndex = 53;
//
// cmbCashier
//
this.cmbCashier.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCashier.FormattingEnabled = true;
this.cmbCashier.Location = new System.Drawing.Point(99, 38);
this.cmbCashier.Name = "cmbCashier";
this.cmbCashier.Size = new System.Drawing.Size(200, 21);
this.cmbCashier.TabIndex = 37;
this.cmbCashier.SelectedIndexChanged += new System.EventHandler(this.cmbCashier_SelectedIndexChanged);
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(128, 15);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(54, 13);
this.label10.TabIndex = 57;
this.label10.Text = "<- Date ->";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(12, 41);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(42, 13);
this.label9.TabIndex = 58;
this.label9.Text = "Cashier";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(12, 250);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(81, 13);
this.label8.TabIndex = 66;
this.label8.Text = "Voids in System";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(12, 224);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(82, 13);
this.label7.TabIndex = 65;
this.label7.Text = "Additional Voids";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(12, 198);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(53, 13);
this.label6.TabIndex = 64;
this.label6.Text = "Payments";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(12, 172);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(73, 13);
this.label5.TabIndex = 63;
this.label5.Text = "Adv. Adjusted";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 146);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 13);
this.label4.TabIndex = 62;
this.label4.Text = "CC Receipts";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 120);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(78, 13);
this.label3.TabIndex = 61;
this.label3.Text = "Adv. Received";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 94);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(49, 13);
this.label2.TabIndex = 60;
this.label2.Text = "Receipts";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 68);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 13);
this.label1.TabIndex = 59;
this.label1.Text = "Opening";
//
// txtPayments
//
this.txtPayments.Location = new System.Drawing.Point(99, 195);
this.txtPayments.Name = "txtPayments";
this.txtPayments.ReadOnly = true;
this.txtPayments.Size = new System.Drawing.Size(200, 20);
this.txtPayments.TabIndex = 48;
//
// txtAdvanceAdjusted
//
this.txtAdvanceAdjusted.Location = new System.Drawing.Point(99, 169);
this.txtAdvanceAdjusted.Name = "txtAdvanceAdjusted";
this.txtAdvanceAdjusted.ReadOnly = true;
this.txtAdvanceAdjusted.Size = new System.Drawing.Size(200, 20);
this.txtAdvanceAdjusted.TabIndex = 47;
//
// txtCCReceipts
//
this.txtCCReceipts.Location = new System.Drawing.Point(99, 143);
this.txtCCReceipts.Name = "txtCCReceipts";
this.txtCCReceipts.ReadOnly = true;
this.txtCCReceipts.Size = new System.Drawing.Size(200, 20);
this.txtCCReceipts.TabIndex = 46;
//
// txtAdditionalVoids
//
this.txtAdditionalVoids.Location = new System.Drawing.Point(99, 221);
this.txtAdditionalVoids.Name = "txtAdditionalVoids";
this.txtAdditionalVoids.ReadOnly = true;
this.txtAdditionalVoids.Size = new System.Drawing.Size(200, 20);
this.txtAdditionalVoids.TabIndex = 49;
//
// txtVoidsInSystem
//
this.txtVoidsInSystem.Location = new System.Drawing.Point(99, 247);
this.txtVoidsInSystem.Name = "txtVoidsInSystem";
this.txtVoidsInSystem.ReadOnly = true;
this.txtVoidsInSystem.Size = new System.Drawing.Size(200, 20);
this.txtVoidsInSystem.TabIndex = 50;
//
// txtDiscounts
//
this.txtDiscounts.Location = new System.Drawing.Point(99, 273);
this.txtDiscounts.Name = "txtDiscounts";
this.txtDiscounts.ReadOnly = true;
this.txtDiscounts.Size = new System.Drawing.Size(200, 20);
this.txtDiscounts.TabIndex = 51;
//
// txtRates
//
this.txtRates.Location = new System.Drawing.Point(99, 299);
this.txtRates.Name = "txtRates";
this.txtRates.ReadOnly = true;
this.txtRates.Size = new System.Drawing.Size(200, 20);
this.txtRates.TabIndex = 52;
//
// txtAdvanceReceived
//
this.txtAdvanceReceived.Location = new System.Drawing.Point(99, 117);
this.txtAdvanceReceived.Name = "txtAdvanceReceived";
this.txtAdvanceReceived.ReadOnly = true;
this.txtAdvanceReceived.Size = new System.Drawing.Size(200, 20);
this.txtAdvanceReceived.TabIndex = 45;
//
// txtReceipts
//
this.txtReceipts.Location = new System.Drawing.Point(99, 91);
this.txtReceipts.Name = "txtReceipts";
this.txtReceipts.ReadOnly = true;
this.txtReceipts.Size = new System.Drawing.Size(200, 20);
this.txtReceipts.TabIndex = 44;
//
// txtOpening
//
this.txtOpening.Location = new System.Drawing.Point(99, 65);
this.txtOpening.Name = "txtOpening";
this.txtOpening.ReadOnly = true;
this.txtOpening.Size = new System.Drawing.Size(200, 20);
this.txtOpening.TabIndex = 43;
//
// Cashier_Checkout_Form
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(311, 519);
this.Controls.Add(this.label18);
this.Controls.Add(this.txtClosingCash);
this.Controls.Add(this.dtpFinish);
this.Controls.Add(this.dtpStart);
this.Controls.Add(this.label17);
this.Controls.Add(this.label16);
this.Controls.Add(this.label15);
this.Controls.Add(this.label14);
this.Controls.Add(this.label13);
this.Controls.Add(this.label12);
this.Controls.Add(this.btnCalculate);
this.Controls.Add(this.btnPrint);
this.Controls.Add(this.txtStatus);
this.Controls.Add(this.txtSales);
this.Controls.Add(this.txtDeposited);
this.Controls.Add(this.txtPending);
this.Controls.Add(this.cmbCashier);
this.Controls.Add(this.label10);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtPayments);
this.Controls.Add(this.txtAdvanceAdjusted);
this.Controls.Add(this.txtCCReceipts);
this.Controls.Add(this.txtAdditionalVoids);
this.Controls.Add(this.txtVoidsInSystem);
this.Controls.Add(this.txtDiscounts);
this.Controls.Add(this.txtRates);
this.Controls.Add(this.txtAdvanceReceived);
this.Controls.Add(this.txtReceipts);
this.Controls.Add(this.txtOpening);
this.MaximizeBox = false;
this.Name = "Cashier_Checkout_Form";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Cashier Checkout Form";
this.Load += new System.EventHandler(this.Cashier_Checkout_Form_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label18;
private System.Windows.Forms.TextBox txtClosingCash;
private System.Windows.Forms.DateTimePicker dtpFinish;
private System.Windows.Forms.DateTimePicker dtpStart;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Button btnCalculate;
private System.Windows.Forms.Button btnPrint;
private System.Windows.Forms.TextBox txtStatus;
private System.Windows.Forms.TextBox txtSales;
private System.Windows.Forms.TextBox txtDeposited;
private System.Windows.Forms.TextBox txtPending;
private System.Windows.Forms.ComboBox cmbCashier;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtPayments;
private System.Windows.Forms.TextBox txtAdvanceAdjusted;
private System.Windows.Forms.TextBox txtCCReceipts;
private System.Windows.Forms.TextBox txtAdditionalVoids;
private System.Windows.Forms.TextBox txtVoidsInSystem;
private System.Windows.Forms.TextBox txtDiscounts;
private System.Windows.Forms.TextBox txtRates;
private System.Windows.Forms.TextBox txtAdvanceReceived;
private System.Windows.Forms.TextBox txtReceipts;
private System.Windows.Forms.TextBox txtOpening;
}
}

View File

@ -0,0 +1,94 @@
using System;
using System.Windows.Forms;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Print;
using Tanshu.Accounts.Helpers;
namespace Tanshu.Accounts.PointOfSale
{
public partial class Cashier_Checkout_Form : Form
{
CheckoutBI coProxy;
private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public Cashier_Checkout_Form()
{
InitializeComponent();
}
private void Cashier_Checkout_Form_Load(object sender, EventArgs e)
{
dtpStart.Format = DateTimePickerFormat.Custom;
dtpStart.CustomFormat = "dd-MMM-yyyy HH:mm:ss";
dtpStart.Value = DateTime.Now;
dtpFinish.Format = DateTimePickerFormat.Custom;
dtpFinish.CustomFormat = "dd-MMM-yyyy HH:mm:ss";
dtpFinish.Value = DateTime.Now;
FillUsers();
}
private void FillUsers()
{
cmbCashier.DisplayMember = "Name";
cmbCashier.ValueMember = "UserID";
cmbCashier.DataSource = new UserBI().GetUsers();
}
private void cmbCashier_SelectedIndexChanged(object sender, EventArgs e)
{
EmployeeStatus();
log.Warn(string.Format("User Checkout: {0} by {1}", coProxy.Cashier, CurrentUser.user.Name));
}
private void EmployeeStatus()
{
if (cmbCashier.SelectedValue == null)
return;
dtpStart.Value = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 00:00:00", dtpStart.Value));
dtpFinish.Value = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 23:59:59", dtpFinish.Value));
coProxy = new CheckoutBI((Guid)cmbCashier.SelectedValue, dtpStart.Value, dtpFinish.Value);
txtOpening.Text = coProxy.Opening.ToString();
txtReceipts.Text = coProxy.Receipts.ToString();
txtAdvanceReceived.Text = coProxy.AdvanceReceipts.ToString();
txtCCReceipts.Text = coProxy.CCReceipts.ToString();
txtAdvanceAdjusted.Text = coProxy.AdvanceAdjusted.ToString();
txtPayments.Text = coProxy.CashPayments.ToString();
txtAdditionalVoids.Text = coProxy.AdditionalVoids.ToString();
txtVoidsInSystem.Text = coProxy.VoidsInSystem.ToString();
txtPending.Text = coProxy.PendingBills.ToString();
txtSales.Text = coProxy.NetSales.ToString();
txtClosingCash.Text = coProxy.ClosingBalance.ToString();
txtStatus.Text = coProxy.Status;
}
private void dtpStart_ValueChanged(object sender, EventArgs e)
{
EmployeeStatus();
}
private void dtpFinish_ValueChanged(object sender, EventArgs e)
{
EmployeeStatus();
}
private void btnCalculate_Click(object sender, EventArgs e)
{
decimal deposited = 0;
if (!decimal.TryParse(txtDeposited.Text, out deposited))
deposited = 0;
coProxy.Calculate(deposited, 0);
txtStatus.Text = coProxy.Status;
}
private void btnPrint_Click(object sender, EventArgs e)
{
Thermal.PrintClosing(coProxy);
}
private void txtSales_TextChanged(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,259 @@
 namespace Tanshu.Accounts.PointOfSale
{
partial class CustomersForm
{
/// <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();
this.chkImportant = new System.Windows.Forms.CheckBox();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtPhone = new System.Windows.Forms.TextBox();
this.txtAddress = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.cmbLedger = new System.Windows.Forms.ComboBox();
this.bsLedgers = new System.Windows.Forms.BindingSource(this.components);
this.label2 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.btnSave = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.Label1 = new System.Windows.Forms.Label();
this.txtUniqueID = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.bsLedgers)).BeginInit();
this.SuspendLayout();
//
// chkImportant
//
this.chkImportant.AutoSize = true;
this.chkImportant.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.chkImportant.Location = new System.Drawing.Point(29, 292);
this.chkImportant.Name = "chkImportant";
this.chkImportant.Size = new System.Drawing.Size(70, 17);
this.chkImportant.TabIndex = 4;
this.chkImportant.Text = "Important";
this.chkImportant.UseVisualStyleBackColor = true;
//
// txtRemarks
//
this.txtRemarks.Location = new System.Drawing.Point(81, 208);
this.txtRemarks.Multiline = true;
this.txtRemarks.Name = "txtRemarks";
this.txtRemarks.Size = new System.Drawing.Size(292, 78);
this.txtRemarks.TabIndex = 3;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(18, 94);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(58, 13);
this.label6.TabIndex = 11;
this.label6.Text = "Phone No.";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(30, 120);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(45, 13);
this.label5.TabIndex = 12;
this.label5.Text = "Address";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(26, 211);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(49, 13);
this.label4.TabIndex = 13;
this.label4.Text = "Remarks";
//
// txtPhone
//
this.txtPhone.Location = new System.Drawing.Point(81, 91);
this.txtPhone.Name = "txtPhone";
this.txtPhone.Size = new System.Drawing.Size(292, 20);
this.txtPhone.TabIndex = 1;
//
// txtAddress
//
this.txtAddress.Location = new System.Drawing.Point(81, 117);
this.txtAddress.Multiline = true;
this.txtAddress.Name = "txtAddress";
this.txtAddress.Size = new System.Drawing.Size(292, 85);
this.txtAddress.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(35, 67);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(40, 13);
this.label3.TabIndex = 10;
this.label3.Text = "Ledger";
//
// cmbLedger
//
this.cmbLedger.DataSource = this.bsLedgers;
this.cmbLedger.DisplayMember = "Name";
this.cmbLedger.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbLedger.FormattingEnabled = true;
this.cmbLedger.Location = new System.Drawing.Point(81, 64);
this.cmbLedger.Name = "cmbLedger";
this.cmbLedger.Size = new System.Drawing.Size(292, 21);
this.cmbLedger.TabIndex = 15;
this.cmbLedger.ValueMember = "LedgerID";
//
// bsLedgers
//
this.bsLedgers.DataSource = typeof(Tanshu.Accounts.Contracts.LedgerBO);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(40, 41);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 13);
this.label2.TabIndex = 9;
this.label2.Text = "Name";
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(81, 38);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(292, 20);
this.txtName.TabIndex = 0;
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(12, 315);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 5;
this.btnSave.Text = "&Save";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnDelete
//
this.btnDelete.Location = new System.Drawing.Point(93, 315);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(75, 23);
this.btnDelete.TabIndex = 6;
this.btnDelete.Text = "&Delete";
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnCancel
//
this.btnCancel.AccessibleName = "Done";
this.btnCancel.Location = new System.Drawing.Point(301, 315);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(72, 24);
this.btnCancel.TabIndex = 7;
this.btnCancel.Text = "&Cancel";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// Label1
//
this.Label1.AutoSize = true;
this.Label1.Location = new System.Drawing.Point(43, 15);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(32, 13);
this.Label1.TabIndex = 8;
this.Label1.Text = "Code";
this.Label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// txtUniqueID
//
this.txtUniqueID.AccessibleName = "Unique ID";
this.txtUniqueID.Enabled = false;
this.txtUniqueID.Location = new System.Drawing.Point(81, 12);
this.txtUniqueID.Name = "txtUniqueID";
this.txtUniqueID.ReadOnly = true;
this.txtUniqueID.Size = new System.Drawing.Size(292, 20);
this.txtUniqueID.TabIndex = 14;
this.txtUniqueID.Text = "UniqueID";
this.txtUniqueID.WordWrap = false;
//
// CustomersForm
//
this.AcceptButton = this.btnSave;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(385, 346);
this.Controls.Add(this.Label1);
this.Controls.Add(this.txtUniqueID);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.btnDelete);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.chkImportant);
this.Controls.Add(this.txtRemarks);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.txtPhone);
this.Controls.Add(this.txtAddress);
this.Controls.Add(this.label3);
this.Controls.Add(this.cmbLedger);
this.Controls.Add(this.label2);
this.Controls.Add(this.txtName);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "CustomersForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Customers";
this.Load += new System.EventHandler(this.CustomersForm_Load);
((System.ComponentModel.ISupportInitialize)(this.bsLedgers)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox chkImportant;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtPhone;
private System.Windows.Forms.TextBox txtAddress;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox cmbLedger;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtName;
internal System.Windows.Forms.Button btnSave;
internal System.Windows.Forms.Button btnDelete;
internal System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.BindingSource bsLedgers;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.TextBox txtUniqueID;
}
}

View File

@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;
using Tanshu.Accounts.Helpers;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.PointOfSale
{
public partial class CustomersForm : Form
{
private Guid? customerID;
private CustomerBO customer;
private string phone;
#region Form Load
public CustomersForm(Guid? customerID, string phone)
{
InitializeComponent();
this.customerID = customerID;
this.phone = phone;
}
private void CustomersForm_Load(object sender, EventArgs e)
{
bsLedgers.DataSource = new CustomerBI().GetCustomerLedgers();
if (customerID.HasValue)
{
customer = new CustomerBI().GetCustomer(customerID.Value);
btnDelete.Enabled = true;
txtName.Text = customer.Name;
cmbLedger.SelectedValue = customer.LedgerID;
txtPhone.Text = customer.Phone;
txtAddress.Text = customer.Address;
txtRemarks.Text = customer.Remarks;
chkImportant.Checked = customer.Important;
}
else
txtPhone.Text = phone;
btnSave.Text = customerID.HasValue ? "&Update" : "&Save";
}
#endregion
#region Buttons
private void btnSave_Click(object sender, EventArgs e)
{
if (!ValidateValues())
{
MessageBox.Show("Missing Information: Please check the form.");
txtName.Focus();
}
else
{
Save();
btnCancel_Click(sender, e);
}
}
private void btnDelete_Click(object sender, EventArgs e)
{
new CustomerBI().Delete(customer.CustomerID);
btnCancel_Click(sender, e);
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
#endregion
#region Add / Edit / Delete
private bool ValidateValues()
{
bool returnType = true;
if (txtName.Text.Trim().Length > 0)
{
if (cmbLedger.SelectedValue == null)
return false;
}
else
return false;
return returnType;
}
private void Save()
{
if (customer == null)
customer = new CustomerBO();
UserBO user = CurrentUser.user;
customer.Name = txtName.Text;
customer.LedgerID = (Guid)cmbLedger.SelectedValue;
customer.Phone = txtPhone.Text;
customer.Address = txtAddress.Text;
customer.Remarks = txtRemarks.Text;
customer.Important = chkImportant.Checked;
if (customer.CustomerID == new Guid())
new CustomerBI().Insert(customer);
else
new CustomerBI().Update(customer);
}
private bool Delete(Guid customerID)
{
return new CustomerBI().Delete(customerID);
}
#endregion
public CustomerBO Customer
{
get { return customer; }
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="bsLedgers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="bsLedgers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,318 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class PaymentForm
{
/// <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();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.btnAdd = new System.Windows.Forms.Button();
this.Label7 = new System.Windows.Forms.Label();
this.txtNarration = new System.Windows.Forms.TextBox();
this.Label6 = new System.Windows.Forms.Label();
this.txtAmount = new System.Windows.Forms.TextBox();
this.lblAmount = new System.Windows.Forms.Label();
this.txtCashier = new System.Windows.Forms.TextBox();
this.Label3 = new System.Windows.Forms.Label();
this.Label2 = new System.Windows.Forms.Label();
this.Label1 = new System.Windows.Forms.Label();
this.cmbType = new System.Windows.Forms.ComboBox();
this.dtpTo = new System.Windows.Forms.DateTimePicker();
this.dtpFrom = new System.Windows.Forms.DateTimePicker();
this.dgvPayments = new System.Windows.Forms.DataGridView();
this.dateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.typeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.amountDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Narration = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Cashier = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.bindingSource = new System.Windows.Forms.BindingSource(this.components);
this.btnDelete = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvPayments)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit();
this.SuspendLayout();
//
// btnAdd
//
this.btnAdd.Location = new System.Drawing.Point(68, 117);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(75, 21);
this.btnAdd.TabIndex = 108;
this.btnAdd.Text = "&Add";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// Label7
//
this.Label7.AutoSize = true;
this.Label7.Location = new System.Drawing.Point(12, 94);
this.Label7.Name = "Label7";
this.Label7.Size = new System.Drawing.Size(50, 13);
this.Label7.TabIndex = 107;
this.Label7.Text = "Narration";
//
// txtNarration
//
this.txtNarration.Location = new System.Drawing.Point(68, 91);
this.txtNarration.Name = "txtNarration";
this.txtNarration.Size = new System.Drawing.Size(322, 20);
this.txtNarration.TabIndex = 106;
//
// Label6
//
this.Label6.AutoSize = true;
this.Label6.Location = new System.Drawing.Point(195, 67);
this.Label6.Name = "Label6";
this.Label6.Size = new System.Drawing.Size(44, 13);
this.Label6.TabIndex = 104;
this.Label6.Text = "Reason";
//
// txtAmount
//
this.txtAmount.Location = new System.Drawing.Point(68, 64);
this.txtAmount.Name = "txtAmount";
this.txtAmount.Size = new System.Drawing.Size(121, 20);
this.txtAmount.TabIndex = 103;
//
// lblAmount
//
this.lblAmount.AutoSize = true;
this.lblAmount.Location = new System.Drawing.Point(12, 67);
this.lblAmount.Name = "lblAmount";
this.lblAmount.Size = new System.Drawing.Size(43, 13);
this.lblAmount.TabIndex = 102;
this.lblAmount.Text = "Amount";
//
// txtCashier
//
this.txtCashier.Location = new System.Drawing.Point(68, 38);
this.txtCashier.Name = "txtCashier";
this.txtCashier.ReadOnly = true;
this.txtCashier.Size = new System.Drawing.Size(322, 20);
this.txtCashier.TabIndex = 101;
//
// Label3
//
this.Label3.AutoSize = true;
this.Label3.Location = new System.Drawing.Point(12, 41);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(42, 13);
this.Label3.TabIndex = 100;
this.Label3.Text = "Cashier";
//
// Label2
//
this.Label2.AutoSize = true;
this.Label2.Location = new System.Drawing.Point(219, 16);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(20, 13);
this.Label2.TabIndex = 97;
this.Label2.Text = "To";
//
// Label1
//
this.Label1.AutoSize = true;
this.Label1.Location = new System.Drawing.Point(12, 16);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(30, 13);
this.Label1.TabIndex = 95;
this.Label1.Text = "From";
//
// cmbType
//
this.cmbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbType.Items.AddRange(new object[] {
"Opening",
"Receipt",
"Payment",
"Additional Void",
"Retained at Night",
"Own in Pocket"});
this.cmbType.Location = new System.Drawing.Point(245, 64);
this.cmbType.Name = "cmbType";
this.cmbType.Size = new System.Drawing.Size(145, 21);
this.cmbType.TabIndex = 105;
//
// dtpTo
//
this.dtpTo.CustomFormat = "dd-MMM-yyyy";
this.dtpTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpTo.Location = new System.Drawing.Point(245, 12);
this.dtpTo.Name = "dtpTo";
this.dtpTo.Size = new System.Drawing.Size(145, 20);
this.dtpTo.TabIndex = 98;
this.dtpTo.ValueChanged += new System.EventHandler(this.dtpTo_ValueChanged);
//
// dtpFrom
//
this.dtpFrom.CustomFormat = "dd-MMM-yyyy";
this.dtpFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpFrom.Location = new System.Drawing.Point(68, 12);
this.dtpFrom.Name = "dtpFrom";
this.dtpFrom.Size = new System.Drawing.Size(132, 20);
this.dtpFrom.TabIndex = 96;
this.dtpFrom.ValueChanged += new System.EventHandler(this.dtpFrom_ValueChanged);
//
// dgvPayments
//
this.dgvPayments.AllowUserToAddRows = false;
this.dgvPayments.AllowUserToDeleteRows = false;
this.dgvPayments.AllowUserToResizeRows = false;
this.dgvPayments.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvPayments.AutoGenerateColumns = false;
this.dgvPayments.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
this.dgvPayments.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPayments.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dateDataGridViewTextBoxColumn,
this.typeDataGridViewTextBoxColumn,
this.amountDataGridViewTextBoxColumn,
this.Narration,
this.Cashier});
this.dgvPayments.DataSource = this.bindingSource;
this.dgvPayments.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dgvPayments.Location = new System.Drawing.Point(12, 144);
this.dgvPayments.Name = "dgvPayments";
this.dgvPayments.ReadOnly = true;
this.dgvPayments.RowHeadersVisible = false;
this.dgvPayments.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvPayments.Size = new System.Drawing.Size(378, 380);
this.dgvPayments.TabIndex = 110;
//
// dateDataGridViewTextBoxColumn
//
this.dateDataGridViewTextBoxColumn.DataPropertyName = "Date";
this.dateDataGridViewTextBoxColumn.HeaderText = "Date";
this.dateDataGridViewTextBoxColumn.Name = "dateDataGridViewTextBoxColumn";
this.dateDataGridViewTextBoxColumn.ReadOnly = true;
this.dateDataGridViewTextBoxColumn.Width = 55;
//
// typeDataGridViewTextBoxColumn
//
this.typeDataGridViewTextBoxColumn.DataPropertyName = "Type";
this.typeDataGridViewTextBoxColumn.HeaderText = "Type";
this.typeDataGridViewTextBoxColumn.Name = "typeDataGridViewTextBoxColumn";
this.typeDataGridViewTextBoxColumn.ReadOnly = true;
this.typeDataGridViewTextBoxColumn.Width = 56;
//
// amountDataGridViewTextBoxColumn
//
this.amountDataGridViewTextBoxColumn.DataPropertyName = "Amount";
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle1.Format = "N2";
dataGridViewCellStyle1.NullValue = "-";
this.amountDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1;
this.amountDataGridViewTextBoxColumn.HeaderText = "Amount";
this.amountDataGridViewTextBoxColumn.Name = "amountDataGridViewTextBoxColumn";
this.amountDataGridViewTextBoxColumn.ReadOnly = true;
this.amountDataGridViewTextBoxColumn.Width = 68;
//
// Narration
//
this.Narration.DataPropertyName = "Narration";
this.Narration.HeaderText = "Narration";
this.Narration.Name = "Narration";
this.Narration.ReadOnly = true;
this.Narration.Width = 75;
//
// Cashier
//
this.Cashier.DataPropertyName = "Cashier";
this.Cashier.HeaderText = "Cashier";
this.Cashier.Name = "Cashier";
this.Cashier.ReadOnly = true;
this.Cashier.Width = 67;
//
// bindingSource
//
this.bindingSource.DataSource = typeof(Tanshu.Accounts.Contracts.PaymentDisplayBO);
//
// btnDelete
//
this.btnDelete.Location = new System.Drawing.Point(315, 117);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(75, 21);
this.btnDelete.TabIndex = 109;
this.btnDelete.Text = "&Delete";
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// PaymentFrom
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(402, 536);
this.Controls.Add(this.dgvPayments);
this.Controls.Add(this.btnDelete);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.Label7);
this.Controls.Add(this.txtNarration);
this.Controls.Add(this.Label6);
this.Controls.Add(this.txtAmount);
this.Controls.Add(this.lblAmount);
this.Controls.Add(this.txtCashier);
this.Controls.Add(this.Label3);
this.Controls.Add(this.Label2);
this.Controls.Add(this.Label1);
this.Controls.Add(this.cmbType);
this.Controls.Add(this.dtpTo);
this.Controls.Add(this.dtpFrom);
this.MaximizeBox = false;
this.Name = "PaymentFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Payments";
this.Load += new System.EventHandler(this.PaymentForm_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvPayments)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
internal System.Windows.Forms.Button btnAdd;
internal System.Windows.Forms.Label Label7;
internal System.Windows.Forms.TextBox txtNarration;
internal System.Windows.Forms.Label Label6;
internal System.Windows.Forms.TextBox txtAmount;
internal System.Windows.Forms.Label lblAmount;
internal System.Windows.Forms.TextBox txtCashier;
internal System.Windows.Forms.Label Label3;
internal System.Windows.Forms.Label Label2;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.ComboBox cmbType;
internal System.Windows.Forms.DateTimePicker dtpTo;
internal System.Windows.Forms.DateTimePicker dtpFrom;
private System.Windows.Forms.DataGridView dgvPayments;
private System.Windows.Forms.BindingSource bindingSource;
internal System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.DataGridViewTextBoxColumn dateDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn typeDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn amountDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn Narration;
private System.Windows.Forms.DataGridViewTextBoxColumn Cashier;
}
}

View File

@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Helpers;
namespace Tanshu.Accounts.PointOfSale
{
public partial class PaymentForm : Form
{
List<PaymentDisplayBO> paymentList = new List<PaymentDisplayBO>();
public PaymentForm()
{
InitializeComponent();
}
private void btnAdd_Click(object sender, EventArgs e)
{
UserBO user = CurrentUser.user;
if (txtAmount.Text == "0" || cmbType.Text == "")
{
System.Windows.Forms.MessageBox.Show("Amount can't be blank", "Blank not Allowed");
}
else
{
PaymentBO paymentEntry = new PaymentBO();
paymentEntry.Date = DateTime.Now;
paymentEntry.Type = cmbType.Text;
paymentEntry.CashierID = user.UserID;
paymentEntry.Amount = Convert.ToDecimal(txtAmount.Text);
paymentEntry.Narration = txtNarration.Text;
new PaymentBI().Insert(paymentEntry);
}
GridBind();
}
private void PaymentForm_Load(object sender, EventArgs e)
{
UserBO user = CurrentUser.user;
dtpFrom.Value = DateTime.Today;
dtpTo.Value = DateTime.Today;
GridBind();
txtCashier.Text = user.Name;
txtCashier.Tag = user.UserID;
}
private void btnDelete_Click(object sender, EventArgs e)
{
if (!Thread.CurrentPrincipal.IsInRole("Payment/Delete"))
MessageBox.Show("You are not authorized to access");
else
{
UserBO user = CurrentUser.user;
if (dgvPayments.SelectedRows.Count <= 0)
return;
Guid paymentID = ((PaymentDisplayBO)bindingSource.Current).PaymentID;
new PaymentBI().Delete(paymentID);
GridBind();
}
}
private void GridBind()
{
Guid? userID;
if (!Thread.CurrentPrincipal.IsInRole("Payment/SeeAll"))
userID = null;
else
{
userID = CurrentUser.user.UserID;
}
paymentList = new PaymentBI().GetPayments(userID, dtpFrom.Value, dtpTo.Value);
bindingSource.DataSource = paymentList;
}
private void dtpFrom_ValueChanged(object sender, EventArgs e)
{
GridBind();
}
private void dtpTo_ValueChanged(object sender, EventArgs e)
{
GridBind();
}
}
}

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="Narration.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Cashier.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Tanshu.Accounts.Helpers;
using Tanshu.Accounts.Print;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.BI;
namespace Tanshu.Accounts.PointOfSale
{
public partial class RecieveAdvanceForm : Form
{
bool loading = true;
public RecieveAdvanceForm()
{
InitializeComponent();
}
private void btnAdd_Click(object sender, EventArgs e)
{
if (Convert.ToDecimal(txtAmount.Text) == 0)
return;
AdvanceBO adv = new AdvanceBO();
adv.Narration = txtNarration.Text;
adv.Amount = Convert.ToDecimal(txtAmount.Text.Trim());
adv.CashierIn = new Guid(txtCashier.Tag.ToString());
adv.DateIn = DateTime.Now;
new AdvanceBI().Insert(adv);
GridBind();
PrintAdvances();
}
private void RecieveAdvanceForm_Load(object sender, EventArgs e)
{
dtpFrom.Format = DateTimePickerFormat.Custom;
dtpFrom.CustomFormat = "dd-MMM-yyyy";
dtpFrom.Value = DateTime.Now;
dtpTo.Format = DateTimePickerFormat.Custom;
dtpTo.CustomFormat = "dd-MMM-yyyy";
dtpTo.Value = DateTime.Now;
txtCashier.Text = CurrentUser.user.Name;
txtCashier.Tag = CurrentUser.user.UserID;
loading = false;
GridBind();
}
private void GridBind()
{
List<AdvanceDisplayBO> advance = new AdvanceBI().GetAdvances(dtpFrom.Value, dtpTo.Value, true);
dgExpenses.DataSource = advance;
}
private void dtpFrom_ValueChanged(object sender, EventArgs e)
{
if (!loading)
GridBind();
}
private void PrintAdvances()
{
Thermal.PrintAdvance(txtAmount.Text.Trim(), txtNarration.Text.Trim());
}
private string AddDate(string SqlStringP, DateTime FromDate, DateTime ToDate)
{
return SqlStringP.Replace("$From$", string.Format(FromDate.ToString(), "dd-MMM-yyyy" + " 05:00:00")).Replace("$To$", string.Format(ToDate.ToString(), "dd-MMM-yyyy" + " 23:59:59"));
}
private void txtAmount_TextChanged(object sender, EventArgs e)
{
}
private void txtAmount_Leave(object sender, EventArgs e)
{
if (txtAmount.Text.Trim() == "")
{
txtAmount.Focus();
}
}
}
}

View File

@ -0,0 +1,258 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class RecieveAdvanceForm
{
/// <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.btnAdd = new System.Windows.Forms.Button();
this.Label7 = new System.Windows.Forms.Label();
this.txtNarration = new System.Windows.Forms.TextBox();
this.txtAmount = new System.Windows.Forms.TextBox();
this.lblAmount = new System.Windows.Forms.Label();
this.txtCashier = new System.Windows.Forms.TextBox();
this.Label5 = new System.Windows.Forms.Label();
this.txtVoid = new System.Windows.Forms.TextBox();
this.txtAmt = new System.Windows.Forms.TextBox();
this.Label4 = new System.Windows.Forms.Label();
this.Label3 = new System.Windows.Forms.Label();
this.Label2 = new System.Windows.Forms.Label();
this.Label1 = new System.Windows.Forms.Label();
this.dtpTo = new System.Windows.Forms.DateTimePicker();
this.dtpFrom = new System.Windows.Forms.DateTimePicker();
this.dgExpenses = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dgExpenses)).BeginInit();
this.SuspendLayout();
//
// btnAdd
//
this.btnAdd.Location = new System.Drawing.Point(60, 115);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(75, 21);
this.btnAdd.TabIndex = 109;
this.btnAdd.Text = "&Add";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// Label7
//
this.Label7.AutoSize = true;
this.Label7.Location = new System.Drawing.Point(12, 92);
this.Label7.Name = "Label7";
this.Label7.Size = new System.Drawing.Size(50, 13);
this.Label7.TabIndex = 108;
this.Label7.Text = "Narration";
//
// txtNarration
//
this.txtNarration.Location = new System.Drawing.Point(68, 89);
this.txtNarration.Name = "txtNarration";
this.txtNarration.Size = new System.Drawing.Size(322, 20);
this.txtNarration.TabIndex = 107;
//
// txtAmount
//
this.txtAmount.Location = new System.Drawing.Point(68, 64);
this.txtAmount.Name = "txtAmount";
this.txtAmount.Size = new System.Drawing.Size(92, 20);
this.txtAmount.TabIndex = 106;
this.txtAmount.Text = "0";
this.txtAmount.TextChanged += new System.EventHandler(this.txtAmount_TextChanged);
this.txtAmount.Leave += new System.EventHandler(this.txtAmount_Leave);
//
// lblAmount
//
this.lblAmount.AutoSize = true;
this.lblAmount.Location = new System.Drawing.Point(19, 67);
this.lblAmount.Name = "lblAmount";
this.lblAmount.Size = new System.Drawing.Size(43, 13);
this.lblAmount.TabIndex = 105;
this.lblAmount.Text = "Amount";
//
// txtCashier
//
this.txtCashier.Location = new System.Drawing.Point(68, 38);
this.txtCashier.Name = "txtCashier";
this.txtCashier.ReadOnly = true;
this.txtCashier.Size = new System.Drawing.Size(322, 20);
this.txtCashier.TabIndex = 104;
//
// Label5
//
this.Label5.AutoSize = true;
this.Label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label5.Location = new System.Drawing.Point(78, 505);
this.Label5.Name = "Label5";
this.Label5.Size = new System.Drawing.Size(40, 16);
this.Label5.TabIndex = 103;
this.Label5.Text = "Void";
//
// txtVoid
//
this.txtVoid.BackColor = System.Drawing.Color.Black;
this.txtVoid.ForeColor = System.Drawing.Color.Lime;
this.txtVoid.Location = new System.Drawing.Point(124, 504);
this.txtVoid.Name = "txtVoid";
this.txtVoid.ReadOnly = true;
this.txtVoid.Size = new System.Drawing.Size(100, 20);
this.txtVoid.TabIndex = 102;
this.txtVoid.Text = "0.00";
this.txtVoid.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// txtAmt
//
this.txtAmt.BackColor = System.Drawing.Color.Black;
this.txtAmt.ForeColor = System.Drawing.Color.Lime;
this.txtAmt.Location = new System.Drawing.Point(280, 504);
this.txtAmt.Name = "txtAmt";
this.txtAmt.ReadOnly = true;
this.txtAmt.Size = new System.Drawing.Size(110, 20);
this.txtAmt.TabIndex = 101;
this.txtAmt.Text = "0.00";
this.txtAmt.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label4
//
this.Label4.AutoSize = true;
this.Label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label4.Location = new System.Drawing.Point(230, 505);
this.Label4.Name = "Label4";
this.Label4.Size = new System.Drawing.Size(44, 16);
this.Label4.TabIndex = 100;
this.Label4.Text = "Total";
//
// Label3
//
this.Label3.AutoSize = true;
this.Label3.Location = new System.Drawing.Point(20, 41);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(42, 13);
this.Label3.TabIndex = 99;
this.Label3.Text = "Cashier";
//
// Label2
//
this.Label2.AutoSize = true;
this.Label2.Location = new System.Drawing.Point(197, 18);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(20, 13);
this.Label2.TabIndex = 96;
this.Label2.Text = "To";
//
// Label1
//
this.Label1.AutoSize = true;
this.Label1.Location = new System.Drawing.Point(32, 18);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(30, 13);
this.Label1.TabIndex = 94;
this.Label1.Text = "From";
//
// dtpTo
//
this.dtpTo.Location = new System.Drawing.Point(223, 12);
this.dtpTo.Name = "dtpTo";
this.dtpTo.Size = new System.Drawing.Size(167, 20);
this.dtpTo.TabIndex = 97;
//
// dtpFrom
//
this.dtpFrom.Location = new System.Drawing.Point(68, 11);
this.dtpFrom.Name = "dtpFrom";
this.dtpFrom.Size = new System.Drawing.Size(121, 20);
this.dtpFrom.TabIndex = 95;
this.dtpFrom.ValueChanged += new System.EventHandler(this.dtpFrom_ValueChanged);
//
// dgExpenses
//
this.dgExpenses.AllowUserToAddRows = false;
this.dgExpenses.AllowUserToDeleteRows = false;
this.dgExpenses.AllowUserToResizeRows = false;
this.dgExpenses.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgExpenses.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
this.dgExpenses.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgExpenses.Location = new System.Drawing.Point(12, 142);
this.dgExpenses.Name = "dgExpenses";
this.dgExpenses.ReadOnly = true;
this.dgExpenses.RowHeadersVisible = false;
this.dgExpenses.RowTemplate.Height = 19;
this.dgExpenses.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgExpenses.Size = new System.Drawing.Size(378, 356);
this.dgExpenses.TabIndex = 110;
//
// RecieveAdvanceForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(402, 536);
this.Controls.Add(this.dgExpenses);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.Label7);
this.Controls.Add(this.txtNarration);
this.Controls.Add(this.txtAmount);
this.Controls.Add(this.lblAmount);
this.Controls.Add(this.txtCashier);
this.Controls.Add(this.Label5);
this.Controls.Add(this.txtVoid);
this.Controls.Add(this.txtAmt);
this.Controls.Add(this.Label4);
this.Controls.Add(this.Label3);
this.Controls.Add(this.Label2);
this.Controls.Add(this.Label1);
this.Controls.Add(this.dtpTo);
this.Controls.Add(this.dtpFrom);
this.MaximizeBox = false;
this.Name = "RecieveAdvanceForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Received Advance";
this.Load += new System.EventHandler(this.RecieveAdvanceForm_Load);
((System.ComponentModel.ISupportInitialize)(this.dgExpenses)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
internal System.Windows.Forms.Button btnAdd;
internal System.Windows.Forms.Label Label7;
internal System.Windows.Forms.TextBox txtNarration;
internal System.Windows.Forms.TextBox txtAmount;
internal System.Windows.Forms.Label lblAmount;
internal System.Windows.Forms.TextBox txtCashier;
internal System.Windows.Forms.Label Label5;
internal System.Windows.Forms.TextBox txtVoid;
internal System.Windows.Forms.TextBox txtAmt;
internal System.Windows.Forms.Label Label4;
internal System.Windows.Forms.Label Label3;
internal System.Windows.Forms.Label Label2;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.DateTimePicker dtpTo;
internal System.Windows.Forms.DateTimePicker dtpFrom;
private System.Windows.Forms.DataGridView dgExpenses;
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Helpers;
namespace Tanshu.Accounts.PointOfSale
{
public partial class frmSaleAnalysisForm : Form
{
Guid? details = null;
List<SalesAnalysisBO> det;
private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public frmSaleAnalysisForm()
{
InitializeComponent();
log.Warn(string.Format("Sales Analysis by: {0}", CurrentUser.user.Name));
}
private void dtpStart_ValueChanged(object sender, EventArgs e)
{
ShowStatement();
}
private void ShowStatement()
{
DateTime startDate = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 00:00:00", dtpStart.Value));
DateTime finishDate = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 23:59:59", dtpFinish.Value));
if (details.HasValue)
{
List<SalesAnalysisDetailBO> list = new SalesAnalysisBI().GetSaleDetail(startDate, finishDate, details.Value);
dgvSale.AutoGenerateColumns = true;
dgvSale.DataSource = list;
dgvSale.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dgvSale.Columns[2].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
dgvSale.Columns[3].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
}
else
{
det = new SalesAnalysisBI().GetSale(startDate, finishDate);
dgvSale.AutoGenerateColumns = true;
dgvSale.DataSource = det;
dgvSale.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dgvSale.Columns[0].Visible = false;
dgvSale.Columns[2].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
dgvSale.Columns[3].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
}
decimal freeSale = 0, voids = 0, pending = 0, net = 0, tax = 0;
new SalesAnalysisBI().GetAdditionalInfo(ref freeSale, ref voids, ref pending, ref net, ref tax, startDate, finishDate);
txtVoid.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", voids);
txtPending.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", pending);
txtNet.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", net);
txtTax.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", tax);
txtGross.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", net + tax);
}
private void dtpFinish_ValueChanged(object sender, EventArgs e)
{
ShowStatement();
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpStart.Value = DateTime.Today;
dtpFinish.Value = DateTime.Today;
ShowStatement();
}
private void dgvSale_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (!details.HasValue)
details = ((SalesAnalysisBO)dgvSale.SelectedRows[0].DataBoundItem).TypeID;
else
details = null;
ShowStatement();
}
catch (Exception ex)
{ throw ex; }
}
private void btnPrint_Click(object sender, EventArgs e)
{
if (det != null)
{
DateTime startDate = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 00:00:00", dtpStart.Value));
DateTime finishDate = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 23:59:59", dtpFinish.Value));
Accounts.Print.Thermal.PrintSale(det, startDate, finishDate);
}
}
}
}

View File

@ -0,0 +1,240 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class frmSaleAnalysisForm
{
/// <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.txtNet = new System.Windows.Forms.TextBox();
this.txtTax = new System.Windows.Forms.TextBox();
this.txtGross = new System.Windows.Forms.TextBox();
this.txtPending = new System.Windows.Forms.TextBox();
this.txtVoid = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.dgvSale = new System.Windows.Forms.DataGridView();
this.dtpFinish = new System.Windows.Forms.DateTimePicker();
this.dtpStart = new System.Windows.Forms.DateTimePicker();
this.label10 = new System.Windows.Forms.Label();
this.btnPrint = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).BeginInit();
this.SuspendLayout();
//
// txtNet
//
this.txtNet.Location = new System.Drawing.Point(224, 487);
this.txtNet.Name = "txtNet";
this.txtNet.ReadOnly = true;
this.txtNet.Size = new System.Drawing.Size(100, 20);
this.txtNet.TabIndex = 17;
//
// txtTax
//
this.txtTax.Location = new System.Drawing.Point(330, 487);
this.txtTax.Name = "txtTax";
this.txtTax.ReadOnly = true;
this.txtTax.Size = new System.Drawing.Size(100, 20);
this.txtTax.TabIndex = 18;
//
// txtGross
//
this.txtGross.Location = new System.Drawing.Point(436, 487);
this.txtGross.Name = "txtGross";
this.txtGross.ReadOnly = true;
this.txtGross.Size = new System.Drawing.Size(100, 20);
this.txtGross.TabIndex = 19;
//
// txtPending
//
this.txtPending.Location = new System.Drawing.Point(118, 487);
this.txtPending.Name = "txtPending";
this.txtPending.ReadOnly = true;
this.txtPending.Size = new System.Drawing.Size(100, 20);
this.txtPending.TabIndex = 16;
//
// txtVoid
//
this.txtVoid.Location = new System.Drawing.Point(12, 487);
this.txtVoid.Name = "txtVoid";
this.txtVoid.ReadOnly = true;
this.txtVoid.Size = new System.Drawing.Size(100, 20);
this.txtVoid.TabIndex = 15;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(115, 471);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(70, 13);
this.label5.TabIndex = 24;
this.label5.Text = "Pending Sale";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 471);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(52, 13);
this.label4.TabIndex = 23;
this.label4.Text = "Void Sale";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(327, 471);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(25, 13);
this.label3.TabIndex = 26;
this.label3.Text = "Tax";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(433, 471);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(58, 13);
this.label2.TabIndex = 27;
this.label2.Text = "Gross Sale";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(221, 471);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 13);
this.label1.TabIndex = 25;
this.label1.Text = "Net Sale";
//
// dgvSale
//
this.dgvSale.AllowUserToAddRows = false;
this.dgvSale.AllowUserToDeleteRows = false;
this.dgvSale.AllowUserToResizeRows = false;
this.dgvSale.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvSale.Location = new System.Drawing.Point(12, 41);
this.dgvSale.MultiSelect = false;
this.dgvSale.Name = "dgvSale";
this.dgvSale.ReadOnly = true;
this.dgvSale.RowHeadersVisible = false;
this.dgvSale.RowTemplate.Height = 19;
this.dgvSale.RowTemplate.ReadOnly = true;
this.dgvSale.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvSale.Size = new System.Drawing.Size(524, 427);
this.dgvSale.TabIndex = 14;
this.dgvSale.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSale_CellDoubleClick);
//
// dtpFinish
//
this.dtpFinish.CustomFormat = "dd-MMM-yyyy";
this.dtpFinish.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpFinish.Location = new System.Drawing.Point(168, 12);
this.dtpFinish.Name = "dtpFinish";
this.dtpFinish.Size = new System.Drawing.Size(90, 20);
this.dtpFinish.TabIndex = 21;
this.dtpFinish.ValueChanged += new System.EventHandler(this.dtpFinish_ValueChanged);
//
// dtpStart
//
this.dtpStart.CustomFormat = "dd-MMM-yyyy";
this.dtpStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpStart.Location = new System.Drawing.Point(12, 12);
this.dtpStart.Name = "dtpStart";
this.dtpStart.Size = new System.Drawing.Size(90, 20);
this.dtpStart.TabIndex = 20;
this.dtpStart.ValueChanged += new System.EventHandler(this.dtpStart_ValueChanged);
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(108, 16);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(54, 13);
this.label10.TabIndex = 22;
this.label10.Text = "<- Date ->";
//
// btnPrint
//
this.btnPrint.Location = new System.Drawing.Point(461, 12);
this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(75, 23);
this.btnPrint.TabIndex = 28;
this.btnPrint.Text = "Print";
this.btnPrint.UseVisualStyleBackColor = true;
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// frmSaleAnalysisForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(548, 519);
this.Controls.Add(this.btnPrint);
this.Controls.Add(this.txtNet);
this.Controls.Add(this.txtTax);
this.Controls.Add(this.txtGross);
this.Controls.Add(this.txtPending);
this.Controls.Add(this.txtVoid);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.dgvSale);
this.Controls.Add(this.dtpFinish);
this.Controls.Add(this.dtpStart);
this.Controls.Add(this.label10);
this.MaximizeBox = false;
this.Name = "frmSaleAnalysisForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sale Analysis Form";
this.Load += new System.EventHandler(this.Sale_Analysis_Form_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox txtNet;
private System.Windows.Forms.TextBox txtTax;
private System.Windows.Forms.TextBox txtGross;
private System.Windows.Forms.TextBox txtPending;
private System.Windows.Forms.TextBox txtVoid;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DataGridView dgvSale;
private System.Windows.Forms.DateTimePicker dtpFinish;
private System.Windows.Forms.DateTimePicker dtpStart;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Button btnPrint;
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,990 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class SalesForm
{
/// <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();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.bindingSource = new System.Windows.Forms.BindingSource(this.components);
this.bsWaiter = new System.Windows.Forms.BindingSource(this.components);
this.bsPending = new System.Windows.Forms.BindingSource(this.components);
this.tmrPending = new System.Windows.Forms.Timer(this.components);
this.label7 = new System.Windows.Forms.Label();
this.txtDiscount = new System.Windows.Forms.TextBox();
this.Label12 = new System.Windows.Forms.Label();
this.txtGrossAmount = new System.Windows.Forms.TextBox();
this.txtAmount = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.txtNarration = new System.Windows.Forms.TextBox();
this.txtGrossTax = new System.Windows.Forms.TextBox();
this.dgvProducts = new System.Windows.Forms.DataGridView();
this.Display = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.printedDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.additionalDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.pnlBilling = new System.Windows.Forms.Panel();
this.btnWaiter = new System.Windows.Forms.Button();
this.txtCode = new System.Windows.Forms.TextBox();
this.btnClear = new System.Windows.Forms.Button();
this.btnMultiPrint = new System.Windows.Forms.Button();
this.btnRate = new System.Windows.Forms.Button();
this.btnPrintKot = new System.Windows.Forms.Button();
this.btnPrintBill = new System.Windows.Forms.Button();
this.btnVoid = new System.Windows.Forms.Button();
this.btnDiscount = new System.Windows.Forms.Button();
this.btnQuantity = new System.Windows.Forms.Button();
this.txtTableID = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.txtUserID = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtDate = new System.Windows.Forms.TextBox();
this.txtLastEditDate = new System.Windows.Forms.TextBox();
this.txtCreationDate = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtBillID = new System.Windows.Forms.TextBox();
this.txtKotID = new System.Windows.Forms.TextBox();
this.btnCustomer = new System.Windows.Forms.Button();
this.pnlWaiting = new System.Windows.Forms.Panel();
this.btnImportant = new System.Windows.Forms.Button();
this.dgvPending = new System.Windows.Forms.DataGridView();
this.selectDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.billNoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.kotDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.TableID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.amountDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.importantDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.alarmDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.bookingTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.lastEditedDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.waiterDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.cashierDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.printedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.alarmTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.btnAlarm = new System.Windows.Forms.Button();
this.chkRefresh = new System.Windows.Forms.CheckBox();
this.btnRefresh = new System.Windows.Forms.Button();
this.btnPaidCC = new System.Windows.Forms.Button();
this.btnPaidCash = new System.Windows.Forms.Button();
this.btnBillList = new System.Windows.Forms.Button();
this.btnSelectBill = new System.Windows.Forms.Button();
this.btnStartBill = new System.Windows.Forms.Button();
this.tcPending = new System.Windows.Forms.TabControl();
this.tpToday = new System.Windows.Forms.TabPage();
this.tpWeek = new System.Windows.Forms.TabPage();
this.tpAll = new System.Windows.Forms.TabPage();
this.tpImportant = new System.Windows.Forms.TabPage();
this.tpAlarm = new System.Windows.Forms.TabPage();
this.lblUser = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsWaiter)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsPending)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvProducts)).BeginInit();
this.pnlBilling.SuspendLayout();
this.pnlWaiting.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvPending)).BeginInit();
this.tcPending.SuspendLayout();
this.SuspendLayout();
//
// bindingSource
//
this.bindingSource.DataSource = typeof(Tanshu.Accounts.Contracts.SalesBillItemBO);
//
// bsWaiter
//
this.bsWaiter.DataSource = typeof(Tanshu.Accounts.Contracts.WaiterBO);
//
// bsPending
//
this.bsPending.DataSource = typeof(Tanshu.Accounts.Contracts.PendingBillsBO);
//
// tmrPending
//
this.tmrPending.Enabled = true;
this.tmrPending.Interval = 5000;
this.tmrPending.Tick += new System.EventHandler(this.tmrPending_Tick);
//
// label7
//
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(795, 517);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(49, 13);
this.label7.TabIndex = 112;
this.label7.Text = "Discount";
this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// txtDiscount
//
this.txtDiscount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtDiscount.Location = new System.Drawing.Point(850, 514);
this.txtDiscount.Name = "txtDiscount";
this.txtDiscount.ReadOnly = true;
this.txtDiscount.Size = new System.Drawing.Size(120, 20);
this.txtDiscount.TabIndex = 113;
this.txtDiscount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label12
//
this.Label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.Label12.AutoSize = true;
this.Label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label12.Location = new System.Drawing.Point(808, 569);
this.Label12.Name = "Label12";
this.Label12.Size = new System.Drawing.Size(36, 13);
this.Label12.TabIndex = 116;
this.Label12.Text = "Total";
this.Label12.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// txtGrossAmount
//
this.txtGrossAmount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtGrossAmount.Location = new System.Drawing.Point(850, 540);
this.txtGrossAmount.Name = "txtGrossAmount";
this.txtGrossAmount.ReadOnly = true;
this.txtGrossAmount.Size = new System.Drawing.Size(120, 20);
this.txtGrossAmount.TabIndex = 109;
this.txtGrossAmount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// txtAmount
//
this.txtAmount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtAmount.BackColor = System.Drawing.Color.Black;
this.txtAmount.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtAmount.ForeColor = System.Drawing.Color.Transparent;
this.txtAmount.Location = new System.Drawing.Point(850, 566);
this.txtAmount.Name = "txtAmount";
this.txtAmount.ReadOnly = true;
this.txtAmount.Size = new System.Drawing.Size(120, 22);
this.txtAmount.TabIndex = 107;
this.txtAmount.Text = "0.00";
this.txtAmount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(800, 543);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(46, 13);
this.label6.TabIndex = 108;
this.label6.Text = "Subtotal";
this.label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label5
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(808, 488);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(36, 13);
this.label5.TabIndex = 110;
this.label5.Text = "Taxes";
this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// txtNarration
//
this.txtNarration.Location = new System.Drawing.Point(12, 482);
this.txtNarration.Multiline = true;
this.txtNarration.Name = "txtNarration";
this.txtNarration.Size = new System.Drawing.Size(216, 106);
this.txtNarration.TabIndex = 4;
//
// txtGrossTax
//
this.txtGrossTax.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtGrossTax.Location = new System.Drawing.Point(850, 488);
this.txtGrossTax.Name = "txtGrossTax";
this.txtGrossTax.ReadOnly = true;
this.txtGrossTax.Size = new System.Drawing.Size(120, 20);
this.txtGrossTax.TabIndex = 111;
this.txtGrossTax.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// dgvProducts
//
this.dgvProducts.AllowUserToAddRows = false;
this.dgvProducts.AllowUserToDeleteRows = false;
this.dgvProducts.AllowUserToOrderColumns = true;
this.dgvProducts.AllowUserToResizeRows = false;
this.dgvProducts.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvProducts.AutoGenerateColumns = false;
this.dgvProducts.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCellsExceptHeader;
this.dgvProducts.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvProducts.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Display,
this.printedDataGridViewTextBoxColumn,
this.additionalDataGridViewTextBoxColumn});
this.dgvProducts.DataSource = this.bindingSource;
this.dgvProducts.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dgvProducts.Location = new System.Drawing.Point(12, 90);
this.dgvProducts.MultiSelect = false;
this.dgvProducts.Name = "dgvProducts";
this.dgvProducts.RowHeadersVisible = false;
this.dgvProducts.RowTemplate.Height = 19;
this.dgvProducts.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvProducts.Size = new System.Drawing.Size(471, 386);
this.dgvProducts.TabIndex = 0;
this.dgvProducts.VirtualMode = true;
this.dgvProducts.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvProducts_CellFormatting);
//
// Display
//
this.Display.DataPropertyName = "Display";
this.Display.HeaderText = "Display";
this.Display.Name = "Display";
this.Display.ReadOnly = true;
this.Display.Width = 5;
//
// printedDataGridViewTextBoxColumn
//
this.printedDataGridViewTextBoxColumn.DataPropertyName = "Printed";
dataGridViewCellStyle1.Format = "N2";
this.printedDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1;
this.printedDataGridViewTextBoxColumn.HeaderText = "Printed";
this.printedDataGridViewTextBoxColumn.Name = "printedDataGridViewTextBoxColumn";
this.printedDataGridViewTextBoxColumn.ReadOnly = true;
this.printedDataGridViewTextBoxColumn.Width = 5;
//
// additionalDataGridViewTextBoxColumn
//
this.additionalDataGridViewTextBoxColumn.DataPropertyName = "Additional";
dataGridViewCellStyle2.Format = "N2";
dataGridViewCellStyle2.NullValue = null;
this.additionalDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle2;
this.additionalDataGridViewTextBoxColumn.HeaderText = "Additional";
this.additionalDataGridViewTextBoxColumn.Name = "additionalDataGridViewTextBoxColumn";
this.additionalDataGridViewTextBoxColumn.ReadOnly = true;
this.additionalDataGridViewTextBoxColumn.Width = 5;
//
// pnlBilling
//
this.pnlBilling.AutoSize = true;
this.pnlBilling.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.pnlBilling.Controls.Add(this.btnWaiter);
this.pnlBilling.Controls.Add(this.txtCode);
this.pnlBilling.Controls.Add(this.btnClear);
this.pnlBilling.Controls.Add(this.btnMultiPrint);
this.pnlBilling.Controls.Add(this.btnRate);
this.pnlBilling.Controls.Add(this.btnPrintKot);
this.pnlBilling.Controls.Add(this.btnPrintBill);
this.pnlBilling.Controls.Add(this.btnVoid);
this.pnlBilling.Controls.Add(this.btnDiscount);
this.pnlBilling.Controls.Add(this.btnQuantity);
this.pnlBilling.Controls.Add(this.txtTableID);
this.pnlBilling.Controls.Add(this.label11);
this.pnlBilling.Controls.Add(this.label10);
this.pnlBilling.Controls.Add(this.txtUserID);
this.pnlBilling.Controls.Add(this.label9);
this.pnlBilling.Controls.Add(this.label8);
this.pnlBilling.Controls.Add(this.label4);
this.pnlBilling.Controls.Add(this.txtDate);
this.pnlBilling.Controls.Add(this.txtLastEditDate);
this.pnlBilling.Controls.Add(this.txtCreationDate);
this.pnlBilling.Controls.Add(this.label3);
this.pnlBilling.Controls.Add(this.label2);
this.pnlBilling.Controls.Add(this.txtBillID);
this.pnlBilling.Controls.Add(this.txtKotID);
this.pnlBilling.Controls.Add(this.btnCustomer);
this.pnlBilling.Controls.Add(this.dgvProducts);
this.pnlBilling.Controls.Add(this.txtGrossTax);
this.pnlBilling.Controls.Add(this.txtNarration);
this.pnlBilling.Controls.Add(this.label5);
this.pnlBilling.Controls.Add(this.label6);
this.pnlBilling.Controls.Add(this.txtAmount);
this.pnlBilling.Controls.Add(this.txtGrossAmount);
this.pnlBilling.Controls.Add(this.Label12);
this.pnlBilling.Controls.Add(this.txtDiscount);
this.pnlBilling.Controls.Add(this.label7);
this.pnlBilling.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlBilling.Location = new System.Drawing.Point(0, 0);
this.pnlBilling.Name = "pnlBilling";
this.pnlBilling.Size = new System.Drawing.Size(982, 662);
this.pnlBilling.TabIndex = 121;
//
// btnWaiter
//
this.btnWaiter.Location = new System.Drawing.Point(341, 482);
this.btnWaiter.Name = "btnWaiter";
this.btnWaiter.Size = new System.Drawing.Size(101, 106);
this.btnWaiter.TabIndex = 150;
this.btnWaiter.Text = "Select Waiter - F5";
this.btnWaiter.UseVisualStyleBackColor = true;
this.btnWaiter.Click += new System.EventHandler(this.btnWaiter_Click);
//
// txtCode
//
this.txtCode.Location = new System.Drawing.Point(489, 54);
this.txtCode.Name = "txtCode";
this.txtCode.Size = new System.Drawing.Size(481, 20);
this.txtCode.TabIndex = 149;
//
// btnClear
//
this.btnClear.Location = new System.Drawing.Point(234, 482);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(101, 106);
this.btnClear.TabIndex = 148;
this.btnClear.Text = "Clear - Esc";
this.btnClear.UseVisualStyleBackColor = true;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// btnMultiPrint
//
this.btnMultiPrint.Location = new System.Drawing.Point(773, 485);
this.btnMultiPrint.Name = "btnMultiPrint";
this.btnMultiPrint.Size = new System.Drawing.Size(21, 106);
this.btnMultiPrint.TabIndex = 147;
this.btnMultiPrint.Text = "Multi Print";
this.btnMultiPrint.UseVisualStyleBackColor = true;
this.btnMultiPrint.Click += new System.EventHandler(this.btnMultiPrint_Click);
//
// btnRate
//
this.btnRate.Location = new System.Drawing.Point(663, 566);
this.btnRate.Name = "btnRate";
this.btnRate.Size = new System.Drawing.Size(104, 23);
this.btnRate.TabIndex = 146;
this.btnRate.Text = "&Rate";
this.btnRate.UseVisualStyleBackColor = true;
this.btnRate.Click += new System.EventHandler(this.btnRate_Click);
//
// btnPrintKot
//
this.btnPrintKot.Location = new System.Drawing.Point(555, 482);
this.btnPrintKot.Name = "btnPrintKot";
this.btnPrintKot.Size = new System.Drawing.Size(102, 106);
this.btnPrintKot.TabIndex = 145;
this.btnPrintKot.Text = "Print KOT - F12";
this.btnPrintKot.UseVisualStyleBackColor = true;
this.btnPrintKot.Click += new System.EventHandler(this.btnPrintKot_Click);
//
// btnPrintBill
//
this.btnPrintBill.Location = new System.Drawing.Point(448, 482);
this.btnPrintBill.Name = "btnPrintBill";
this.btnPrintBill.Size = new System.Drawing.Size(101, 106);
this.btnPrintBill.TabIndex = 144;
this.btnPrintBill.Text = "Print Bill - F11";
this.btnPrintBill.UseVisualStyleBackColor = true;
this.btnPrintBill.Click += new System.EventHandler(this.btnPrintBill_Click);
//
// btnVoid
//
this.btnVoid.Location = new System.Drawing.Point(663, 485);
this.btnVoid.Name = "btnVoid";
this.btnVoid.Size = new System.Drawing.Size(104, 23);
this.btnVoid.TabIndex = 143;
this.btnVoid.Text = "Cancel Current Bill";
this.btnVoid.UseVisualStyleBackColor = true;
this.btnVoid.Click += new System.EventHandler(this.btnVoid_Click);
//
// btnDiscount
//
this.btnDiscount.Location = new System.Drawing.Point(663, 514);
this.btnDiscount.Name = "btnDiscount";
this.btnDiscount.Size = new System.Drawing.Size(104, 23);
this.btnDiscount.TabIndex = 142;
this.btnDiscount.Text = "Discount - F3";
this.btnDiscount.UseVisualStyleBackColor = true;
this.btnDiscount.Click += new System.EventHandler(this.btnDiscount_Click);
//
// btnQuantity
//
this.btnQuantity.Location = new System.Drawing.Point(663, 537);
this.btnQuantity.Name = "btnQuantity";
this.btnQuantity.Size = new System.Drawing.Size(104, 23);
this.btnQuantity.TabIndex = 141;
this.btnQuantity.Text = "Quantity - F2";
this.btnQuantity.UseVisualStyleBackColor = true;
this.btnQuantity.Click += new System.EventHandler(this.btnQuantity_Click);
//
// txtTableID
//
this.txtTableID.Location = new System.Drawing.Point(390, 28);
this.txtTableID.Name = "txtTableID";
this.txtTableID.ReadOnly = true;
this.txtTableID.Size = new System.Drawing.Size(93, 20);
this.txtTableID.TabIndex = 140;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(387, 12);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(34, 13);
this.label11.TabIndex = 139;
this.label11.Text = "Table";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(804, 12);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(73, 13);
this.label10.TabIndex = 138;
this.label10.Text = "Last Edit User";
//
// txtUserID
//
this.txtUserID.Location = new System.Drawing.Point(807, 28);
this.txtUserID.Name = "txtUserID";
this.txtUserID.ReadOnly = true;
this.txtUserID.Size = new System.Drawing.Size(163, 20);
this.txtUserID.TabIndex = 137;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(259, 12);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(72, 13);
this.label9.TabIndex = 136;
this.label9.Text = "Booking Time";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(486, 12);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(84, 13);
this.label8.TabIndex = 135;
this.label8.Text = "Bill Printing Time";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(645, 12);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(74, 13);
this.label4.TabIndex = 134;
this.label4.Text = "Last Edit Time";
//
// txtDate
//
this.txtDate.Location = new System.Drawing.Point(489, 28);
this.txtDate.Name = "txtDate";
this.txtDate.ReadOnly = true;
this.txtDate.Size = new System.Drawing.Size(153, 20);
this.txtDate.TabIndex = 133;
//
// txtLastEditDate
//
this.txtLastEditDate.Location = new System.Drawing.Point(648, 28);
this.txtLastEditDate.Name = "txtLastEditDate";
this.txtLastEditDate.ReadOnly = true;
this.txtLastEditDate.Size = new System.Drawing.Size(153, 20);
this.txtLastEditDate.TabIndex = 132;
//
// txtCreationDate
//
this.txtCreationDate.Location = new System.Drawing.Point(262, 28);
this.txtCreationDate.Name = "txtCreationDate";
this.txtCreationDate.ReadOnly = true;
this.txtCreationDate.Size = new System.Drawing.Size(122, 20);
this.txtCreationDate.TabIndex = 131;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(124, 12);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(69, 13);
this.label3.TabIndex = 130;
this.label3.Text = "KOT Number";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 12);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(60, 13);
this.label2.TabIndex = 129;
this.label2.Text = "Bill Number";
//
// txtBillID
//
this.txtBillID.Location = new System.Drawing.Point(12, 28);
this.txtBillID.Name = "txtBillID";
this.txtBillID.ReadOnly = true;
this.txtBillID.Size = new System.Drawing.Size(109, 20);
this.txtBillID.TabIndex = 128;
//
// txtKotID
//
this.txtKotID.Location = new System.Drawing.Point(127, 28);
this.txtKotID.Name = "txtKotID";
this.txtKotID.ReadOnly = true;
this.txtKotID.Size = new System.Drawing.Size(129, 20);
this.txtKotID.TabIndex = 127;
//
// btnCustomer
//
this.btnCustomer.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCustomer.ForeColor = System.Drawing.Color.Red;
this.btnCustomer.Location = new System.Drawing.Point(12, 54);
this.btnCustomer.Name = "btnCustomer";
this.btnCustomer.Size = new System.Drawing.Size(471, 34);
this.btnCustomer.TabIndex = 126;
this.btnCustomer.UseVisualStyleBackColor = true;
this.btnCustomer.Click += new System.EventHandler(this.btnCustomer_Click);
//
// pnlWaiting
//
this.pnlWaiting.AutoSize = true;
this.pnlWaiting.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.pnlWaiting.Controls.Add(this.btnImportant);
this.pnlWaiting.Controls.Add(this.dgvPending);
this.pnlWaiting.Controls.Add(this.btnAlarm);
this.pnlWaiting.Controls.Add(this.chkRefresh);
this.pnlWaiting.Controls.Add(this.btnRefresh);
this.pnlWaiting.Controls.Add(this.btnPaidCC);
this.pnlWaiting.Controls.Add(this.btnPaidCash);
this.pnlWaiting.Controls.Add(this.btnBillList);
this.pnlWaiting.Controls.Add(this.btnSelectBill);
this.pnlWaiting.Controls.Add(this.btnStartBill);
this.pnlWaiting.Controls.Add(this.tcPending);
this.pnlWaiting.Controls.Add(this.lblUser);
this.pnlWaiting.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlWaiting.Location = new System.Drawing.Point(0, 0);
this.pnlWaiting.Name = "pnlWaiting";
this.pnlWaiting.Size = new System.Drawing.Size(982, 662);
this.pnlWaiting.TabIndex = 121;
this.pnlWaiting.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlWaiting_Paint);
//
// btnImportant
//
this.btnImportant.Location = new System.Drawing.Point(850, 459);
this.btnImportant.Name = "btnImportant";
this.btnImportant.Size = new System.Drawing.Size(120, 62);
this.btnImportant.TabIndex = 137;
this.btnImportant.Text = "Mark / UnMark Important";
this.btnImportant.UseVisualStyleBackColor = true;
this.btnImportant.Click += new System.EventHandler(this.btnImportant_Click);
//
// dgvPending
//
this.dgvPending.AllowUserToAddRows = false;
this.dgvPending.AllowUserToDeleteRows = false;
this.dgvPending.AllowUserToOrderColumns = true;
this.dgvPending.AllowUserToResizeRows = false;
this.dgvPending.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvPending.AutoGenerateColumns = false;
this.dgvPending.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
this.dgvPending.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPending.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.selectDataGridViewCheckBoxColumn,
this.billNoDataGridViewTextBoxColumn,
this.kotDataGridViewTextBoxColumn,
this.TableID,
this.amountDataGridViewTextBoxColumn,
this.importantDataGridViewCheckBoxColumn,
this.alarmDataGridViewCheckBoxColumn,
this.bookingTimeDataGridViewTextBoxColumn,
this.lastEditedDataGridViewTextBoxColumn,
this.waiterDataGridViewTextBoxColumn,
this.cashierDataGridViewTextBoxColumn,
this.printedDataGridViewCheckBoxColumn,
this.alarmTimeDataGridViewTextBoxColumn});
this.dgvPending.DataSource = this.bsPending;
this.dgvPending.Location = new System.Drawing.Point(12, 40);
this.dgvPending.MultiSelect = false;
this.dgvPending.Name = "dgvPending";
this.dgvPending.RowHeadersVisible = false;
this.dgvPending.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvPending.Size = new System.Drawing.Size(696, 487);
this.dgvPending.TabIndex = 0;
this.dgvPending.VirtualMode = true;
this.dgvPending.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPending_CellDoubleClick);
this.dgvPending.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dgvPending_CellValueNeeded);
this.dgvPending.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvPending_CellFormatting);
this.dgvPending.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dgvPending_CellValuePushed);
//
// selectDataGridViewCheckBoxColumn
//
this.selectDataGridViewCheckBoxColumn.HeaderText = "Select";
this.selectDataGridViewCheckBoxColumn.Name = "selectDataGridViewCheckBoxColumn";
this.selectDataGridViewCheckBoxColumn.Width = 43;
//
// billNoDataGridViewTextBoxColumn
//
this.billNoDataGridViewTextBoxColumn.DataPropertyName = "BillNo";
this.billNoDataGridViewTextBoxColumn.HeaderText = "BillNo";
this.billNoDataGridViewTextBoxColumn.Name = "billNoDataGridViewTextBoxColumn";
this.billNoDataGridViewTextBoxColumn.Width = 59;
//
// kotDataGridViewTextBoxColumn
//
this.kotDataGridViewTextBoxColumn.DataPropertyName = "Kot";
this.kotDataGridViewTextBoxColumn.HeaderText = "Kot";
this.kotDataGridViewTextBoxColumn.Name = "kotDataGridViewTextBoxColumn";
this.kotDataGridViewTextBoxColumn.Width = 48;
//
// TableID
//
this.TableID.DataPropertyName = "TableID";
this.TableID.HeaderText = "TableID";
this.TableID.Name = "TableID";
this.TableID.Width = 70;
//
// amountDataGridViewTextBoxColumn
//
this.amountDataGridViewTextBoxColumn.DataPropertyName = "Amount";
this.amountDataGridViewTextBoxColumn.HeaderText = "Amount";
this.amountDataGridViewTextBoxColumn.Name = "amountDataGridViewTextBoxColumn";
this.amountDataGridViewTextBoxColumn.Width = 68;
//
// importantDataGridViewCheckBoxColumn
//
this.importantDataGridViewCheckBoxColumn.DataPropertyName = "Important";
this.importantDataGridViewCheckBoxColumn.HeaderText = "Important";
this.importantDataGridViewCheckBoxColumn.Name = "importantDataGridViewCheckBoxColumn";
this.importantDataGridViewCheckBoxColumn.Width = 57;
//
// alarmDataGridViewCheckBoxColumn
//
this.alarmDataGridViewCheckBoxColumn.DataPropertyName = "Alarm";
this.alarmDataGridViewCheckBoxColumn.HeaderText = "Alarm";
this.alarmDataGridViewCheckBoxColumn.Name = "alarmDataGridViewCheckBoxColumn";
this.alarmDataGridViewCheckBoxColumn.Width = 39;
//
// bookingTimeDataGridViewTextBoxColumn
//
this.bookingTimeDataGridViewTextBoxColumn.DataPropertyName = "BookingTime";
this.bookingTimeDataGridViewTextBoxColumn.HeaderText = "BookingTime";
this.bookingTimeDataGridViewTextBoxColumn.Name = "bookingTimeDataGridViewTextBoxColumn";
this.bookingTimeDataGridViewTextBoxColumn.Width = 94;
//
// lastEditedDataGridViewTextBoxColumn
//
this.lastEditedDataGridViewTextBoxColumn.DataPropertyName = "LastEdited";
this.lastEditedDataGridViewTextBoxColumn.HeaderText = "LastEdited";
this.lastEditedDataGridViewTextBoxColumn.Name = "lastEditedDataGridViewTextBoxColumn";
this.lastEditedDataGridViewTextBoxColumn.Width = 82;
//
// waiterDataGridViewTextBoxColumn
//
this.waiterDataGridViewTextBoxColumn.DataPropertyName = "Waiter";
this.waiterDataGridViewTextBoxColumn.HeaderText = "Waiter";
this.waiterDataGridViewTextBoxColumn.Name = "waiterDataGridViewTextBoxColumn";
this.waiterDataGridViewTextBoxColumn.Width = 63;
//
// cashierDataGridViewTextBoxColumn
//
this.cashierDataGridViewTextBoxColumn.DataPropertyName = "Cashier";
this.cashierDataGridViewTextBoxColumn.HeaderText = "Cashier";
this.cashierDataGridViewTextBoxColumn.Name = "cashierDataGridViewTextBoxColumn";
this.cashierDataGridViewTextBoxColumn.Width = 67;
//
// printedDataGridViewCheckBoxColumn
//
this.printedDataGridViewCheckBoxColumn.DataPropertyName = "Printed";
this.printedDataGridViewCheckBoxColumn.HeaderText = "Printed";
this.printedDataGridViewCheckBoxColumn.Name = "printedDataGridViewCheckBoxColumn";
this.printedDataGridViewCheckBoxColumn.Width = 46;
//
// alarmTimeDataGridViewTextBoxColumn
//
this.alarmTimeDataGridViewTextBoxColumn.DataPropertyName = "AlarmTime";
this.alarmTimeDataGridViewTextBoxColumn.HeaderText = "AlarmTime";
this.alarmTimeDataGridViewTextBoxColumn.Name = "alarmTimeDataGridViewTextBoxColumn";
this.alarmTimeDataGridViewTextBoxColumn.Width = 81;
//
// btnAlarm
//
this.btnAlarm.Location = new System.Drawing.Point(850, 393);
this.btnAlarm.Name = "btnAlarm";
this.btnAlarm.Size = new System.Drawing.Size(120, 64);
this.btnAlarm.TabIndex = 136;
this.btnAlarm.Text = "Alarm";
this.btnAlarm.UseVisualStyleBackColor = true;
this.btnAlarm.Click += new System.EventHandler(this.btnAlarm_Click);
//
// chkRefresh
//
this.chkRefresh.AutoSize = true;
this.chkRefresh.Checked = true;
this.chkRefresh.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkRefresh.Location = new System.Drawing.Point(714, 40);
this.chkRefresh.Name = "chkRefresh";
this.chkRefresh.Size = new System.Drawing.Size(121, 17);
this.chkRefresh.TabIndex = 134;
this.chkRefresh.Text = "Keep refreshing Bills";
this.chkRefresh.UseVisualStyleBackColor = true;
//
// btnRefresh
//
this.btnRefresh.Location = new System.Drawing.Point(9, 527);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(129, 117);
this.btnRefresh.TabIndex = 133;
this.btnRefresh.Text = "Refresh - F5";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// btnPaidCC
//
this.btnPaidCC.Location = new System.Drawing.Point(850, 527);
this.btnPaidCC.Name = "btnPaidCC";
this.btnPaidCC.Size = new System.Drawing.Size(120, 117);
this.btnPaidCC.TabIndex = 6;
this.btnPaidCC.Text = "Paid By CC";
this.btnPaidCC.UseVisualStyleBackColor = true;
this.btnPaidCC.Click += new System.EventHandler(this.btnPaidCC_Click);
//
// btnPaidCash
//
this.btnPaidCash.Location = new System.Drawing.Point(714, 527);
this.btnPaidCash.Name = "btnPaidCash";
this.btnPaidCash.Size = new System.Drawing.Size(130, 117);
this.btnPaidCash.TabIndex = 5;
this.btnPaidCash.Text = "Paid";
this.btnPaidCash.UseVisualStyleBackColor = true;
this.btnPaidCash.Click += new System.EventHandler(this.btnPaidCash_Click);
//
// btnBillList
//
this.btnBillList.Location = new System.Drawing.Point(714, 393);
this.btnBillList.Name = "btnBillList";
this.btnBillList.Size = new System.Drawing.Size(130, 128);
this.btnBillList.TabIndex = 4;
this.btnBillList.Text = "List Of Bills to Cancel";
this.btnBillList.UseVisualStyleBackColor = true;
this.btnBillList.Click += new System.EventHandler(this.btnBillList_Click);
//
// btnSelectBill
//
this.btnSelectBill.Location = new System.Drawing.Point(714, 239);
this.btnSelectBill.Name = "btnSelectBill";
this.btnSelectBill.Size = new System.Drawing.Size(256, 148);
this.btnSelectBill.TabIndex = 3;
this.btnSelectBill.Text = "Select Bill";
this.btnSelectBill.UseVisualStyleBackColor = true;
this.btnSelectBill.Click += new System.EventHandler(this.btnSelectBill_Click);
//
// btnStartBill
//
this.btnStartBill.Location = new System.Drawing.Point(714, 63);
this.btnStartBill.Name = "btnStartBill";
this.btnStartBill.Size = new System.Drawing.Size(256, 170);
this.btnStartBill.TabIndex = 2;
this.btnStartBill.Text = "New Bill - F6";
this.btnStartBill.UseVisualStyleBackColor = true;
this.btnStartBill.Click += new System.EventHandler(this.btnStartBill_Click);
//
// tcPending
//
this.tcPending.Controls.Add(this.tpToday);
this.tcPending.Controls.Add(this.tpWeek);
this.tcPending.Controls.Add(this.tpAll);
this.tcPending.Controls.Add(this.tpImportant);
this.tcPending.Controls.Add(this.tpAlarm);
this.tcPending.Location = new System.Drawing.Point(192, 12);
this.tcPending.Name = "tcPending";
this.tcPending.SelectedIndex = 0;
this.tcPending.Size = new System.Drawing.Size(271, 20);
this.tcPending.TabIndex = 1;
this.tcPending.SelectedIndexChanged += new System.EventHandler(this.tcPending_SelectedIndexChanged);
//
// tpToday
//
this.tpToday.Location = new System.Drawing.Point(4, 22);
this.tpToday.Name = "tpToday";
this.tpToday.Padding = new System.Windows.Forms.Padding(3);
this.tpToday.Size = new System.Drawing.Size(263, 0);
this.tpToday.TabIndex = 1;
this.tpToday.Text = "Today";
this.tpToday.UseVisualStyleBackColor = true;
//
// tpWeek
//
this.tpWeek.Location = new System.Drawing.Point(4, 22);
this.tpWeek.Name = "tpWeek";
this.tpWeek.Padding = new System.Windows.Forms.Padding(3);
this.tpWeek.Size = new System.Drawing.Size(263, 0);
this.tpWeek.TabIndex = 2;
this.tpWeek.Text = "Week";
this.tpWeek.UseVisualStyleBackColor = true;
//
// tpAll
//
this.tpAll.Location = new System.Drawing.Point(4, 22);
this.tpAll.Name = "tpAll";
this.tpAll.Padding = new System.Windows.Forms.Padding(3);
this.tpAll.Size = new System.Drawing.Size(263, 0);
this.tpAll.TabIndex = 3;
this.tpAll.Text = "All";
this.tpAll.UseVisualStyleBackColor = true;
//
// tpImportant
//
this.tpImportant.Location = new System.Drawing.Point(4, 22);
this.tpImportant.Name = "tpImportant";
this.tpImportant.Padding = new System.Windows.Forms.Padding(3);
this.tpImportant.Size = new System.Drawing.Size(263, 0);
this.tpImportant.TabIndex = 4;
this.tpImportant.Text = "Important";
this.tpImportant.UseVisualStyleBackColor = true;
//
// tpAlarm
//
this.tpAlarm.Location = new System.Drawing.Point(4, 22);
this.tpAlarm.Name = "tpAlarm";
this.tpAlarm.Padding = new System.Windows.Forms.Padding(3);
this.tpAlarm.Size = new System.Drawing.Size(263, 0);
this.tpAlarm.TabIndex = 5;
this.tpAlarm.Text = "Alarms";
this.tpAlarm.UseVisualStyleBackColor = true;
//
// lblUser
//
this.lblUser.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblUser.ForeColor = System.Drawing.Color.Red;
this.lblUser.Location = new System.Drawing.Point(144, 530);
this.lblUser.Name = "lblUser";
this.lblUser.Size = new System.Drawing.Size(564, 114);
this.lblUser.TabIndex = 135;
this.lblUser.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// SalesForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(982, 662);
this.Controls.Add(this.pnlWaiting);
this.Controls.Add(this.pnlBilling);
this.KeyPreview = true;
this.MaximizeBox = false;
this.Name = "SalesForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "F2-Qty., F3-Discount, F4-Customer, F5-Waiter, F7-Product, F8-LoadBill, F9-Set Amo" +
"unt, F11-Print Bill, F12-Print KOT, ESC-Cancel";
this.Load += new System.EventHandler(this.SalesForm_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SalesForm_KeyDown);
((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsWaiter)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsPending)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvProducts)).EndInit();
this.pnlBilling.ResumeLayout(false);
this.pnlBilling.PerformLayout();
this.pnlWaiting.ResumeLayout(false);
this.pnlWaiting.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvPending)).EndInit();
this.tcPending.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.BindingSource bindingSource;
private System.Windows.Forms.BindingSource bsWaiter;
private System.Windows.Forms.BindingSource bsPending;
private System.Windows.Forms.Timer tmrPending;
internal System.Windows.Forms.Label label7;
internal System.Windows.Forms.TextBox txtDiscount;
internal System.Windows.Forms.Label Label12;
internal System.Windows.Forms.TextBox txtGrossAmount;
internal System.Windows.Forms.TextBox txtAmount;
internal System.Windows.Forms.Label label6;
internal System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtNarration;
internal System.Windows.Forms.TextBox txtGrossTax;
private System.Windows.Forms.DataGridView dgvProducts;
private System.Windows.Forms.Panel pnlBilling;
private System.Windows.Forms.Panel pnlWaiting;
private System.Windows.Forms.Button btnRefresh;
private System.Windows.Forms.Button btnPaidCC;
private System.Windows.Forms.Button btnPaidCash;
private System.Windows.Forms.Button btnBillList;
private System.Windows.Forms.Button btnSelectBill;
private System.Windows.Forms.Button btnStartBill;
private System.Windows.Forms.TabControl tcPending;
private System.Windows.Forms.TabPage tpToday;
private System.Windows.Forms.TabPage tpWeek;
private System.Windows.Forms.TabPage tpAll;
private System.Windows.Forms.TabPage tpImportant;
private System.Windows.Forms.TabPage tpAlarm;
private System.Windows.Forms.DataGridView dgvPending;
private System.Windows.Forms.Button btnCustomer;
private System.Windows.Forms.TextBox txtBillID;
private System.Windows.Forms.TextBox txtKotID;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtDate;
private System.Windows.Forms.TextBox txtLastEditDate;
private System.Windows.Forms.TextBox txtCreationDate;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtUserID;
private System.Windows.Forms.TextBox txtTableID;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Button btnDiscount;
private System.Windows.Forms.Button btnQuantity;
private System.Windows.Forms.CheckBox chkRefresh;
private System.Windows.Forms.Button btnPrintKot;
private System.Windows.Forms.Button btnPrintBill;
private System.Windows.Forms.Button btnVoid;
private System.Windows.Forms.Button btnMultiPrint;
private System.Windows.Forms.Button btnRate;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.Label lblUser;
private System.Windows.Forms.Button btnAlarm;
private System.Windows.Forms.DataGridViewCheckBoxColumn selectDataGridViewCheckBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn billNoDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn kotDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn TableID;
private System.Windows.Forms.DataGridViewTextBoxColumn amountDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewCheckBoxColumn importantDataGridViewCheckBoxColumn;
private System.Windows.Forms.DataGridViewCheckBoxColumn alarmDataGridViewCheckBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn bookingTimeDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn lastEditedDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn waiterDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn cashierDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewCheckBoxColumn printedDataGridViewCheckBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn alarmTimeDataGridViewTextBoxColumn;
private System.Windows.Forms.Button btnImportant;
private System.Windows.Forms.TextBox txtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn Display;
private System.Windows.Forms.DataGridViewTextBoxColumn printedDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn additionalDataGridViewTextBoxColumn;
private System.Windows.Forms.Button btnWaiter;
}
}

View File

@ -0,0 +1,934 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Helpers;
using Tanshu.Common;
namespace Tanshu.Accounts.PointOfSale
{
public partial class SalesForm : Form
{
#region Waiting
private List<Guid> selectedBills = new List<Guid>();
private List<PendingBillsBO> pendingBills = new List<PendingBillsBO>();
private PendingType pendingList = PendingType.Today;
#endregion
private SaleFormState formState = SaleFormState.Waiting;
#region Billing
private Dictionary<BillItemKey, SalesBillItemBO> bill = new Dictionary<BillItemKey, SalesBillItemBO>();
private CustomerBO customer = new CustomerBI().GetCustomer(new Guid("F016CBAD-206C-42C0-BB1D-6006CE57BAB5"));
#endregion
private SaleVoucherBO billInfo;
object lockObject = new object();
Guid? newBillID;
public SalesForm()
{
InitializeComponent();
btnCustomer.Text = customer.Name;
lblUser.Text = CurrentUser.user.Name;
}
public SalesForm(Guid voucherID)
: this()
{
newBillID = voucherID;
}
private void SalesForm_KeyDown(object sender, KeyEventArgs e)
{
if (formState == SaleFormState.Billing)
{
#region Billing KeyDown
switch (e.KeyCode)
{
case Keys.F2:
{
if (dgvProducts.Rows.Count > 0)
SetQuantity(CurrentProduct, 0, false, true);
break;
}
case Keys.F3:
{
btnDiscount_Click(sender, new EventArgs());
break;
}
case Keys.F4:
{
if (!e.Alt)
ShowCustomerList(false);
break;
}
case Keys.F5:
{
btnWaiter_Click(sender, new EventArgs());
break;
}
case Keys.F7:
{
using (SelectProduct selectProduct = new SelectProduct(new ProductBI().GetFilteredProducts, true))
{
selectProduct.ShowDialog();
if (selectProduct.SelectedItem != null)
AddProductToGrid(selectProduct.SelectedItem.ProductID);
}
break;
}
case Keys.F8:
{
LoadBillFromTable();
break;
}
case Keys.F9:
{
if (dgvProducts.Rows.Count > 0)
SetAmount(CurrentProduct, -1);
break;
}
case Keys.F11:
{
btnPrintBill_Click(sender, e);
break;
}
case Keys.F12:
{
btnPrintKot_Click(sender, e);
break;
}
case Keys.Delete:
{
if (dgvProducts.Rows.Count > 0)
ProductRemove(CurrentProduct);
break;
}
case Keys.Add:
{
if (dgvProducts.Rows.Count > 0)
SetQuantity(CurrentProduct, 1, false, false);
break;
}
case Keys.Subtract:
{
if (dgvProducts.Rows.Count > 0)
SetQuantity(CurrentProduct, -1, false, false);
break;
}
case Keys.Up:
{
if ((bindingSource.Position >= 1) && (!dgvProducts.Focused))
bindingSource.Position -= 1;
break;
}
case Keys.Down:
{
if ((bindingSource.Position < bindingSource.Count - 1) && (!dgvProducts.Focused))
bindingSource.Position += 1;
break;
}
case Keys.Escape:
{
if (bill.Count != 0)
if (MessageBox.Show("Cancel current bill?", "Cancel bill", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
return;
ClearBill();
break;
}
}
#endregion
}
else
{
#region Waiting KeyDown
switch (e.KeyCode)
{
case Keys.F6:
{
ChangeFormState(SaleFormState.Billing);
break;
}
case Keys.F8:
{
LoadBillFromTable();
break;
}
}
#endregion
}
}
#region Helper Functions
private void ClearBill()
{
ShowCustomerList(true);
this.billInfo = null;
this.txtBillID.Text = "";
this.txtKotID.Text = "";
this.txtCreationDate.Text = "";
this.txtDate.Text = "";
this.txtLastEditDate.Text = "";
this.txtNarration.Text = "";
this.txtUserID.Text = "";
this.txtTableID.Text = "";
this.btnWaiter.Text = "Waiter - F5";
this.btnWaiter.Tag = null;
txtGrossTax.Text = "0.00";
txtDiscount.Text = "0.00";
txtGrossAmount.Text = "0.00";
txtAmount.Text = "0.00";
bill.Clear();
bindingSource.DataSource = bill.Values;
ChangeFormState(SaleFormState.Waiting);
}
private void AddProductToGrid(Guid productID)
{
BillHelperFunctions.AddProductToGrid(productID, bindingSource, bill);
calculateAmount();
}
private void SetQuantity(SalesBillItemBO product, decimal quantity, bool absolute, bool prompt)
{
if (product == null)
return;
BillHelperFunctions.SetQuantity(product, quantity, absolute, prompt, bindingSource, bill);
calculateAmount();
}
private void SetAmount(SalesBillItemBO product, decimal amount)
{
if (product == null)
return;
BillHelperFunctions.SetAmount(product, amount, bindingSource, bill);
calculateAmount();
}
private void SetDiscount(SalesBillItemBO product, decimal discount)
{
if (product == null)
return;
BillHelperFunctions.SetDiscount(product.productID, discount, customer, bill);
calculateAmount();
return;
}
private bool ProductRemove(SalesBillItemBO product)
{
if (product == null)
return false;
if (product.Printed > 0)
{
if (!Thread.CurrentPrincipal.IsInRole("Sales/EditPrintedProduct"))
{
MessageBox.Show("You are not allowed to delete already printed products");
return false;
}
if (MessageBox.Show(string.Format("Already {0} items have been printed.\n\rAre you sure you want to delete this item?", product.Printed), "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
return false;
//If BillList(Location).Printed <> 0 Then ItemsDeleted.Add("Deleted " & BillList(Location).Printed & " " & BillList(Location).Name & " from Bill No " & mBillNo)
}
bill.Remove(new BillItemKey(product.productID, product.Printed == 0));
calculateAmount();
return true;
}
private void InputBox_Validating(object sender, InputBoxValidatingArgs e)
{
}
private void button_Click(object sender, EventArgs e)
{
Button button = sender as Button;
if (button == null)
return;
Guid tag = (Guid)button.Tag;
AddProductToGrid(tag);
}
private void calculateAmount()
{
txtGrossTax.Text = string.Format("{0:#0.00}", bill.Values.Sum(b => b.TaxAmount));
txtDiscount.Text = string.Format("{0:#0.00}", bill.Values.Sum(b => b.DiscountAmount));
txtGrossAmount.Text = string.Format("{0:#0.00}", bill.Values.Sum(b => b.GrossAmount));
txtAmount.Text = string.Format("{0:#0.00}", Math.Round(bill.Values.Sum(b => b.Value)));
bindingSource.DataSource = bill.Values.ToList();
dgvProducts.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
}
private void btnPrintBill_Click(object sender, EventArgs e)
{
Save(true);
}
private void btnPrintKot_Click(object sender, EventArgs e)
{
Save(false);
}
private void btnMultiPrint_Click(object sender, EventArgs e)
{
Save(true);
}
private void btnCancel_Click(object sender, EventArgs e)
{
if (bill.Count != 0)
if (MessageBox.Show("Cancel current bill?", "Cancel bill", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
return;
ClearBill();
}
private SalesBillItemBO CurrentProduct
{
get
{
if (dgvProducts.Rows.Count == 0)
return null;
SalesBillItemBO product = bill.ElementAt(dgvProducts.CurrentRow.Index).Value;
return product;
}
}
private void btnQuantity_Click(object sender, EventArgs e)
{
if (dgvProducts.Rows.Count > 0)
SetQuantity(CurrentProduct, 0, false, true);
}
private void btnDiscount_Click(object sender, EventArgs e)
{
if (dgvProducts.Rows.Count > 0)
SetDiscount(CurrentProduct, -1);
}
#endregion
private void SalesForm_Load(object sender, EventArgs e)
{
ChangeFormState(SaleFormState.Waiting);
if (newBillID.HasValue)
{
LoadBill(newBillID.Value);
ChangeFormState(SaleFormState.Billing);
}
ControlFactory.GenerateButtons(ref pnlBilling, new Rectangle(489, 94, 481, 385), 6, 6, 2, new ProductBI().GetUnFilteredProducts(), new ButtonClickDelegate(button_Click));
}
private void ChangeFormState(SaleFormState state)
{
formState = state;
if (state == SaleFormState.Billing)
{
pnlWaiting.Visible = false;
pnlBilling.Visible = true;
}
else
{
pnlWaiting.Visible = true;
pnlBilling.Visible = false;
ListUnpaidBills();
}
}
#region Save Bill
private void Save(bool print)
{
if ((billInfo != null) && (new SaleVoucherBI().IsBillPrinted(billInfo.VoucherID)) && (!Thread.CurrentPrincipal.IsInRole("Sales/EditBill")))
MessageBox.Show("You are not authorized to access");
else
{
if (bill.Count != 0)
{
Guid? saved;
if (billInfo == null)
saved = AddNewSale(print);
else
saved = UpdateSale(print);
if (saved.HasValue)
{
if (newBillID.HasValue)
this.Close();
else
PrintBill(print, saved.Value);
}
ClearBill();
}
}
}
private void PrintBill(bool finalBill, Guid voucherID)
{
if (!Thread.CurrentPrincipal.IsInRole("Sales/PrintKOT"))
{
MessageBox.Show("You are not authorized to access");
return;
}
if (!finalBill)
Accounts.Print.Thermal.PrintWaiterKot("KOT", voucherID, bill.Values.ToList());
else
{
if (!Thread.CurrentPrincipal.IsInRole("Sales/PrintBill"))
{
MessageBox.Show("You are not authorized to access");
return;
}
else
{
Accounts.Print.Thermal.PrintBill(true, voucherID, bill.Values.ToList());
Accounts.Print.Thermal.PrintCustomerKot("KOT", voucherID, bill.Values.ToList());
}
}
}
private Guid? AddNewSale(bool finalBill)
{
if (billInfo != null)
{
MessageBox.Show("Error in AddNewSale, there is a previous sale in memory", "Error");
return null;
}
if (btnWaiter.Tag == null)
btnWaiter.Tag = new WaiterBI().GetWaiters()[0].WaiterID;
#region SaleVoucher
UserBO user = CurrentUser.user;
SaleVoucherBO saleVoucher = new SaleVoucherBO
{
CustomerID = customer.CustomerID,
Paid = false,
//Paid = finalBill,
TableID = txtTableID.Text,
WaiterID = (Guid)btnWaiter.Tag,
Printed = finalBill,
Void = false,
Date = DateTime.Now,
Narration = txtNarration.Text,
Ref = "",
Type = 'S',
UserID = user.UserID
};
#endregion
#region Inventories
List<InventoryBO> iList = new SaleVoucherBI().SaleInventory(bill.Values, null);
#endregion
new SaleVoucherBI().Insert(saleVoucher, iList);
return saleVoucher.VoucherID;
}
#region TransactionUpdate
private Guid? UpdateSale(bool finalBill)
{
if (btnWaiter.Tag == null)
btnWaiter.Tag = new WaiterBI().GetWaiters()[0].WaiterID;
UserBO user = CurrentUser.user;
#region Voucher and SaleVoucher
SaleVoucherBO saleVoucher = new SaleVoucherBO
{
VoucherID = billInfo.VoucherID,
timestamp = (byte[])billInfo.timestamp,
UserID = billInfo.UserID,
Date = billInfo.Date,
CreationDate = DateTime.Now,
LastEditDate = DateTime.Now,
Narration = billInfo.Narration,
Ref = "",
Type = 'S',
Alarm = billInfo.Alarm,
BillID = billInfo.BillID,
CustomerID = customer.CustomerID,
KotID = billInfo.KotID,
Paid = billInfo.Paid,
Printed = billInfo.Printed || finalBill,
TableID = txtTableID.Text,
Void = billInfo.Void,
VoidReason = billInfo.VoidReason,
WaiterID = (Guid)btnWaiter.Tag,
SaleTimestamp = (byte[])billInfo.SaleTimestamp
};
if ((!billInfo.Printed) && finalBill)
saleVoucher.Date = null;
#endregion
#region Inventory
List<InventoryBO> iList = new SaleVoucherBI().SaleInventory(bill.Values, billInfo.VoucherID);
#endregion
new SaleVoucherBI().Update(saleVoucher, iList);
return saleVoucher.VoucherID;
}
#endregion
#endregion
private void LoadBillFromTable()
{
InputBoxResult result = InputBox.Show("Enter Table Number", "Table", "0", InputBox_Validating);
if (result.OK)
{
txtTableID.Text = result.Text.Trim();
if ((txtTableID.Text != "C") && (txtTableID.Text != "") && (!txtTableID.Text.Contains(".")))
{
Guid? tID = new SaleVoucherBI().GetPendingVoucherID(txtTableID.Text);
if (tID.HasValue)
{
LoadBill(tID.Value);
ChangeFormState(SaleFormState.Billing);
}
}
else
ClearBill();
}
}
private void LoadBill(Guid voucherID)
{
ClearBill();
List<InventoryDisplayBO> iList = new List<InventoryDisplayBO>();
new SaleVoucherBI().GetSaleVoucher(voucherID, ref billInfo, ref iList);
this.txtBillID.Text = billInfo.BillID;
this.txtKotID.Text = billInfo.KotID;
this.txtCreationDate.Text = billInfo.CreationDate.ToString("HH:mm dd-MMM-yyyy");
this.txtDate.Text = billInfo.Date.Value.ToString("HH:mm dd-MMM-yyyy");
this.txtLastEditDate.Text = billInfo.LastEditDate.ToString("HH:mm dd-MMM-yyyy");
this.txtNarration.Text = billInfo.Narration;
this.txtUserID.Text = new UserBI().GetUser(billInfo.UserID).Name;
this.customer = new CustomerBI().GetCustomer(billInfo.CustomerID);
this.btnCustomer.Text = this.customer.Name;
this.txtTableID.Text = billInfo.TableID;
this.btnWaiter.Tag = billInfo.WaiterID;
this.btnWaiter.Text = string.Format("{0} - F5", new WaiterBI().GetWaiter(billInfo.WaiterID).Name);
foreach (InventoryDisplayBO inventory in iList)
{
if (inventory.ComplexProductID.HasValue)
{
BillItemKey key = new BillItemKey(inventory.ComplexProductID.Value, inventory.Quantity == 0);
if (!bill.ContainsKey(key))
{
decimal rate = 0, quantity = 0;
string name = "";
new SaleVoucherBI().GetComplexBillInformation(voucherID, inventory.ComplexProductID.Value, ref rate, ref quantity, ref name);
bill.Add(key, new SalesBillItemBO
{
productID = inventory.ComplexProductID.Value,
Discount = inventory.Discount,
Name = name,
Price = rate,
Printed = quantity,
Quantity = quantity,
Tax = inventory.Tax,
});
}
}
else
{
BillItemKey key = new BillItemKey(inventory.ProductID, inventory.Quantity == 0);
bill.Add(key, new SalesBillItemBO
{
productID = inventory.ProductID,
Discount = inventory.Discount,
Name = inventory.ProductName,
Price = inventory.Rate,
Printed = inventory.Quantity,
Quantity = inventory.Quantity,
Tax = inventory.Tax,
});
}
}
calculateAmount();
}
#region Waiting
private void btnStartBill_Click(object sender, EventArgs e)
{
ChangeFormState(SaleFormState.Billing);
}
private void btnSelectBill_Click(object sender, EventArgs e)
{
if (bsPending.Current != null)
{
LoadBill(((PendingBillsBO)bsPending.Current).voucherID);
ChangeFormState(SaleFormState.Billing);
}
}
private void tmrPending_Tick(object sender, EventArgs e)
{
if (chkRefresh.Checked)
ListUnpaidBills();
}
private void ListUnpaidBills()
{
lock (lockObject)
{
pendingBills = new SaleVoucherBI().GetPendingBills(pendingList);
bsPending.DataSource = pendingBills;
List<PendingBillsBO> alarmBills = new SaleVoucherBI().GetPendingBills(PendingType.Alarms).OrderBy(b => b.AlarmTime).ToList();
if (alarmBills.Count > 0)
{
PendingBillsBO al = alarmBills.First();
double seconds = al.AlarmTime.Value.Subtract(DateTime.Now).TotalSeconds;
if (seconds <= 0)
lblUser.Text = string.Format("Alarm {0:hh:MM}", al.AlarmTime);
else
lblUser.Text = CurrentUser.user.Name;
}
else
{
lblUser.Text = CurrentUser.user.Name;
}
}
}
private void dgvPending_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
try
{
DataGridView dgv = sender as DataGridView;
PendingBillsBO data = dgv.Rows[e.RowIndex].DataBoundItem as PendingBillsBO;
if (data.Printed)
e.CellStyle.BackColor = Color.LightSlateGray;
}
catch
{
// Catch and swallow exception when DataGridView attemps to get values for removed rows.
}
}
private void tcPending_SelectedIndexChanged(object sender, EventArgs e)
{
switch (tcPending.SelectedTab.Text)
{
case "Today":
pendingList = PendingType.Today;
break;
case "Week":
pendingList = PendingType.Week;
break;
case "All":
pendingList = PendingType.All;
break;
case "Important":
pendingList = PendingType.Important;
break;
case "Alarms":
pendingList = PendingType.Alarms;
break;
}
ListUnpaidBills();
}
private void dgvPending_CellValuePushed(object sender, DataGridViewCellValueEventArgs e)
{
if (e.ColumnIndex != 0) return;
if ((bool)e.Value)
selectedBills.Add(pendingBills[e.RowIndex].voucherID);
else
selectedBills.Remove(pendingBills[e.RowIndex].voucherID);
}
private void dgvPending_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
if (e.ColumnIndex != 0) return;
if (e.RowIndex > pendingBills.Count - 1) return;
e.Value = selectedBills.Contains(pendingBills.ElementAt(e.RowIndex).voucherID);
}
#endregion
#region Billing
private void btnCustomer_Click(object sender, EventArgs e)
{
ShowCustomerList(false);
}
private void ShowCustomerList(bool reset)
{
if ((customer.CustomerID == new Guid("F016CBAD-206C-42C0-BB1D-6006CE57BAB5")) && (!reset))
{
using (SelectCustomer selectCustomer = new SelectCustomer(new CustomerBI().GetFilteredCustomers, true))
{
selectCustomer.customerEvent += new CustomerEventHandler(selectCustomer_customerEvent);
selectCustomer.ShowDialog();
if (selectCustomer.SelectedItem != null)
{
customer = selectCustomer.SelectedItem;
btnCustomer.Text = customer.Name;
}
else
{
customer = new CustomerBI().GetCustomer(new Guid("F016CBAD-206C-42C0-BB1D-6006CE57BAB5"));
}
}
}
else
{
customer = new CustomerBI().GetCustomer(new Guid("F016CBAD-206C-42C0-BB1D-6006CE57BAB5"));
btnCustomer.Text = customer.Name;
}
}
CustomerBO selectCustomer_customerEvent(object sender, CustomerEventArgs e)
{
using (CustomersForm form = new CustomersForm(e.CustomerID, e.Phone))
{
form.ShowDialog();
return form.Customer;
}
}
#endregion
private void dgvPending_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if ((dgvProducts.Rows.Count > 0) && (dgvPending.CurrentRow != null))
{
LoadBill(((PendingBillsBO)bsPending.Current).voucherID);
ChangeFormState(SaleFormState.Billing);
}
}
private void btnRefresh_Click(object sender, EventArgs e)
{
ListUnpaidBills();
}
private void btnVoid_Click(object sender, EventArgs e)
{
if (billInfo != null)
{
if ((billInfo.Printed) && (!Thread.CurrentPrincipal.IsInRole("Sales/VoidPrintedBill")))
MessageBox.Show("Cannot void a paid bill");
else if (MessageBox.Show("Are you sure you want to void this bill?", "Void Bill", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
{
SelectVoidReason voidReason = new SelectVoidReason(GetVoidReason, true);
voidReason.ShowDialog();
if (voidReason.SelectedItem != null)
{
new SaleVoucherBI().VoidBill(billInfo.VoucherID, voidReason.SelectedItem.Description);
ClearBill();
}
else
{
MessageBox.Show("Please Select a reason if you want to void the bill", "Bill NOT Voided", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
}
}
private List<StringType> GetVoidReason(Dictionary<string, string> filter)
{
List<StringType> list = new List<StringType>();
list.Add(new StringType("Discount"));
list.Add(new StringType("Printing Fault"));
list.Add(new StringType("Item Changed"));
list.Add(new StringType("Quantity Reduced"));
list.Add(new StringType("Costing Bill for Party"));
list.Add(new StringType("Cashier Mistake"));
list.Add(new StringType("Management Freesale"));
list.Add(new StringType("Other"));
return list.Where(i => i.Description.ToLower().Contains(filter["Name"].ToLower().Trim())).ToList();
}
private void btnRate_Click(object sender, EventArgs e)
{
if (!Thread.CurrentPrincipal.IsInRole("Sales/ChangeRate"))
MessageBox.Show("You are not authorized to access");
else
{
if (dgvProducts.Rows.Count > 0)
{
SalesBillItemBO product = bill.ElementAt(dgvProducts.CurrentRow.Index).Value;
decimal rate = 0;
InputBoxResult result = InputBox.Show("Enter Rate", "Rate", product.Price.ToString(), InputBox_Validating);
if (result.OK)
rate = Convert.ToDecimal(result.Text);
if (rate != 0)
{
BillHelperFunctions.SetRate(product.productID, rate, bill);
calculateAmount();
}
}
}
}
private void btnClear_Click(object sender, EventArgs e)
{
ClearBill();
}
private void btnPaidCash_Click(object sender, EventArgs e)
{
UserBO user = CurrentUser.user;
new SaleVoucherBI().DeclareBillsPaid(user.UserID, selectedBills, false);
ListUnpaidBills();
}
private void btnPaidCC_Click(object sender, EventArgs e)
{
UserBO user = CurrentUser.user;
new SaleVoucherBI().DeclareBillsPaid(user.UserID, selectedBills, true);
ListUnpaidBills();
}
private void btnAlarm_Click(object sender, EventArgs e)
{
if (bsPending.Current != null)
{
PendingBillsBO billAlarm = (PendingBillsBO)bsPending.Current;
InputBoxResult result = InputBox.Show(
string.Format("Alarm for Bill {0} Rs. {1}", billAlarm.BillNo, billAlarm.Amount),
"Alarm",
string.Format("{0:dd-MMM-yyy HH:mm}", billAlarm.LastEdited),
InputBox_Validating);
if (result.OK)
{
DateTime alarmTime;
if (result.Text == string.Empty)
{
new SaleVoucherBI().SetAlarm(billAlarm.voucherID, null);
MessageBox.Show("Alarm Cleared", "Alarm Cleared", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else if (DateTime.TryParseExact(result.Text, "dd-MMM-yyyy HH:mm", new CultureInfo("en-US"), DateTimeStyles.None, out alarmTime))
{
new SaleVoucherBI().SetAlarm(billAlarm.voucherID, alarmTime);
MessageBox.Show("Alarm set", "Alarm Set", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Alarm NOT set, please try again", "Alarm NOT Set", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
private void btnBillList_Click(object sender, EventArgs e)
{
//if (!Thread.CurrentPrincipal.IsInRole("Security/CreateUser"))
// return;
//#region Filters
//decimal? minValue = 0, maxValue = 0;
//decimal valTemp;
//DateTime? fromDate = DateTime.Now, toDate = DateTime.Now; // used in filters
//DateTime dateTemp;
//bool? showVoided;
//InputBoxResult result = InputBox.Show("Start Date", "Start Date", string.Format("{0:dd-MMM-yyy}", fromDate), InputBox_Validating);
//if ((result.OK) && (DateTime.TryParseExact(result.Text, "dd-MMM-yyyy", new CultureInfo("en-US"), DateTimeStyles.None, out dateTemp)))
//{
// fromDate = dateTemp;
//}
//result = InputBox.Show("Finish Date", "Finish Date", string.Format("{0:dd-MMM-yyy}", toDate), InputBox_Validating);
//if ((result.OK) && (DateTime.TryParseExact(result.Text, "dd-MMM-yyyy", new CultureInfo("en-US"), DateTimeStyles.None, out dateTemp)))
//{
// toDate = dateTemp;
//}
//result = InputBox.Show("Minimum Value", "Minimum Value", "0", InputBox_Validating);
//if ((result.OK) && (decimal.TryParse(result.Text, out valTemp)))
//{
// minValue = valTemp;
//}
//result = InputBox.Show("Maximum Value", "Maximum Value", "0", InputBox_Validating);
//if ((result.OK) && (decimal.TryParse(result.Text, out valTemp)))
//{
// maxValue = valTemp;
//}
//DialogResult dResult = MessageBox.Show("Show Un-Voided Bills only", "Un-Voided", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
//if (dResult == DialogResult.Yes)
// showVoided = false;
//else if (dResult == DialogResult.No)
// showVoided = true;
//else
// showVoided = null;
//#endregion
//List<PendingBillsBO> billList = ManagementBI.GetBillList(fromDate, toDate, minValue, maxValue, showVoided);
//using (SelectBill selectBill = new SelectBill(billList, true))
//{
// selectBill.ShowDialog();
// if (selectBill.SelectedItem != null)
// {
// LoadBill(selectBill.SelectedItem.voucherID);
// ChangeFormState(SaleFormState.Billing);
// }
//}
}
private void btnImportant_Click(object sender, EventArgs e)
{
if (bsPending.Current == null)
return;
if (MessageBox.Show("Are you sure?", "Mark / UnMark Important", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
return;
PendingBillsBO billAlarm = (PendingBillsBO)bsPending.Current;
new SaleVoucherBI().ToggleImportant(billAlarm.voucherID);
ListUnpaidBills();
}
private void dgvProducts_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
DataGridView dgv = sender as DataGridView;
SalesBillItemBO data = dgv.Rows[e.RowIndex].DataBoundItem as SalesBillItemBO;
if (data.Printed > 0)
{
e.CellStyle.SelectionBackColor = Color.HotPink;
e.CellStyle.BackColor = Color.LightPink;
}
else
{
e.CellStyle.SelectionBackColor = Color.Green;
e.CellStyle.BackColor = Color.LightGreen;
}
}
private void btnWaiter_Click(object sender, EventArgs e)
{
using (SelectWaiter selectWaiter = new SelectWaiter(new WaiterBI().GetFilteredWaiters, true))
{
selectWaiter.waiterEvent += new WaiterEventHandler(selectWaiter_waiterEvent);
selectWaiter.ShowDialog();
if (selectWaiter.SelectedItem != null)
{
btnWaiter.Text = string.Format("{0} - F5", selectWaiter.SelectedItem.Name);
btnWaiter.Tag = selectWaiter.SelectedItem.WaiterID;
}
else
{
btnWaiter.Text = "Select Waiter - F5";
btnWaiter.Tag = new WaiterBI().GetWaiters()[0].WaiterID;
}
}
}
WaiterBO selectWaiter_waiterEvent(object sender, WaiterEventArgs e)
{
WaiterBO waiter = e.Waiter;
if (!Thread.CurrentPrincipal.IsInRole("Waiter/Master"))
return waiter;
switch (e.Action)
{
case 1: // Add
new WaiterBI().Insert(waiter);
e.Handled = true;
return waiter;
case 2: // Edit
new WaiterBI().Update(waiter);
e.Handled = true;
return waiter;
case 3: // Delete
e.Handled = new WaiterBI().Delete(waiter.WaiterID);
return new WaiterBI().GetWaiter(1);
default:
throw new ArgumentException();
}
}
private void pnlWaiting_Paint(object sender, PaintEventArgs e)
{
}
}
}

View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="bindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="bsWaiter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>148, 17</value>
</metadata>
<metadata name="bsPending.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>248, 17</value>
</metadata>
<metadata name="tmrPending.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>357, 17</value>
</metadata>
<metadata name="Display.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="selectDataGridViewCheckBoxColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="TableID.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>81</value>
</metadata>
</root>