Management form working with the correct CSV file.

This commit is contained in:
Tanshu
2013-02-12 18:55:10 +05:30
parent a938a9e693
commit fd54104560
25 changed files with 1239 additions and 1707 deletions

View File

@ -180,13 +180,9 @@ namespace Tanshu.Accounts.PointOfSale
btnChangePassword.Visible = Session.IsAuthenticated;
#if (DEBUG)
btnMgtBeer.Visible = true;
btnMgtFood.Visible = true;
btnMgtLiq.Visible = true;
btnManagement.Visible = true;
#else
btnMgtBeer.Visible = false;
btnMgtFood.Visible = false;
btnMgtLiq.Visible = false;
btnManagement.Visible = false;
#endif
}
@ -279,21 +275,9 @@ namespace Tanshu.Accounts.PointOfSale
}
private void btnMgtBeer_Click(object sender, EventArgs e)
private void btnManagement_Click(object sender, EventArgs e)
{
using (var frm = new MoveForm())
frm.ShowDialog();
}
private void btnMgtFood_Click(object sender, EventArgs e)
{
using (var frm = new FoodForm())
frm.ShowDialog();
}
private void btnMgtLiq_Click(object sender, EventArgs e)
{
using (var frm = new AmountForm())
using (var frm = new ManagementForm())
frm.ShowDialog();
}
}

View File

@ -49,9 +49,7 @@
this.btnDiscountReport = new System.Windows.Forms.Button();
this.btnChangePassword = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.btnMgtBeer = new System.Windows.Forms.Button();
this.btnMgtFood = new System.Windows.Forms.Button();
this.btnMgtLiq = new System.Windows.Forms.Button();
this.btnManagement = new System.Windows.Forms.Button();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
@ -99,9 +97,7 @@
this.flowLayoutPanel1.Controls.Add(this.btnDiscountReport);
this.flowLayoutPanel1.Controls.Add(this.btnChangePassword);
this.flowLayoutPanel1.Controls.Add(this.btnExit);
this.flowLayoutPanel1.Controls.Add(this.btnMgtBeer);
this.flowLayoutPanel1.Controls.Add(this.btnMgtFood);
this.flowLayoutPanel1.Controls.Add(this.btnMgtLiq);
this.flowLayoutPanel1.Controls.Add(this.btnManagement);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
@ -307,38 +303,16 @@
this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// btnMgtBeer
// btnManagement
//
this.btnMgtBeer.Location = new System.Drawing.Point(4, 528);
this.btnMgtBeer.Margin = new System.Windows.Forms.Padding(4);
this.btnMgtBeer.Name = "btnMgtBeer";
this.btnMgtBeer.Size = new System.Drawing.Size(200, 123);
this.btnMgtBeer.TabIndex = 20;
this.btnMgtBeer.Text = "Beer Quantity";
this.btnMgtBeer.UseVisualStyleBackColor = true;
this.btnMgtBeer.Click += new System.EventHandler(this.btnMgtBeer_Click);
//
// btnMgtFood
//
this.btnMgtFood.Location = new System.Drawing.Point(212, 528);
this.btnMgtFood.Margin = new System.Windows.Forms.Padding(4);
this.btnMgtFood.Name = "btnMgtFood";
this.btnMgtFood.Size = new System.Drawing.Size(200, 123);
this.btnMgtFood.TabIndex = 22;
this.btnMgtFood.Text = "Food Amount";
this.btnMgtFood.UseVisualStyleBackColor = true;
this.btnMgtFood.Click += new System.EventHandler(this.btnMgtFood_Click);
//
// btnMgtLiq
//
this.btnMgtLiq.Location = new System.Drawing.Point(420, 528);
this.btnMgtLiq.Margin = new System.Windows.Forms.Padding(4);
this.btnMgtLiq.Name = "btnMgtLiq";
this.btnMgtLiq.Size = new System.Drawing.Size(200, 123);
this.btnMgtLiq.TabIndex = 23;
this.btnMgtLiq.Text = "Liq Amount";
this.btnMgtLiq.UseVisualStyleBackColor = true;
this.btnMgtLiq.Click += new System.EventHandler(this.btnMgtLiq_Click);
this.btnManagement.Location = new System.Drawing.Point(4, 528);
this.btnManagement.Margin = new System.Windows.Forms.Padding(4);
this.btnManagement.Name = "btnManagement";
this.btnManagement.Size = new System.Drawing.Size(200, 123);
this.btnManagement.TabIndex = 20;
this.btnManagement.Text = "Management";
this.btnManagement.UseVisualStyleBackColor = true;
this.btnManagement.Click += new System.EventHandler(this.btnManagement_Click);
//
// MainForm
//
@ -346,7 +320,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1056, 661);
this.Controls.Add(this.flowLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@ -380,9 +354,7 @@
private System.Windows.Forms.Button btnOpenBill;
private System.Windows.Forms.Button btnBillDetails;
private System.Windows.Forms.Button btnVoidOrReprints;
private System.Windows.Forms.Button btnMgtBeer;
private System.Windows.Forms.Button btnManagement;
private System.Windows.Forms.Button btnDiscountReport;
private System.Windows.Forms.Button btnMgtFood;
private System.Windows.Forms.Button btnMgtLiq;
}
}

View File

@ -1,49 +0,0 @@
using System;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
namespace Tanshu.Accounts.Management
{
public partial class AmountForm : Form
{
public AmountForm()
{
InitializeComponent();
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpStart.Value = DateTime.Today;
dtpFinish.Value = DateTime.Today;
}
private void btnGo_Click(object sender, EventArgs e)
{
dtpStart.Value = dtpStart.Value.Date.AddHours(7);
dtpFinish.Value = dtpFinish.Value.Date.AddDays(1).AddHours(7);
var amount = GetAmount();
var newAmount = TryConvert(txtQuantity.Text);
if (MessageBox.Show(amount.ToString(), "Amounts", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes && amount > newAmount)
{
MessageBox.Show(SetAmount(newAmount).ToString());
}
}
private decimal TryConvert(string amount)
{
decimal result = 0;
decimal.TryParse(amount, out result);
return result;
}
private decimal GetAmount()
{
using (var bi = new ManagementBI())
return bi.GetFood(2, dtpStart.Value, dtpFinish.Value);
}
private decimal SetAmount(decimal quantity)
{
using (var bi = new ManagementBI())
return bi.SetAmount(2, quantity, dtpStart.Value, dtpFinish.Value);
}
}
}

View File

@ -1,46 +0,0 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Management
{
public partial class FoodForm : Form
{
public FoodForm()
{
InitializeComponent();
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpStart.Value = DateTime.Today;
dtpFinish.Value = DateTime.Today;
}
private void btnGo_Click(object sender, EventArgs e)
{
dtpStart.Value = dtpStart.Value.Date.AddHours(7);
dtpFinish.Value = dtpFinish.Value.Date.AddDays(1).AddHours(7);
var amount = GetFood();
var newAmount = Convert.ToDecimal(txtQuantity.Text);
if (MessageBox.Show(amount.ToString(), "Food Sales", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes && amount > newAmount)
{
MessageBox.Show(SetFood(newAmount).ToString());
}
}
private decimal GetFood()
{
using (var bi = new ManagementBI())
return bi.GetFood(1, dtpStart.Value, dtpFinish.Value);
}
private decimal SetFood(decimal quantity)
{
using (var bi = new ManagementBI())
return bi.SetFood(1, quantity, dtpStart.Value, dtpFinish.Value);
}
}
}

View File

@ -1,116 +0,0 @@
namespace Tanshu.Accounts.Management
{
partial class FoodForm
{
/// <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.dtpFinish = new System.Windows.Forms.DateTimePicker();
this.dtpStart = new System.Windows.Forms.DateTimePicker();
this.label10 = new System.Windows.Forms.Label();
this.txtQuantity = new System.Windows.Forms.TextBox();
this.btnGo = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// dtpFinish
//
this.dtpFinish.CustomFormat = "dd-MMM-yyyy";
this.dtpFinish.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpFinish.Location = new System.Drawing.Point(224, 15);
this.dtpFinish.Margin = new System.Windows.Forms.Padding(4);
this.dtpFinish.Name = "dtpFinish";
this.dtpFinish.Size = new System.Drawing.Size(119, 22);
this.dtpFinish.TabIndex = 21;
//
// dtpStart
//
this.dtpStart.CustomFormat = "dd-MMM-yyyy";
this.dtpStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpStart.Location = new System.Drawing.Point(16, 15);
this.dtpStart.Margin = new System.Windows.Forms.Padding(4);
this.dtpStart.Name = "dtpStart";
this.dtpStart.Size = new System.Drawing.Size(119, 22);
this.dtpStart.TabIndex = 20;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(144, 20);
this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(72, 17);
this.label10.TabIndex = 22;
this.label10.Text = "<- Date ->";
//
// txtQuantity
//
this.txtQuantity.Location = new System.Drawing.Point(16, 223);
this.txtQuantity.Margin = new System.Windows.Forms.Padding(4);
this.txtQuantity.Name = "txtQuantity";
this.txtQuantity.Size = new System.Drawing.Size(445, 22);
this.txtQuantity.TabIndex = 5;
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(16, 255);
this.btnGo.Margin = new System.Windows.Forms.Padding(4);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(200, 28);
this.btnGo.TabIndex = 24;
this.btnGo.Text = "Go";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// FoodForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(479, 298);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.dtpFinish);
this.Controls.Add(this.dtpStart);
this.Controls.Add(this.label10);
this.Controls.Add(this.txtQuantity);
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.Name = "FoodForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sale Analysis Form";
this.Load += new System.EventHandler(this.Sale_Analysis_Form_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DateTimePicker dtpFinish;
private System.Windows.Forms.DateTimePicker dtpStart;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtQuantity;
private System.Windows.Forms.Button btnGo;
}
}

View File

@ -1,120 +0,0 @@
<?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,538 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
namespace Tanshu.Accounts.Management
{
public partial class ManagementForm : Form
{
public ManagementForm()
{
InitializeComponent();
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpStart.Value = DateTime.Today;
dtpFinish.Value = DateTime.Today;
}
private void btnGo_Click(object sender, EventArgs e)
{
var currentDirectory = AppDomain.CurrentDomain.BaseDirectory;
var beer = Path.Combine(currentDirectory, "beer.csv");
var sale = Path.Combine(currentDirectory, "sale.csv");
var credit = Path.Combine(currentDirectory, "credit.csv");
var error = string.Empty;
if (!File.Exists(beer))
error += "Beer not found! ";
if (!File.Exists(sale))
error += "Sale not found! ";
if (!File.Exists(credit))
error += "Credit not found";
if (!string.IsNullOrEmpty(error))
{
MessageBox.Show(error);
}
else
{
btnGo.Enabled = false;
var beerDates = GetBeer(beer);
var saleDates = GetSale(sale);
var creditDates = GetCredit(credit);
var info = string.Empty;
foreach (var item in saleDates)
{
var startDate = item.StartDate;
var finishDate = item.FinishDate;
Debug.WriteLine("Starting on " + startDate.ToShortDateString() + " to " + finishDate.ToShortDateString());
ProcessData(true, startDate, finishDate, item.Sale15 + item.Sale25);
Debug.WriteLine("Starting beer");
ProcessBeer(beerDates, startDate, finishDate);
Debug.WriteLine("Starting sale");
info += ProcessSale(item, creditDates);
Debug.WriteLine("Starting cleanup");
ProcessData(false, startDate, finishDate, item.Sale15 + item.Sale25);
Debug.WriteLine("Cleanup done");
}
MessageBox.Show(info);
btnGo.Enabled = true;
}
}
#region Get Data
protected class SaleData
{
public DateTime StartDate { get; set; }
public DateTime FinishDate { get; set; }
public decimal Sale125 { get; set; }
public decimal Sale25 { get; set; }
public decimal Sale15 { get; set; }
public decimal Sale0 { get; set; }
}
private IEnumerable<SaleData> GetSale(string sale)
{
IFormatProvider culture = new CultureInfo("en-US", true);
var startDate = dtpStart.Value.Date;
var finishDate = dtpFinish.Value.Date;
var dates = new List<SaleData>();
using (var reader = new StreamReader(File.OpenRead(sale)))
{
while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(',');
if (values.Length != 6)
{
MessageBox.Show("Error reading line: " + line);
continue;
}
DateTime dateStart;
DateTime dateFinish;
if (!DateTime.TryParseExact(values[0], "dd-MM-yyyy", culture, DateTimeStyles.NoCurrentDateDefault, out dateStart))
continue;
if (!DateTime.TryParseExact(values[1], "dd-MM-yyyy", culture, DateTimeStyles.NoCurrentDateDefault, out dateFinish))
continue;
if (dateFinish.Date < startDate.Date || dateStart.Date > finishDate.Date)
continue;
dates.Add(new SaleData
{
StartDate = dateStart,
FinishDate = dateFinish,
Sale125 = TryConvert(values[2]),
Sale25 = TryConvert(values[3]),
Sale15 = TryConvert(values[4]),
Sale0 = TryConvert(values[5])
});
}
}
return dates;
}
private Dictionary<DateTime, decimal> GetCredit(string credit)
{
IFormatProvider culture = new CultureInfo("en-US", true);
var startDate = dtpStart.Value.Date.AddHours(7);
var finishDate = dtpFinish.Value.Date.AddDays(1).AddHours(7);
var dates = new Dictionary<DateTime, decimal>();
using (var reader = new StreamReader(File.OpenRead(credit)))
{
while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(',');
if (values.Length != 2)
{
MessageBox.Show("Error reading line: " + line);
continue;
}
DateTime dateOut;
if (!DateTime.TryParseExact(values[0], "dd/MM/yyyy", culture, DateTimeStyles.NoCurrentDateDefault, out dateOut))
continue;
if (dateOut.Date < startDate.Date || dateOut.Date >= finishDate.Date)
continue;
var amount = TryConvert(values[1]);
if (!dates.ContainsKey(dateOut))
dates.Add(dateOut, amount);
}
}
return dates;
}
private Dictionary<DateTime, decimal> GetBeer(string beer)
{
IFormatProvider culture = new CultureInfo("en-US", true);
var startDate = dtpStart.Value.Date.AddHours(7);
var finishDate = dtpFinish.Value.Date.AddDays(1).AddHours(7);
var dates = new Dictionary<DateTime, decimal>();
using (var reader = new StreamReader(File.OpenRead(beer)))
{
while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(',');
DateTime dateOut;
if (!DateTime.TryParseExact(values[0], "dd-MMM-yy", culture, DateTimeStyles.NoCurrentDateDefault, out dateOut))
continue;
if (dateOut.Date < startDate.Date || dateOut.Date >= finishDate.Date)
continue;
decimal amount = 0;
if (values.Length > 1) // Dark - Location 1, Basecode 1
amount += TryConvert(values[1]);
if (values.Length > 2) // Wheat - Location 2, Basecode 2
amount += TryConvert(values[2]);
if (values.Length > 3) // Light - Location 3, Basecode 4
amount += TryConvert(values[3]);
if (values.Length > 4) // Premium - Location 4, Basecode 3
amount += TryConvert(values[4]);
dates.Add(dateOut, amount);
}
}
return dates;
}
#endregion
private static void ProcessData(bool opening, DateTime startIn, DateTime finishIn, decimal liqTarget)
{
var startDate = startIn.AddHours(7);
var finishDate = finishIn.AddDays(1).AddHours(7);
if (opening)
{
using (var bi = new ManagementBI())
{
bi.DeleteVoid(startDate, finishDate);
}
using (var bi = new ManagementBI())
{
bi.DeleteStaff(startDate, finishDate);
}
using (var bi = new ManagementBI())
{
bi.ClearModifiers(startDate, finishDate);
}
using (var bi = new ManagementBI())
{
bi.CombineKots(startDate, finishDate);
}
using (var bi = new ManagementBI())
{
bi.RemoveBlankKots(startDate, finishDate);
}
using (var bi = new ManagementBI())
{
bi.MoveNc(startDate, finishDate, liqTarget);
}
}
else
{
using (var bi = new ManagementBI())
{
bi.SetPayments(startDate, finishDate);
}
}
}
private static void ProcessBeer(Dictionary<DateTime, decimal> dates, DateTime startIn, DateTime finishIn)
{
using (var bi = new ManagementBI())
{
var info = string.Empty;
foreach (var item in dates)
{
if (item.Key < startIn || item.Key > finishIn)
continue;
var stDt = item.Key.AddHours(7);
var fiDt = stDt.AddDays(1);
var original = bi.GetQuantity(stDt, fiDt);
if (original < item.Value)
{
info += "Original for " + item.Key.ToString() + " is " + original.ToString() + " desired is " + item.Value.ToString() + "\r\n";
}
else if (original == item.Value)
{
info += item.Key.ToString() + " is " + original.ToString() + " matches!" + "\r\n";
}
else
{
bi.SetQuantity(stDt, fiDt, item.Value);
}
}
}
}
private static string ProcessSale(SaleData item, Dictionary<DateTime, decimal> creditDates)
{
var info = string.Empty;
var startDate = item.StartDate.AddHours(7);
var finishDate = item.FinishDate.AddHours(7).AddDays(1);
var creditInfo = creditDates.Where(x => x.Key >= item.StartDate && x.Key <= item.FinishDate).ToDictionary(x => x.Key, x => x.Value);
info += "From " + startDate.ToShortDateString() + " to " + finishDate.ToShortDateString() + "\r\n";
using (var bi = new ManagementBI())
{
info += "25%\t" + bi.GetFood(.26250M, startDate, finishDate) + "\t";
var ret = bi.SetLiq(.26250M, item.Sale25, startDate, finishDate);
info += ret + "\t" + item.Sale25.ToString() + "\r\n";
}
using (var bi = new ManagementBI())
{
info += "15%\t" + bi.GetFood(.1575M, startDate, finishDate) + "\t";
var ret = bi.SetLiq(.1575M, item.Sale15, startDate, finishDate);
info += ret + "\t" + item.Sale15.ToString() + "\r\n";
}
using (var bi = new ManagementBI())
{
info += "12.5%\t" + bi.GetFood(.13125M, startDate, finishDate) + "\t";
var ret = bi.SetFood(.13125M, item.Sale125, startDate, finishDate);
info += ret + "\t" + item.Sale125.ToString() + "\r\n";
}
using (var bi = new ManagementBI())
{
info += "0%\t" + bi.GetFood(0M, startDate, finishDate) + "\t";
var ret = bi.SetFood(0M, item.Sale0, startDate, finishDate);
info += ret + "\t" + item.Sale0.ToString() + "\r\n";
}
return info;
}
private static decimal TryConvert(string amount)
{
decimal result = 0;
decimal.TryParse(amount, out result);
return result;
}
private void button1_Click(object sender, EventArgs e)
{
var startDate = dtpStart.Value.Date;
var finishDate = dtpFinish.Value.Date;
var daybook = @"
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Import Data</TALLYREQUEST>
</HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>All Masters</REPORTNAME>
<STATICVARIABLES>
<SVCURRENTCOMPANY>Peitho Foods Pvt. Ltd.(2012-13)</SVCURRENTCOMPANY>
</STATICVARIABLES>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF=""TallyUDF"">
";
for (var date = startDate; date <= finishDate; date = date.AddDays(1))
{
daybook += GetVoucher(date);
}
daybook += @"
</TALLYMESSAGE>
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>
";
Clipboard.SetText(daybook, TextDataFormat.Text);
}
private static string GetVoucher(DateTime date)
{
var currentStart = date.AddHours(7);
var currentFinish = date.AddDays(1).AddHours(7);
var voucher = string.Empty;
var cash = 0M;
using (var bi = new ManagementBI())
{
var sale = Math.Round(bi.GetFood(.26250M, currentStart, currentFinish));
var vat = 0M;
if (sale != 0)
{
cash += sale;
voucher += GetLedger("Sale @ 25 %", sale.ToString("#0.00"));
vat = Math.Round(bi.GetVat(.26250M, currentStart, currentFinish));
cash += vat;
voucher += GetLedger("Output Vat @ 25%", vat.ToString("#0.00"));
}
sale = Math.Round(bi.GetFood(.1575M, currentStart, currentFinish));
if (sale != 0)
{
cash += sale;
voucher += GetLedger("Sale @ 15%", sale.ToString("#0.00"));
vat = Math.Round(bi.GetVat(.1575M, currentStart, currentFinish));
cash += vat;
voucher += GetLedger("Output Vat @ 15%", vat.ToString("#0.00"));
}
sale = Math.Round(bi.GetFood(.13125M, currentStart, currentFinish));
if (sale != 0)
{
cash += sale;
voucher += GetLedger("Sale 12.5%", sale.ToString("#0.00"));
vat = Math.Round(bi.GetVat(.13125M, currentStart, currentFinish));
cash += vat;
voucher += GetLedger("Output Vat 12.5%", vat.ToString("#0.00"));
}
sale = Math.Round(bi.GetFood(0M, currentStart, currentFinish));
if (sale != 0)
{
cash += sale;
voucher += GetLedger("Sale Tax Free", sale.ToString("#0.00"));
}
vat = Math.Round(bi.GetServiceTax(currentStart, currentFinish));
if (vat != 0)
{
cash += vat;
voucher += GetLedger("Central Service Tax@3.708%", vat.ToString("#0.00"));
}
if (cash != 0)
{
voucher = GetLedger("Cash", cash.ToString("#0.00")) + voucher;
}
}
return voucher != "" ? GetVoucher(date.ToString("yyyyMMdd"), voucher) : "";
}
private static string GetVoucher(string date, string ledgers)
{
#region Voucher Template
var template = @"
<VOUCHER REMOTEID=""{0}"" VCHTYPE=""Journal"" ACTION=""Create"">
<DATE>{1}</DATE>
<GUID>{0}</GUID>
<VOUCHERTYPENAME>Journal</VOUCHERTYPENAME>
<VOUCHERNUMBER>349</VOUCHERNUMBER>
<PARTYLEDGERNAME>Cash</PARTYLEDGERNAME>
<CSTFORMISSUETYPE/>
<CSTFORMRECVTYPE/>
<FBTPAYMENTTYPE>Default</FBTPAYMENTTYPE>
<VCHGSTCLASS/>
<ENTEREDBY>Admin</ENTEREDBY>
<DIFFACTUALQTY>No</DIFFACTUALQTY>
<AUDITED>No</AUDITED>
<FORJOBCOSTING>No</FORJOBCOSTING>
<ISOPTIONAL>No</ISOPTIONAL>
<EFFECTIVEDATE>{1}</EFFECTIVEDATE>
<USEFORINTEREST>No</USEFORINTEREST>
<USEFORGAINLOSS>No</USEFORGAINLOSS>
<USEFORGODOWNTRANSFER>No</USEFORGODOWNTRANSFER>
<USEFORCOMPOUND>No</USEFORCOMPOUND>
<ALTERID> 3525</ALTERID>
<EXCISEOPENING>No</EXCISEOPENING>
<ISCANCELLED>No</ISCANCELLED>
<HASCASHFLOW>Yes</HASCASHFLOW>
<ISPOSTDATED>No</ISPOSTDATED>
<USETRACKINGNUMBER>No</USETRACKINGNUMBER>
<ISINVOICE>No</ISINVOICE>
<MFGJOURNAL>No</MFGJOURNAL>
<HASDISCOUNTS>No</HASDISCOUNTS>
<ASPAYSLIP>No</ASPAYSLIP>
<ISDELETED>No</ISDELETED>
<ASORIGINAL>No</ASORIGINAL>
{2}
</VOUCHER>
";
var servicetaxtemplate = @"";
#endregion
return string.Format(template, Guid.NewGuid(), date, ledgers);
}
private static string GetLedger(string ledgername, string amount)
{
var isDeemedPositive = string.Empty;
var isPartyLedger = string.Empty;
switch (ledgername)
{
case "Cash":
isDeemedPositive = "Yes";
isPartyLedger = "Yes";
amount = "-" + amount;
break;
case "Sale 12.5%":
isDeemedPositive = "No";
isPartyLedger = "No";
break;
case "Sale @ 15%":
isDeemedPositive = "No";
isPartyLedger = "No";
break;
case "Sale @ 25 %":
isDeemedPositive = "No";
isPartyLedger = "No";
break;
case "Sale Tax Free":
isDeemedPositive = "No";
isPartyLedger = "No";
break;
case "Output Vat 12.5%":
isDeemedPositive = "No";
isPartyLedger = "No";
break;
case "Output Vat @ 15%":
isDeemedPositive = "No";
isPartyLedger = "No";
break;
case "Output Vat @ 25%":
isDeemedPositive = "No";
isPartyLedger = "No";
break;
case "Central Service Tax@3.708%":
isDeemedPositive = "No";
isPartyLedger = "No";
break;
}
#region Voucher Template
const string template = @"
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>{0}</LEDGERNAME>
<GSTCLASS/>
<ISDEEMEDPOSITIVE>{1}</ISDEEMEDPOSITIVE>
<LEDGERFROMITEM>No</LEDGERFROMITEM>
<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES>
<ISPARTYLEDGER>{2}</ISPARTYLEDGER>
<AMOUNT>{3}</AMOUNT>
</ALLLEDGERENTRIES.LIST>
";
var servicetaxtemplate = @"";
#endregion
return string.Format(template, ledgername, isDeemedPositive, isPartyLedger, amount);
}
private void button2_Click(object sender, EventArgs e)
{
using (var bi = new ManagementBI())
{
bi.FinalSanction(dtpStart.Value.Date.AddHours(7), dtpFinish.Value.Date.AddDays(1).AddHours(7));
}
}
private void button3_Click(object sender, EventArgs e)
{
button3.Enabled = false;
var startDate = dtpStart.Value.Date;
var finishDate = dtpFinish.Value.Date;
var sheet = "Date\t Bill Start\t Bill Final\t Sale 0%\t Sale 12.5%\t Sale 15%\t Sale 25%\t Vat 12.5%\t Vat 15%\t Vat 25%\t Service Tax\n";
for (var date = startDate; date <= finishDate; date = date.AddDays(1))
{
sheet += GetExcel(date);
}
Clipboard.SetText(sheet, TextDataFormat.Text);
button3.Enabled = true;
}
private static string GetExcel(DateTime date)
{
using (var bi = new ManagementBI())
{
var currentStart = date.AddHours(7);
var currentFinish = date.AddDays(1).AddHours(7);
var cash = bi.GetFirstBill(date);
if (cash == "")
return "";
cash = string.Format("{0:dd-MMM-yyyy}\t'{1}\t'{2}\t", date, cash, bi.GetLastBill(date));
cash += string.Format("{0:#0}\t", Math.Round(bi.GetFood(0M, currentStart, currentFinish)));
cash += string.Format("{0:#0}\t", Math.Round(bi.GetFood(.13125M, currentStart, currentFinish)));
cash += string.Format("{0:#0}\t", Math.Round(bi.GetFood(.1575M, currentStart, currentFinish)));
cash += string.Format("{0:#0}\t", Math.Round(bi.GetFood(.2625M, currentStart, currentFinish)));
cash += string.Format("{0:#0}\t", Math.Round(bi.GetVat(.13125M, currentStart, currentFinish)));
cash += string.Format("{0:#0}\t", Math.Round(bi.GetVat(.1575M, currentStart, currentFinish)));
cash += string.Format("{0:#0}\t", Math.Round(bi.GetVat(.2625M, currentStart, currentFinish)));
cash += string.Format("{0:#0}\n", Math.Round(bi.GetServiceTax(currentStart, currentFinish)));
return cash;
}
}
}
}

View File

@ -1,6 +1,6 @@
namespace Tanshu.Accounts.Management
{
partial class AmountForm
partial class ManagementForm
{
/// <summary>
/// Required designer variable.
@ -31,8 +31,10 @@
this.dtpFinish = new System.Windows.Forms.DateTimePicker();
this.dtpStart = new System.Windows.Forms.DateTimePicker();
this.label10 = new System.Windows.Forms.Label();
this.txtQuantity = new System.Windows.Forms.TextBox();
this.btnGo = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// dtpFinish
@ -65,16 +67,9 @@
this.label10.TabIndex = 22;
this.label10.Text = "<- Date ->";
//
// txtQuantity
//
this.txtQuantity.Location = new System.Drawing.Point(16, 223);
this.txtQuantity.Margin = new System.Windows.Forms.Padding(4);
this.txtQuantity.Name = "txtQuantity";
this.txtQuantity.Size = new System.Drawing.Size(445, 22);
this.txtQuantity.TabIndex = 5;
//
// btnGo
//
this.btnGo.Enabled = false;
this.btnGo.Location = new System.Drawing.Point(16, 255);
this.btnGo.Margin = new System.Windows.Forms.Padding(4);
this.btnGo.Name = "btnGo";
@ -84,19 +79,54 @@
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// FoodForm
// button1
//
this.button1.Location = new System.Drawing.Point(224, 255);
this.button1.Margin = new System.Windows.Forms.Padding(4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(200, 28);
this.button1.TabIndex = 25;
this.button1.Text = "Tally";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(16, 219);
this.button2.Margin = new System.Windows.Forms.Padding(4);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(200, 28);
this.button2.TabIndex = 26;
this.button2.Text = "Final Sanction";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(224, 219);
this.button3.Margin = new System.Windows.Forms.Padding(4);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(200, 28);
this.button3.TabIndex = 27;
this.button3.Text = "Excel";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// ManagementForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(479, 298);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.dtpFinish);
this.Controls.Add(this.dtpStart);
this.Controls.Add(this.label10);
this.Controls.Add(this.txtQuantity);
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.Name = "FoodForm";
this.Name = "ManagementForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sale Analysis Form";
this.Load += new System.EventHandler(this.Sale_Analysis_Form_Load);
@ -110,7 +140,9 @@
private System.Windows.Forms.DateTimePicker dtpFinish;
private System.Windows.Forms.DateTimePicker dtpStart;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtQuantity;
private System.Windows.Forms.Button btnGo;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
}
}

View File

@ -1,162 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
namespace Tanshu.Accounts.Management
{
public partial class MoveForm : Form
{
private IList<ComboBox> comboBoxes;
private IDictionary<int, string> list;
public MoveForm()
{
InitializeComponent();
list = new Dictionary<int, string>
{
{1, "1 - Dark"},
{2, "2 - Wheat"},
{3, "3 - Premium"},
{4, "4 - Light"},
{5, "5 - Dragon"},
{6, "6 - Festival"},
{7, "7 - Vanilla"},
{8, "8 - Strong"}
};
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpStartDate.Value = DateTime.Today;
dtpFinishDate.Value = DateTime.Today;
}
private void btnGo_Click(object sender, EventArgs e)
{
comboBoxes = new List<ComboBox>();
var startDate = dtpStartDate.Value.Date.AddHours(7);
var finishDate = dtpFinishDate.Value.Date.AddDays(1).AddHours(7);
var details = GetMove(startDate, finishDate);
foreach (var detail in details)
{
var item = (object[])detail;
var text = GetName((int)item[0]) + " ---> " + ((decimal)item[1]).ToString();
var label = new Label()
{
Name = "label" + ((int)item[0]).ToString(CultureInfo.InvariantCulture),
AutoSize = true,
Text = text
};
flpProducts.Controls.Add(label);
var comboBox = GetBox((int)item[0]);
comboBoxes.Add(comboBox);
flpProducts.Controls.Add(comboBox);
}
//foreach (var comboBox in comboBoxes)
//{
// var startDate = dtpStartDate.Value.Date.AddHours(7);
// var finishDate = startDate.AddDays(1);
// var baseCode = (int)(((object[])comboBox.Tag)[0]);
// var text = (string)(((object[])comboBox.Tag)[1]);
// foreach (var item in comboBox.Text.Split(','))
// {
// var newQuantity = TryConvert(item);
// var quantity = GetQuantity(baseCode, startDate, finishDate);
// if (MessageBox.Show(text + " " + startDate.ToString("dd-MMM-yyyy") + " " + quantity.ToString(), "Quantity of Beer", MessageBoxButtons.YesNo,
// MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes &&
// quantity > newQuantity && newQuantity > 0)
// {
// MessageBox.Show(SetQuantity(baseCode, newQuantity, startDate, finishDate).ToString());
// }
// startDate = startDate.AddDays(1);
// finishDate = finishDate.AddDays(1);
// }
//}
}
private ComboBox GetBox(int code)
{
var comboBox = new ComboBox()
{
Name = "comboBox" + (code).ToString(CultureInfo.InvariantCulture),
Width = 400,
Height = 20,
Tag = code,
DisplayMember = "Value",
ValueMember = "Key",
DropDownStyle = ComboBoxStyle.DropDownList,
DataSource = new BindingSource(list, null)
};
//foreach (var item in list)
// comboBox.Items.Add(new { Code = item.Key, Name = item.Value });
//MessageBox.Show(code.ToString());
//comboBox.SelectedIndex = code - 1;
comboBox.SelectedValue = code;
return comboBox;
}
private static string GetName(int code)
{
switch (code)
{
case 1:
return "1 - Dark";
case 2:
return "2 - Wheat";
case 3:
return "3 - Premium";
case 4:
return "4 - Light";
case 5:
return "5 - Dragon";
case 6:
return "6 - Festival";
case 7:
return "7 - Vanilla";
case 8:
return "8 - Strong";
default:
return "";
}
}
private static decimal TryConvert(string amount)
{
decimal result = 0;
decimal.TryParse(amount, out result);
return result;
}
private static IList GetMove(DateTime startDate, DateTime finishDate)
{
using (var bi = new ManagementBI())
return bi.GetMove(startDate, finishDate);
}
private static void SetMove(int fromBaseCode, int toBaseCode, DateTime startDate, DateTime finishDate)
{
using (var bi = new ManagementBI())
bi.SetMove(fromBaseCode, toBaseCode, startDate, finishDate);
}
private void btnProcess_Click(object sender, EventArgs e)
{
btnProcess.Enabled = false;
var startDate = dtpStartDate.Value.Date.AddHours(7);
var finishDate = dtpFinishDate.Value.Date.AddDays(1).AddHours(7);
foreach (var item in comboBoxes)
{
var fromBaseCode = (int) item.Tag;
var toBaseCode = (int) item.SelectedValue;
if (fromBaseCode == toBaseCode)
continue;
Text = GetName(fromBaseCode) + " to " + GetName(toBaseCode);
MessageBox.Show(Text);
SetMove(fromBaseCode, toBaseCode, startDate , finishDate);
}
}
}
}

View File

@ -1,119 +0,0 @@
namespace Tanshu.Accounts.Management
{
partial class MoveForm
{
/// <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.dtpStartDate = new System.Windows.Forms.DateTimePicker();
this.flpProducts = new System.Windows.Forms.FlowLayoutPanel();
this.btnGo = new System.Windows.Forms.Button();
this.dtpFinishDate = new System.Windows.Forms.DateTimePicker();
this.btnProcess = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// dtpStartDate
//
this.dtpStartDate.CustomFormat = "dd-MMM-yyyy";
this.dtpStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpStartDate.Location = new System.Drawing.Point(16, 15);
this.dtpStartDate.Margin = new System.Windows.Forms.Padding(4);
this.dtpStartDate.Name = "dtpStartDate";
this.dtpStartDate.Size = new System.Drawing.Size(119, 22);
this.dtpStartDate.TabIndex = 0;
//
// flpProducts
//
this.flpProducts.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.flpProducts.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flpProducts.Location = new System.Drawing.Point(16, 47);
this.flpProducts.Margin = new System.Windows.Forms.Padding(4);
this.flpProducts.Name = "flpProducts";
this.flpProducts.Size = new System.Drawing.Size(447, 390);
this.flpProducts.TabIndex = 2;
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(16, 445);
this.btnGo.Margin = new System.Windows.Forms.Padding(4);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(200, 28);
this.btnGo.TabIndex = 24;
this.btnGo.Text = "Load";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// dtpFinishDate
//
this.dtpFinishDate.CustomFormat = "dd-MMM-yyyy";
this.dtpFinishDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpFinishDate.Location = new System.Drawing.Point(143, 15);
this.dtpFinishDate.Margin = new System.Windows.Forms.Padding(4);
this.dtpFinishDate.Name = "dtpFinishDate";
this.dtpFinishDate.Size = new System.Drawing.Size(119, 22);
this.dtpFinishDate.TabIndex = 1;
//
// btnProcess
//
this.btnProcess.Location = new System.Drawing.Point(263, 445);
this.btnProcess.Margin = new System.Windows.Forms.Padding(4);
this.btnProcess.Name = "btnProcess";
this.btnProcess.Size = new System.Drawing.Size(200, 28);
this.btnProcess.TabIndex = 25;
this.btnProcess.Text = "Process";
this.btnProcess.UseVisualStyleBackColor = true;
this.btnProcess.Click += new System.EventHandler(this.btnProcess_Click);
//
// MoveForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(479, 488);
this.Controls.Add(this.btnProcess);
this.Controls.Add(this.dtpFinishDate);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.flpProducts);
this.Controls.Add(this.dtpStartDate);
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.Name = "MoveForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sale Analysis Form";
this.Load += new System.EventHandler(this.Sale_Analysis_Form_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DateTimePicker dtpStartDate;
private System.Windows.Forms.FlowLayoutPanel flpProducts;
private System.Windows.Forms.Button btnGo;
private System.Windows.Forms.DateTimePicker dtpFinishDate;
private System.Windows.Forms.Button btnProcess;
}
}

View File

@ -1,120 +0,0 @@
<?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

@ -1,129 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
namespace Tanshu.Accounts.Management
{
public partial class NcForm : Form
{
private IList<CheckBox> checkBoxes;
private IDictionary<int, string> list;
public NcForm()
{
InitializeComponent();
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpStartDate.Value = DateTime.Today;
dtpFinishDate.Value = DateTime.Today;
}
private void btnGo_Click(object sender, EventArgs e)
{
checkBoxes = new List<CheckBox>();
var startDate = dtpStartDate.Value.Date.AddHours(7);
var finishDate = dtpFinishDate.Value.Date.AddDays(1).AddHours(7);
var details = GetNc(startDate, finishDate);
foreach (var detail in details)
{
var item = (object[])detail;
var text = GetName((int)item[0]) + " ---> " + ((decimal)item[1]).ToString();
var label = new Label()
{
Name = "label" + ((int)item[0]).ToString(CultureInfo.InvariantCulture),
AutoSize = true,
Text = text
};
flpProducts.Controls.Add(label);
var checkBox = GetBox((int)item[0]);
checkBoxes.Add(checkBox);
flpProducts.Controls.Add(checkBox);
}
}
private ComboBox GetBox(int code)
{
var checkBox = new CheckBox()
{
Name = "comboBox" + (code).ToString(CultureInfo.InvariantCulture),
Width = 400,
Height = 20,
Tag = code,
DisplayMember = "Value",
ValueMember = "Key",
DropDownStyle = ComboBoxStyle.DropDownList,
DataSource = new BindingSource(list, null)
};
//foreach (var item in list)
// comboBox.Items.Add(new { Code = item.Key, Name = item.Value });
//MessageBox.Show(code.ToString());
//comboBox.SelectedIndex = code - 1;
comboBox.SelectedValue = code;
return comboBox;
}
private static string GetName(int code)
{
switch (code)
{
case 1:
return "1 - Dark";
case 2:
return "2 - Wheat";
case 3:
return "3 - Premium";
case 4:
return "4 - Light";
case 5:
return "5 - Dragon";
case 6:
return "6 - Festival";
case 7:
return "7 - Vanilla";
case 8:
return "8 - Strong";
default:
return "";
}
}
private static decimal TryConvert(string amount)
{
decimal result = 0;
decimal.TryParse(amount, out result);
return result;
}
private static IList GetNcable(DateTime startDate, DateTime finishDate)
{
using (var bi = new ManagementBI())
return bi.GetNcable(startDate, finishDate);
}
private static void SetMove(int fromBaseCode, int toBaseCode, DateTime startDate, DateTime finishDate)
{
using (var bi = new ManagementBI())
bi.SetMove(fromBaseCode, toBaseCode, startDate, finishDate);
}
private void btnProcess_Click(object sender, EventArgs e)
{
btnProcess.Enabled = false;
var startDate = dtpStartDate.Value.Date.AddHours(7);
var finishDate = dtpFinishDate.Value.Date.AddDays(1).AddHours(7);
foreach (var item in comboBoxes)
{
var fromBaseCode = (int) item.Tag;
var toBaseCode = (int) item.SelectedValue;
if (fromBaseCode == toBaseCode)
continue;
Text = GetName(fromBaseCode) + " to " + GetName(toBaseCode);
MessageBox.Show(Text);
SetMove(fromBaseCode, toBaseCode, startDate , finishDate);
}
}
}
}

View File

@ -1,119 +0,0 @@
namespace Tanshu.Accounts.Management
{
partial class NcForm
{
/// <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.dtpStartDate = new System.Windows.Forms.DateTimePicker();
this.flpProducts = new System.Windows.Forms.FlowLayoutPanel();
this.btnGo = new System.Windows.Forms.Button();
this.dtpFinishDate = new System.Windows.Forms.DateTimePicker();
this.btnProcess = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// dtpStartDate
//
this.dtpStartDate.CustomFormat = "dd-MMM-yyyy";
this.dtpStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpStartDate.Location = new System.Drawing.Point(16, 15);
this.dtpStartDate.Margin = new System.Windows.Forms.Padding(4);
this.dtpStartDate.Name = "dtpStartDate";
this.dtpStartDate.Size = new System.Drawing.Size(119, 22);
this.dtpStartDate.TabIndex = 0;
//
// flpProducts
//
this.flpProducts.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.flpProducts.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flpProducts.Location = new System.Drawing.Point(16, 47);
this.flpProducts.Margin = new System.Windows.Forms.Padding(4);
this.flpProducts.Name = "flpProducts";
this.flpProducts.Size = new System.Drawing.Size(447, 390);
this.flpProducts.TabIndex = 2;
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(16, 445);
this.btnGo.Margin = new System.Windows.Forms.Padding(4);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(200, 28);
this.btnGo.TabIndex = 24;
this.btnGo.Text = "Load";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// dtpFinishDate
//
this.dtpFinishDate.CustomFormat = "dd-MMM-yyyy";
this.dtpFinishDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpFinishDate.Location = new System.Drawing.Point(143, 15);
this.dtpFinishDate.Margin = new System.Windows.Forms.Padding(4);
this.dtpFinishDate.Name = "dtpFinishDate";
this.dtpFinishDate.Size = new System.Drawing.Size(119, 22);
this.dtpFinishDate.TabIndex = 1;
//
// btnProcess
//
this.btnProcess.Location = new System.Drawing.Point(263, 445);
this.btnProcess.Margin = new System.Windows.Forms.Padding(4);
this.btnProcess.Name = "btnProcess";
this.btnProcess.Size = new System.Drawing.Size(200, 28);
this.btnProcess.TabIndex = 25;
this.btnProcess.Text = "Process";
this.btnProcess.UseVisualStyleBackColor = true;
this.btnProcess.Click += new System.EventHandler(this.btnProcess_Click);
//
// MoveForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(479, 488);
this.Controls.Add(this.btnProcess);
this.Controls.Add(this.dtpFinishDate);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.flpProducts);
this.Controls.Add(this.dtpStartDate);
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.Name = "MoveForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sale Analysis Form";
this.Load += new System.EventHandler(this.Sale_Analysis_Form_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DateTimePicker dtpStartDate;
private System.Windows.Forms.FlowLayoutPanel flpProducts;
private System.Windows.Forms.Button btnGo;
private System.Windows.Forms.DateTimePicker dtpFinishDate;
private System.Windows.Forms.Button btnProcess;
}
}

View File

@ -1,120 +0,0 @@
<?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

@ -1,159 +0,0 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Management
{
public partial class QuantityForm : Form
{
private IList<TextBox> textBoxes;
public QuantityForm()
{
InitializeComponent();
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpDate.Value = DateTime.Today;
textBoxes = new List<TextBox>();
for (int i = 0; i < 8; i++)
{
var text = "";
switch (i)
{
case 0:
text = "1 - Dark";
break;
case 1:
text = "2 - Wheat";
break;
case 2:
text = "3 - Premium";
break;
case 3:
text = "4 - Light";
break;
case 4:
text = "5 - Dragon";
break;
case 5:
text = "6 - Festival";
break;
case 6:
text = "7 - Vanilla";
break;
case 7:
text = "8 - Strong";
break;
}
var label = new Label()
{
Name = "label" + (i + 1).ToString(CultureInfo.InvariantCulture),
AutoSize = true,
Text = text
};
flpProducts.Controls.Add(label);
var textBox = new TextBox()
{
Name = "textBox" + (i + 1).ToString(CultureInfo.InvariantCulture),
Width = 400,
Height = 22,
Tag = new object[] { (i + 1), text }
};
textBoxes.Add(textBox);
flpProducts.Controls.Add(textBox);
}
}
private void btnGo_Click(object sender, EventArgs e)
{
foreach (var textBox in textBoxes)
{
var startDate = dtpDate.Value.Date.AddHours(7);
var finishDate = startDate.AddDays(1);
var baseCode = (int)(((object[])textBox.Tag)[0]);
var text = (string)(((object[])textBox.Tag)[1]);
foreach (var item in textBox.Text.Split(','))
{
var newQuantity = TryConvert(item);
var quantity = GetQuantity(baseCode, startDate, finishDate);
if (MessageBox.Show(text + " " + startDate.ToString("dd-MMM-yyyy") + " " + quantity.ToString(), "Quantity of Beer", MessageBoxButtons.YesNo,
MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes &&
quantity > newQuantity && newQuantity > 0)
{
MessageBox.Show(SetQuantity(baseCode, newQuantity, startDate, finishDate).ToString());
}
startDate = startDate.AddDays(1);
finishDate = finishDate.AddDays(1);
}
}
}
private decimal TryConvert(string amount)
{
decimal result = 0;
decimal.TryParse(amount, out result);
return result;
}
private decimal GetQuantity(int baseCode, DateTime startDate, DateTime finishDate)
{
using (var bi = new ManagementBI())
return bi.GetQuantity(baseCode, startDate, finishDate);
}
private decimal SetQuantity(int baseCode, decimal quantity, DateTime startDate, DateTime finishDate)
{
using (var bi = new ManagementBI())
return bi.SetQuantity(baseCode, quantity, startDate, finishDate);
}
private void btnGetClipboard_Click(object sender, EventArgs e)
{
//Clipboard format -- Date,BaseCode,Quantity"
var fmtCsv = DataFormats.CommaSeparatedValue;
// read the CSV
var dataobject = Clipboard.GetDataObject();
if (dataobject == null)
{
MessageBox.Show(@"No Data in clipboard");
return;
}
var stream = (System.IO.Stream)dataobject.GetData(fmtCsv);
var enc = new System.Text.UTF8Encoding();
IFormatProvider culture = new CultureInfo("en-US", true);
using (var reader = new System.IO.StreamReader(stream, enc))
{
using (var bi = new ManagementBI())
{
string line;
while ((line = reader.ReadLine()) != null)
{
DateTime startDate;
int baseCode;
decimal quantity;
var data = line.Split(',');
if (!DateTime.TryParseExact(data[0], "dd-MMM-yyyy", culture, DateTimeStyles.NoCurrentDateDefault, out startDate))
continue;
var finishDate = startDate.AddDays(1).AddHours(7);
startDate = startDate.AddHours(7);
if (!int.TryParse(data[1], out baseCode))
continue;
if (baseCode <= 0)
continue;
if (!decimal.TryParse(data[2], out quantity))
continue;
bi.SetQuantity(baseCode, quantity, startDate, finishDate);
}
}
}
}
}
}

View File

@ -1,92 +0,0 @@
namespace Tanshu.Accounts.Management
{
partial class QuantityForm
{
/// <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.dtpDate = new System.Windows.Forms.DateTimePicker();
this.flpProducts = new System.Windows.Forms.FlowLayoutPanel();
this.btnGo = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// dtpDate
//
this.dtpDate.CustomFormat = "dd-MMM-yyyy";
this.dtpDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpDate.Location = new System.Drawing.Point(16, 15);
this.dtpDate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.dtpDate.Name = "dtpDate";
this.dtpDate.Size = new System.Drawing.Size(119, 22);
this.dtpDate.TabIndex = 20;
//
// flpProducts
//
this.flpProducts.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.flpProducts.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flpProducts.Location = new System.Drawing.Point(16, 47);
this.flpProducts.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.flpProducts.Name = "flpProducts";
this.flpProducts.Size = new System.Drawing.Size(447, 390);
this.flpProducts.TabIndex = 23;
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(16, 445);
this.btnGo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(200, 28);
this.btnGo.TabIndex = 24;
this.btnGo.Text = "Go";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// QuantityForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(479, 488);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.flpProducts);
this.Controls.Add(this.dtpDate);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false;
this.Name = "QuantityForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sale Analysis Form";
this.Load += new System.EventHandler(this.Sale_Analysis_Form_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DateTimePicker dtpDate;
private System.Windows.Forms.FlowLayoutPanel flpProducts;
private System.Windows.Forms.Button btnGo;
}
}

View File

@ -1,120 +0,0 @@
<?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

@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Helpers;
using System.Linq;
namespace Tanshu.Accounts.PointOfSale
{

View File

@ -126,29 +126,11 @@
<Compile Include="CurrencyCounter.Designer.cs">
<DependentUpon>CurrencyCounter.cs</DependentUpon>
</Compile>
<Compile Include="Management\AmountForm.cs">
<Compile Include="Management\ManagementForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Management\AmountForm.designer.cs">
<DependentUpon>AmountForm.cs</DependentUpon>
</Compile>
<Compile Include="Management\MoveForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Management\MoveForm.designer.cs">
<DependentUpon>MoveForm.cs</DependentUpon>
</Compile>
<Compile Include="Management\FoodForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Management\FoodForm.designer.cs">
<DependentUpon>FoodForm.cs</DependentUpon>
</Compile>
<Compile Include="Management\QuantityForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Management\QuantityForm.designer.cs">
<DependentUpon>QuantityForm.cs</DependentUpon>
<Compile Include="Management\ManagementForm.designer.cs">
<DependentUpon>ManagementForm.cs</DependentUpon>
</Compile>
<Compile Include="Products\ProductListForm.cs">
<SubType>Form</SubType>
@ -311,17 +293,8 @@
<EmbeddedResource Include="CurrencyCounter.resx">
<DependentUpon>CurrencyCounter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Management\AmountForm.resx">
<DependentUpon>AmountForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Management\MoveForm.resx">
<DependentUpon>MoveForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Management\FoodForm.resx">
<DependentUpon>FoodForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Management\QuantityForm.resx">
<DependentUpon>QuantityForm.cs</DependentUpon>
<EmbeddedResource Include="Management\ManagementForm.resx">
<DependentUpon>ManagementForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Products\ProductListForm.resx">
<DependentUpon>ProductListForm.cs</DependentUpon>