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,183 @@
namespace Accounts.PointOfSale
{
partial class AutoUpdateForm
{
/// <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.dtpFrom = new System.Windows.Forms.DateTimePicker();
this.dtpTo = new System.Windows.Forms.DateTimePicker();
this.btnGo = new System.Windows.Forms.Button();
this.txtTwelve = new System.Windows.Forms.TextBox();
this.txtFour = new System.Windows.Forms.TextBox();
this.txtZero = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtFourSize = new System.Windows.Forms.TextBox();
this.txtZeroSize = new System.Windows.Forms.TextBox();
this.txtTwelveSize = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// dtpFrom
//
this.dtpFrom.Location = new System.Drawing.Point(12, 12);
this.dtpFrom.Name = "dtpFrom";
this.dtpFrom.Size = new System.Drawing.Size(268, 20);
this.dtpFrom.TabIndex = 0;
//
// dtpTo
//
this.dtpTo.Location = new System.Drawing.Point(12, 38);
this.dtpTo.Name = "dtpTo";
this.dtpTo.Size = new System.Drawing.Size(268, 20);
this.dtpTo.TabIndex = 1;
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(12, 142);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(268, 23);
this.btnGo.TabIndex = 5;
this.btnGo.Text = "Go";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// txtTwelve
//
this.txtTwelve.Location = new System.Drawing.Point(50, 116);
this.txtTwelve.Name = "txtTwelve";
this.txtTwelve.Size = new System.Drawing.Size(152, 20);
this.txtTwelve.TabIndex = 4;
this.txtTwelve.Text = "0";
//
// txtFour
//
this.txtFour.Location = new System.Drawing.Point(50, 90);
this.txtFour.Name = "txtFour";
this.txtFour.Size = new System.Drawing.Size(152, 20);
this.txtFour.TabIndex = 3;
this.txtFour.Text = "0";
//
// txtZero
//
this.txtZero.Location = new System.Drawing.Point(50, 64);
this.txtZero.Name = "txtZero";
this.txtZero.Size = new System.Drawing.Size(152, 20);
this.txtZero.TabIndex = 2;
this.txtZero.Text = "0";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 67);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(21, 13);
this.label1.TabIndex = 6;
this.label1.Text = "0%";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 93);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(21, 13);
this.label2.TabIndex = 7;
this.label2.Text = "4%";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 119);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(36, 13);
this.label3.TabIndex = 8;
this.label3.Text = "12.5%";
//
// txtFourSize
//
this.txtFourSize.Location = new System.Drawing.Point(208, 90);
this.txtFourSize.Name = "txtFourSize";
this.txtFourSize.Size = new System.Drawing.Size(72, 20);
this.txtFourSize.TabIndex = 9;
this.txtFourSize.Text = "3000";
//
// txtZeroSize
//
this.txtZeroSize.Location = new System.Drawing.Point(208, 64);
this.txtZeroSize.Name = "txtZeroSize";
this.txtZeroSize.Size = new System.Drawing.Size(72, 20);
this.txtZeroSize.TabIndex = 10;
this.txtZeroSize.Text = "5000";
//
// txtTwelveSize
//
this.txtTwelveSize.Location = new System.Drawing.Point(208, 116);
this.txtTwelveSize.Name = "txtTwelveSize";
this.txtTwelveSize.Size = new System.Drawing.Size(72, 20);
this.txtTwelveSize.TabIndex = 11;
this.txtTwelveSize.Text = "2000";
//
// AutoUpdateForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 177);
this.Controls.Add(this.txtTwelveSize);
this.Controls.Add(this.txtZeroSize);
this.Controls.Add(this.txtFourSize);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtZero);
this.Controls.Add(this.txtFour);
this.Controls.Add(this.txtTwelve);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.dtpTo);
this.Controls.Add(this.dtpFrom);
this.Name = "AutoUpdateForm";
this.Text = "UpdateForm";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DateTimePicker dtpFrom;
private System.Windows.Forms.DateTimePicker dtpTo;
private System.Windows.Forms.Button btnGo;
private System.Windows.Forms.TextBox txtTwelve;
private System.Windows.Forms.TextBox txtFour;
private System.Windows.Forms.TextBox txtZero;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtFourSize;
private System.Windows.Forms.TextBox txtZeroSize;
private System.Windows.Forms.TextBox txtTwelveSize;
}
}

View File

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tanshu.Accounts.Helpers;
using System.Threading;
using Tanshu.Accounts.BI;
namespace Accounts.PointOfSale
{
public partial class AutoUpdateForm : Form
{
public AutoUpdateForm()
{
InitializeComponent();
}
private void btnGo_Click(object sender, EventArgs e)
{
if (!Thread.CurrentPrincipal.IsInRole("Security/CreateUser"))
return;
decimal myDecimal;
if (decimal.TryParse(txtTwelve.Text, out myDecimal))
Process(myDecimal, .125M, Convert.ToDecimal(txtTwelveSize.Text));
if (decimal.TryParse(txtFour.Text, out myDecimal))
Process(myDecimal, .04M, Convert.ToDecimal(txtFourSize.Text));
if (decimal.TryParse(txtZero.Text, out myDecimal))
Process(myDecimal, 0M, Convert.ToDecimal(txtZeroSize.Text));
}
private void Process(decimal target, decimal tax, decimal averageSize)
{
return;
//if (target == 0)
// return;
//decimal existing;
//int work, runner = 0;
//ManagementBI man = new ManagementBI();
////dc.CommandTimeout = 5000;
//List<Guid> list = man.GetBillList(dtpFrom.Value, dtpTo.Value);
//existing = man.GetBalance(tax, dtpFrom.Value, dtpTo.Value);
//work = Convert.ToInt32(Math.Floor((list.Count() * averageSize) / (target - existing)));
//while (existing < target)
//{
// if (MessageBox.Show(string.Format("Total Increase needed is {0}", target - existing), "Balance", MessageBoxButtons.OKCancel) == DialogResult.OK)
// {
// runner += 1;
// SalesForm mySaleForm = new SalesForm(list[(runner * work) + 1]);
// mySaleForm.ShowDialog();
// mySaleForm.Dispose();
// }
// else
// return;
// existing = man.GetBalance(target, tax);
//}
}
}
}

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,254 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class ReplaceForm
{
/// <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.dtpFrom = new System.Windows.Forms.DateTimePicker();
this.dtpTo = new System.Windows.Forms.DateTimePicker();
this.btnGo = new System.Windows.Forms.Button();
this.txtTwelve1 = new System.Windows.Forms.TextBox();
this.txtFour1 = new System.Windows.Forms.TextBox();
this.txtZero1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtStatus = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.txtZero2 = new System.Windows.Forms.TextBox();
this.txtFour2 = new System.Windows.Forms.TextBox();
this.txtTwelve2 = new System.Windows.Forms.TextBox();
this.txtOne = new System.Windows.Forms.TextBox();
this.txtTwo = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// dtpFrom
//
this.dtpFrom.Location = new System.Drawing.Point(12, 12);
this.dtpFrom.Name = "dtpFrom";
this.dtpFrom.Size = new System.Drawing.Size(268, 20);
this.dtpFrom.TabIndex = 0;
this.dtpFrom.Value = new System.DateTime(2009, 12, 1, 0, 0, 0, 0);
//
// dtpTo
//
this.dtpTo.Location = new System.Drawing.Point(286, 12);
this.dtpTo.Name = "dtpTo";
this.dtpTo.Size = new System.Drawing.Size(268, 20);
this.dtpTo.TabIndex = 1;
this.dtpTo.Value = new System.DateTime(2009, 12, 31, 23, 59, 59, 0);
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(12, 142);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(542, 23);
this.btnGo.TabIndex = 5;
this.btnGo.Text = "Go";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// txtTwelve1
//
this.txtTwelve1.Location = new System.Drawing.Point(50, 116);
this.txtTwelve1.Name = "txtTwelve1";
this.txtTwelve1.Size = new System.Drawing.Size(230, 20);
this.txtTwelve1.TabIndex = 4;
this.txtTwelve1.Text = "0";
//
// txtFour1
//
this.txtFour1.Location = new System.Drawing.Point(50, 90);
this.txtFour1.Name = "txtFour1";
this.txtFour1.Size = new System.Drawing.Size(230, 20);
this.txtFour1.TabIndex = 3;
this.txtFour1.Text = "0";
//
// txtZero1
//
this.txtZero1.Location = new System.Drawing.Point(50, 64);
this.txtZero1.Name = "txtZero1";
this.txtZero1.Size = new System.Drawing.Size(230, 20);
this.txtZero1.TabIndex = 2;
this.txtZero1.Text = "0";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 67);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(21, 13);
this.label1.TabIndex = 6;
this.label1.Text = "0%";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 93);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(21, 13);
this.label2.TabIndex = 7;
this.label2.Text = "4%";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 119);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(36, 13);
this.label3.TabIndex = 8;
this.label3.Text = "12.5%";
//
// txtStatus
//
this.txtStatus.Location = new System.Drawing.Point(12, 171);
this.txtStatus.Name = "txtStatus";
this.txtStatus.ReadOnly = true;
this.txtStatus.Size = new System.Drawing.Size(542, 20);
this.txtStatus.TabIndex = 9;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(286, 119);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(36, 13);
this.label4.TabIndex = 15;
this.label4.Text = "12.5%";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(286, 93);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(21, 13);
this.label5.TabIndex = 14;
this.label5.Text = "4%";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(286, 67);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(21, 13);
this.label6.TabIndex = 13;
this.label6.Text = "0%";
//
// txtZero2
//
this.txtZero2.Location = new System.Drawing.Point(324, 64);
this.txtZero2.Name = "txtZero2";
this.txtZero2.Size = new System.Drawing.Size(230, 20);
this.txtZero2.TabIndex = 10;
this.txtZero2.Text = "0";
//
// txtFour2
//
this.txtFour2.Location = new System.Drawing.Point(324, 90);
this.txtFour2.Name = "txtFour2";
this.txtFour2.Size = new System.Drawing.Size(230, 20);
this.txtFour2.TabIndex = 11;
this.txtFour2.Text = "0";
//
// txtTwelve2
//
this.txtTwelve2.Location = new System.Drawing.Point(324, 116);
this.txtTwelve2.Name = "txtTwelve2";
this.txtTwelve2.Size = new System.Drawing.Size(230, 20);
this.txtTwelve2.TabIndex = 12;
this.txtTwelve2.Text = "0";
//
// txtOne
//
this.txtOne.Location = new System.Drawing.Point(12, 38);
this.txtOne.Name = "txtOne";
this.txtOne.Size = new System.Drawing.Size(268, 20);
this.txtOne.TabIndex = 16;
this.txtOne.Text = "AccountsGF";
//
// txtTwo
//
this.txtTwo.Location = new System.Drawing.Point(286, 38);
this.txtTwo.Name = "txtTwo";
this.txtTwo.Size = new System.Drawing.Size(268, 20);
this.txtTwo.TabIndex = 17;
this.txtTwo.Text = "AccountsFF";
//
// ReplaceForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(566, 203);
this.Controls.Add(this.txtTwo);
this.Controls.Add(this.txtOne);
this.Controls.Add(this.label4);
this.Controls.Add(this.label5);
this.Controls.Add(this.label6);
this.Controls.Add(this.txtZero2);
this.Controls.Add(this.txtFour2);
this.Controls.Add(this.txtTwelve2);
this.Controls.Add(this.txtStatus);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtZero1);
this.Controls.Add(this.txtFour1);
this.Controls.Add(this.txtTwelve1);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.dtpTo);
this.Controls.Add(this.dtpFrom);
this.Name = "ReplaceForm";
this.Text = "UpdateForm";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DateTimePicker dtpFrom;
private System.Windows.Forms.DateTimePicker dtpTo;
private System.Windows.Forms.Button btnGo;
private System.Windows.Forms.TextBox txtTwelve1;
private System.Windows.Forms.TextBox txtFour1;
private System.Windows.Forms.TextBox txtZero1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtStatus;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtZero2;
private System.Windows.Forms.TextBox txtFour2;
private System.Windows.Forms.TextBox txtTwelve2;
private System.Windows.Forms.TextBox txtOne;
private System.Windows.Forms.TextBox txtTwo;
}
}

View File

@ -0,0 +1,71 @@
using System;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using Tanshu.Accounts.Helpers;
using System.Collections.Generic;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
using System.Data.SqlClient;
using System.Configuration;
namespace Tanshu.Accounts.PointOfSale
{
public partial class ReplaceForm : Form
{
public ReplaceForm()
{
InitializeComponent();
}
private void btnGo_Click(object sender, EventArgs e)
{
if (!Thread.CurrentPrincipal.IsInRole("Security/CreateUser"))
return;
dtpFrom.Value = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 00:00:00", dtpFrom.Value));
dtpTo.Value = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 23:59:59", dtpTo.Value));
string query = string.Empty;
if (txtStatus.Text == "")
{
txtZero1.Text = GetBalance(0M, txtOne.Text, dtpFrom.Value, dtpTo.Value).ToString();
txtFour1.Text = GetBalance(.04M, txtOne.Text, dtpFrom.Value, dtpTo.Value).ToString();
txtTwelve1.Text = GetBalance(0.125M, txtOne.Text, dtpFrom.Value, dtpTo.Value).ToString();
txtZero2.Text = GetBalance(0M, txtTwo.Text, dtpFrom.Value, dtpTo.Value).ToString();
txtFour2.Text = GetBalance(.04M, txtTwo.Text, dtpFrom.Value, dtpTo.Value).ToString();
txtTwelve2.Text = GetBalance(0.125M, txtTwo.Text, dtpFrom.Value, dtpTo.Value).ToString();
txtStatus.Text = "Initial Values Loaded";
}
else
{
Update(txtOne.Text, txtTwo.Text, dtpFrom.Value, dtpTo.Value);
MessageBox.Show("Data Merged");
}
}
private decimal GetBalance(decimal tax, string database, DateTime startDate, DateTime finishDate)
{
string query = @"
SELECT ISNULL(SUM(i.Amount), 0) FROM {0}.dbo.Vouchers t INNER JOIN {0}.dbo.SaleVoucher s ON t.VoucherID = s.VoucherID
INNER JOIN {0}.dbo.Inventory i ON t.VoucherID = i.VoucherID
WHERE t.Type = 'S' AND t.Date BETWEEN @StartDate AND @FinishDate AND s.Void = 0 AND s.Paid = 1
AND i.Tax = @Tax
";
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString))
{
con.Open();
using (SqlCommand cmd = new SqlCommand(string.Format(query, database), con))
{
cmd.Parameters.AddWithValue("@StartDate", startDate);
cmd.Parameters.AddWithValue("@FinishDate", finishDate);
cmd.Parameters.AddWithValue("@Tax", tax);
return (decimal)cmd.ExecuteScalar();
}
}
}
private bool Update(string sourceDB, string targetDB, DateTime startDate, DateTime finishDate)
{
return new ManagementBI().MergeData(startDate, finishDate, sourceDB, targetDB);
}
}
}

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,78 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
using Tanshu.Accounts.Helpers;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.BI;
namespace Tanshu.Accounts.PointOfSale
{
public partial class SaleTaxReportForm : Form
{
List<SalesAnalysisBO> det;
public SaleTaxReportForm()
{
InitializeComponent();
}
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));
decimal freeSale = 0, voids = 0, pending = 0, net = 0, tax = 0;
det = new SalesAnalysisBI().GetSalesTaxReturn(startDate, finishDate, ref freeSale, ref voids, ref pending, ref net, ref tax);
//dc.CommandTimeout = 50000;
dgvSale.AutoGenerateColumns = true;
dgvSale.DataSource = det;
dgvSale.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dgvSale.Columns[0].Visible = false;
dgvSale.Columns[1].DefaultCellStyle.Format = "%";
dgvSale.Columns[2].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
dgvSale.Columns[3].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
dgvSale.Columns[4].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
// txtFreeSale.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", freeSale);
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.Now;
dtpFinish.Value = DateTime.Now;
ShowStatement();
}
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));
Tanshu.Accounts.Print.Thermal.PrintSale(det, startDate, finishDate);
}
}
}
}

View File

@ -0,0 +1,239 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class SaleTaxReportForm
{
/// <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;
//
// 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,161 @@
namespace Tanshu.Accounts.PointOfSale
{
partial class UpdateForm
{
/// <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.dtpFrom = new System.Windows.Forms.DateTimePicker();
this.dtpTo = new System.Windows.Forms.DateTimePicker();
this.btnGo = new System.Windows.Forms.Button();
this.txtTwelve = new System.Windows.Forms.TextBox();
this.txtFour = new System.Windows.Forms.TextBox();
this.txtZero = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtStatus = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// dtpFrom
//
this.dtpFrom.Location = new System.Drawing.Point(12, 12);
this.dtpFrom.Name = "dtpFrom";
this.dtpFrom.Size = new System.Drawing.Size(268, 20);
this.dtpFrom.TabIndex = 0;
//
// dtpTo
//
this.dtpTo.Location = new System.Drawing.Point(12, 38);
this.dtpTo.Name = "dtpTo";
this.dtpTo.Size = new System.Drawing.Size(268, 20);
this.dtpTo.TabIndex = 1;
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(12, 142);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(268, 23);
this.btnGo.TabIndex = 5;
this.btnGo.Text = "Go";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// txtTwelve
//
this.txtTwelve.Location = new System.Drawing.Point(50, 116);
this.txtTwelve.Name = "txtTwelve";
this.txtTwelve.Size = new System.Drawing.Size(230, 20);
this.txtTwelve.TabIndex = 4;
this.txtTwelve.Text = "0";
//
// txtFour
//
this.txtFour.Location = new System.Drawing.Point(50, 90);
this.txtFour.Name = "txtFour";
this.txtFour.Size = new System.Drawing.Size(230, 20);
this.txtFour.TabIndex = 3;
this.txtFour.Text = "0";
//
// txtZero
//
this.txtZero.Location = new System.Drawing.Point(50, 64);
this.txtZero.Name = "txtZero";
this.txtZero.Size = new System.Drawing.Size(230, 20);
this.txtZero.TabIndex = 2;
this.txtZero.Text = "0";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 67);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(21, 13);
this.label1.TabIndex = 6;
this.label1.Text = "0%";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 93);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(21, 13);
this.label2.TabIndex = 7;
this.label2.Text = "4%";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 119);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(36, 13);
this.label3.TabIndex = 8;
this.label3.Text = "12.5%";
//
// txtStatus
//
this.txtStatus.Location = new System.Drawing.Point(12, 171);
this.txtStatus.Name = "txtStatus";
this.txtStatus.ReadOnly = true;
this.txtStatus.Size = new System.Drawing.Size(268, 20);
this.txtStatus.TabIndex = 9;
//
// UpdateForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 203);
this.Controls.Add(this.txtStatus);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtZero);
this.Controls.Add(this.txtFour);
this.Controls.Add(this.txtTwelve);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.dtpTo);
this.Controls.Add(this.dtpFrom);
this.Name = "UpdateForm";
this.Text = "UpdateForm";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DateTimePicker dtpFrom;
private System.Windows.Forms.DateTimePicker dtpTo;
private System.Windows.Forms.Button btnGo;
private System.Windows.Forms.TextBox txtTwelve;
private System.Windows.Forms.TextBox txtFour;
private System.Windows.Forms.TextBox txtZero;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtStatus;
}
}

View File

@ -0,0 +1,107 @@
using System;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using Tanshu.Accounts.Helpers;
using System.Collections.Generic;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.PointOfSale
{
public partial class UpdateForm : Form
{
private delegate decimal GetTextboxValueDelegate(TextBox textbox);
private delegate decimal ProcessDelegate(DateTime startDate, DateTime endDate, decimal target, decimal tax);
ProcessDelegate processDelegate;
public UpdateForm()
{
InitializeComponent();
}
public void ShowProgress(decimal minimum, decimal total, decimal current, string message)
{
if (!txtStatus.InvokeRequired)
{
txtStatus.Text = string.Format("{0:#,###} / {1:#,###} :: {2}", current, total, message);
}
else
{
ShowProgessDelegate showProgress = new ShowProgessDelegate(ShowProgress);
BeginInvoke(showProgress, new object[] { minimum, total, current, message });
}
}
private void btnGo_Click(object sender, EventArgs e)
{
dtpFrom.Value = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 00:00:00", dtpFrom.Value));
dtpTo.Value = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 23:59:59", dtpTo.Value));
if (!Thread.CurrentPrincipal.IsInRole("Security/CreateUser"))
return;
RunUpdate(-1);
}
private void RunUpdate(decimal last)
{
processDelegate = new ProcessDelegate(Process);
if (last == -1)
processDelegate.BeginInvoke(dtpFrom.Value, dtpTo.Value, GetTextboxValue(txtTwelve), .125M, new AsyncCallback(CallbackMethod), null);
if (last == .125M)
processDelegate.BeginInvoke(dtpFrom.Value, dtpTo.Value, GetTextboxValue(txtFour), .04M, new AsyncCallback(CallbackMethod), null);
if (last == .04M)
processDelegate.BeginInvoke(dtpFrom.Value, dtpTo.Value, GetTextboxValue(txtZero), 0M, new AsyncCallback(CallbackMethod), null);
if (last == 0M)
new ManagementBI().Reorder(dtpFrom.Value, dtpTo.Value, ShowProgress);
}
private void CallbackMethod(IAsyncResult ar)
{
decimal tax = processDelegate.EndInvoke(ar);
RunUpdate(tax);
}
private decimal GetTextboxValue(TextBox textbox)
{
if (!textbox.InvokeRequired)
{
decimal value;
if (!decimal.TryParse(textbox.Text, out value))
value = 0;
return value;
}
else
{
GetTextboxValueDelegate getTextboxValueDelegate = new GetTextboxValueDelegate(GetTextboxValue);
return (decimal)Invoke(getTextboxValueDelegate, new object[] { textbox });
}
}
private decimal Process(DateTime startDate, DateTime endDate, decimal target, decimal tax)
{
ShowProgress(0, 0, 0, string.Format("Starting work on {0:00.00%}. Target : {1:#,###}", tax, target));
if (target == 0)
return tax;
ManagementBI man = new ManagementBI();
List<Guid> list = man.GetUpdateBillList(tax, false, true, false, dtpFrom.Value, dtpTo.Value);
int totalBills = list.Count;
decimal existing = man.GetBalance(tax, dtpFrom.Value, dtpTo.Value);
int i = 0;
decimal work = existing / (existing - target);
while ((existing > target) && (totalBills > 0))
{
int runner = Convert.ToInt32(Math.Floor(work * (i + 1) - i));
if (runner < totalBills - 1)
{
existing -= man.Update(list[runner + 1], tax, dtpFrom.Value, dtpTo.Value);
totalBills--;
i++;
list.Remove(list[runner + 1]);
}
else
{
i = -1;
work = existing / (existing - target);
}
ShowProgress(0, target, existing, string.Format("Working on {0:00.00%}", tax));
}
ShowProgress(0, target, existing, string.Format("Finished {0:00.00%}", tax));
return tax;
}
}
}

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,404 @@
namespace Tanshu.Accounts.PointOfSale.Updates
{
partial class UpdateSales
{
/// <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 dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
this.label1 = new System.Windows.Forms.Label();
this.txtDiff = new System.Windows.Forms.TextBox();
this.dgvPending = new System.Windows.Forms.DataGridView();
this.selectDataGridViewItem = new System.Windows.Forms.DataGridViewButtonColumn();
this.TableID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.voucherIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.billNoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.kotDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tableIDDataGridViewTextBoxColumn = 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.bsPending = new System.Windows.Forms.BindingSource(this.components);
this.dtpFinish = new System.Windows.Forms.DateTimePicker();
this.dtpStart = new System.Windows.Forms.DateTimePicker();
this.label10 = new System.Windows.Forms.Label();
this.btnShowBill = new System.Windows.Forms.Button();
this.bindingSource = new System.Windows.Forms.BindingSource(this.components);
this.label2 = new System.Windows.Forms.Label();
this.txtTarget = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.cmbTax = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.dgvPending)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsPending)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(600, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(23, 13);
this.label1.TabIndex = 8;
this.label1.Text = "Diff";
//
// txtDiff
//
this.txtDiff.Location = new System.Drawing.Point(629, 12);
this.txtDiff.Name = "txtDiff";
this.txtDiff.ReadOnly = true;
this.txtDiff.Size = new System.Drawing.Size(126, 20);
this.txtDiff.TabIndex = 10;
//
// 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;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvPending.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dgvPending.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPending.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.selectDataGridViewItem,
this.TableID,
this.voucherIDDataGridViewTextBoxColumn,
this.billNoDataGridViewTextBoxColumn,
this.kotDataGridViewTextBoxColumn,
this.tableIDDataGridViewTextBoxColumn,
this.amountDataGridViewTextBoxColumn,
this.importantDataGridViewCheckBoxColumn,
this.alarmDataGridViewCheckBoxColumn,
this.bookingTimeDataGridViewTextBoxColumn,
this.lastEditedDataGridViewTextBoxColumn,
this.waiterDataGridViewTextBoxColumn,
this.cashierDataGridViewTextBoxColumn,
this.printedDataGridViewCheckBoxColumn,
this.alarmTimeDataGridViewTextBoxColumn});
this.dgvPending.DataSource = this.bsPending;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvPending.DefaultCellStyle = dataGridViewCellStyle5;
this.dgvPending.Location = new System.Drawing.Point(12, 38);
this.dgvPending.MultiSelect = false;
this.dgvPending.Name = "dgvPending";
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvPending.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
this.dgvPending.RowHeadersVisible = false;
this.dgvPending.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvPending.Size = new System.Drawing.Size(743, 500);
this.dgvPending.TabIndex = 9;
this.dgvPending.VirtualMode = true;
this.dgvPending.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPending_CellContentClick);
//
// selectDataGridViewItem
//
this.selectDataGridViewItem.HeaderText = "Select";
this.selectDataGridViewItem.Name = "selectDataGridViewItem";
this.selectDataGridViewItem.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.selectDataGridViewItem.Text = "Select";
this.selectDataGridViewItem.UseColumnTextForButtonValue = true;
this.selectDataGridViewItem.Width = 43;
//
// TableID
//
this.TableID.DataPropertyName = "TableID";
this.TableID.HeaderText = "TableID";
this.TableID.Name = "TableID";
this.TableID.Width = 70;
//
// voucherIDDataGridViewTextBoxColumn
//
this.voucherIDDataGridViewTextBoxColumn.DataPropertyName = "voucherID";
this.voucherIDDataGridViewTextBoxColumn.HeaderText = "voucherID";
this.voucherIDDataGridViewTextBoxColumn.Name = "voucherIDDataGridViewTextBoxColumn";
this.voucherIDDataGridViewTextBoxColumn.Visible = false;
this.voucherIDDataGridViewTextBoxColumn.Width = 82;
//
// 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;
//
// tableIDDataGridViewTextBoxColumn
//
this.tableIDDataGridViewTextBoxColumn.DataPropertyName = "TableID";
this.tableIDDataGridViewTextBoxColumn.HeaderText = "TableID";
this.tableIDDataGridViewTextBoxColumn.Name = "tableIDDataGridViewTextBoxColumn";
this.tableIDDataGridViewTextBoxColumn.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.Visible = false;
this.importantDataGridViewCheckBoxColumn.Width = 57;
//
// alarmDataGridViewCheckBoxColumn
//
this.alarmDataGridViewCheckBoxColumn.DataPropertyName = "Alarm";
this.alarmDataGridViewCheckBoxColumn.HeaderText = "Alarm";
this.alarmDataGridViewCheckBoxColumn.Name = "alarmDataGridViewCheckBoxColumn";
this.alarmDataGridViewCheckBoxColumn.Visible = false;
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.Visible = false;
this.printedDataGridViewCheckBoxColumn.Width = 46;
//
// alarmTimeDataGridViewTextBoxColumn
//
this.alarmTimeDataGridViewTextBoxColumn.DataPropertyName = "AlarmTime";
this.alarmTimeDataGridViewTextBoxColumn.HeaderText = "AlarmTime";
this.alarmTimeDataGridViewTextBoxColumn.Name = "alarmTimeDataGridViewTextBoxColumn";
this.alarmTimeDataGridViewTextBoxColumn.Visible = false;
this.alarmTimeDataGridViewTextBoxColumn.Width = 81;
//
// bsPending
//
this.bsPending.DataSource = typeof(Tanshu.Accounts.Contracts.PendingBillsBO);
//
// 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 = 2;
//
// 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 = 0;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(108, 18);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(54, 13);
this.label10.TabIndex = 1;
this.label10.Text = "<- Date ->";
//
// btnShowBill
//
this.btnShowBill.Location = new System.Drawing.Point(264, 12);
this.btnShowBill.Name = "btnShowBill";
this.btnShowBill.Size = new System.Drawing.Size(70, 20);
this.btnShowBill.TabIndex = 3;
this.btnShowBill.Text = "Show List";
this.btnShowBill.UseVisualStyleBackColor = true;
this.btnShowBill.Click += new System.EventHandler(this.btnShowBill_Click);
//
// bindingSource
//
this.bindingSource.DataSource = typeof(Tanshu.Accounts.Contracts.SalesBillItemBO);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(340, 18);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(25, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Tax";
//
// txtTarget
//
this.txtTarget.Location = new System.Drawing.Point(474, 12);
this.txtTarget.Name = "txtTarget";
this.txtTarget.Size = new System.Drawing.Size(120, 20);
this.txtTarget.TabIndex = 7;
this.txtTarget.Text = "0";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(430, 18);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 13);
this.label3.TabIndex = 6;
this.label3.Text = "Target";
//
// cmbTax
//
this.cmbTax.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTax.FormattingEnabled = true;
this.cmbTax.Items.AddRange(new object[] {
"0%",
"4%",
"12.5%"});
this.cmbTax.Location = new System.Drawing.Point(371, 10);
this.cmbTax.Name = "cmbTax";
this.cmbTax.Size = new System.Drawing.Size(53, 21);
this.cmbTax.TabIndex = 5;
//
// UpdateSales
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(767, 544);
this.Controls.Add(this.cmbTax);
this.Controls.Add(this.label3);
this.Controls.Add(this.txtTarget);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnShowBill);
this.Controls.Add(this.dtpFinish);
this.Controls.Add(this.dtpStart);
this.Controls.Add(this.label10);
this.Controls.Add(this.dgvPending);
this.Controls.Add(this.txtDiff);
this.Controls.Add(this.label1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "UpdateSales";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Update Sales";
((System.ComponentModel.ISupportInitialize)(this.dgvPending)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsPending)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtDiff;
private System.Windows.Forms.DataGridView dgvPending;
private System.Windows.Forms.DateTimePicker dtpFinish;
private System.Windows.Forms.DateTimePicker dtpStart;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Button btnShowBill;
private System.Windows.Forms.BindingSource bsPending;
private System.Windows.Forms.BindingSource bindingSource;
private System.Windows.Forms.DataGridViewButtonColumn selectDataGridViewItem;
private System.Windows.Forms.DataGridViewTextBoxColumn TableID;
private System.Windows.Forms.DataGridViewTextBoxColumn voucherIDDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn billNoDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn kotDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn tableIDDataGridViewTextBoxColumn;
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.Label label2;
private System.Windows.Forms.TextBox txtTarget;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox cmbTax;
}
}

View File

@ -0,0 +1,53 @@
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.Updates
{
public partial class UpdateSales : Form
{
private List<PendingBillsBO> pendingBills = new List<PendingBillsBO>();
public UpdateSales()
{
InitializeComponent();
}
private void btnShowBill_Click(object sender, EventArgs e)
{
dtpStart.Value = dtpStart.Value.Date;
dtpFinish.Value = dtpFinish.Value.Date.AddDays(1).AddSeconds(-1);
pendingBills = new ManagementBI().GetPaidBills(dtpStart.Value, dtpFinish.Value);
bsPending.DataSource = pendingBills;
decimal? tax = null;
if (cmbTax.Text == "0%")
tax = 0;
else if (cmbTax.Text == "4%")
tax = .04M;
else if (cmbTax.Text == "12.5%")
tax = .125M;
decimal target = Convert.ToDecimal(txtTarget.Text);
decimal existing = new ManagementBI().GetBalance(tax, dtpStart.Value, dtpFinish.Value);
txtDiff.Text = (target - existing).ToString("#,##.00");
}
private void dgvPending_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (bsPending.Current != null)
{
//Guid gd = new Guid(dgvPending.Rows[e.RowIndex].Cells[2].Value.ToString());
PendingBillsBO current = (PendingBillsBO)bsPending.Current;
using (SalesForm frmSale = new SalesForm(current.voucherID))
frmSale.ShowDialog();
btnShowBill_Click(this, null);
}
}
}
}

View File

@ -0,0 +1,132 @@
<?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="selectDataGridViewItem.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="bsPending.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>36, 6</value>
</metadata>
<metadata name="bindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>145, 6</value>
</metadata>
</root>