Feature: Added Machine Locations so that setting the location in the config file is not needed.
Feature: Settings database table added to store string based settings.
It is right now used to store bill header and footer.
Hard Coded header/footer removed from file.
Feature: Tax Analysis form created to easily show the tax calculation.
Feature: Management form uses background workers. Dont' know if it is functional though.
Chore: Reorder Table form moved to masters from sales folder.
Refactor: ManagementBI and SalesAnalysisBI
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
@ -10,9 +11,6 @@ using Tanshu.Accounts.PointOfSale.Sales;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Common;
|
||||
using Tanshu.Common.KeyboardControl;
|
||||
using NHibernate.Tool.hbm2ddl;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
@ -20,12 +18,10 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public MainForm()
|
||||
{
|
||||
//using (var frm = new SplashForm())
|
||||
// frm.ShowDialog();
|
||||
|
||||
SessionManager.Initialize();
|
||||
//new SchemaExport(SessionManager.Configuration).Create(false, true);
|
||||
InitializeComponent();
|
||||
Text = "Point of Sale: Login (" + Environment.MachineName + ")";
|
||||
}
|
||||
|
||||
private User form_userEvent(object sender, UserEventArgs e)
|
||||
@ -56,7 +52,6 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
frmSale.ShowDialog();
|
||||
Cache.Invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnProduct_Click(object sender, EventArgs e)
|
||||
@ -136,9 +131,24 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
#if (DEBUG)
|
||||
MessageBox.Show("This software does not print kots!!!", "Debug Mode", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
#endif
|
||||
CheckMachine();
|
||||
CheckRoles();
|
||||
}
|
||||
|
||||
private void CheckMachine()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Cache.Location))
|
||||
{
|
||||
MessageBox.Show("No Machine Location");
|
||||
using (var frm = new MachineEditForm(Environment.MachineName))
|
||||
frm.ShowDialog();
|
||||
if (string.IsNullOrEmpty(Cache.Location))
|
||||
{
|
||||
MessageBox.Show("Machine Location not set");
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void CheckRoles()
|
||||
{
|
||||
btnSale.Visible = Session.IsAllowed("Sales");
|
||||
@ -147,6 +157,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
btnProductGroup.Visible = Session.IsAllowed("Products");
|
||||
btnModifiers.Visible = Session.IsAllowed("Modifiers");
|
||||
btnReorderTables.Visible = Session.IsAllowed("Tables");
|
||||
btnMachines.Visible = Session.IsAllowed("Machines");
|
||||
|
||||
btnOpenBill.Visible = Session.IsAllowed("Open Bill");
|
||||
|
||||
@ -159,6 +170,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
|
||||
btnCashierCheckout.Visible = Session.IsAllowed("Cashier Checkout");
|
||||
btnSaleAnalysis.Visible = Session.IsAllowed("Sales Analysis");
|
||||
btnTaxAnalysis.Visible = Session.IsAllowed("Tax Analysis");
|
||||
btnSaleDetail.Visible = Session.IsAllowed("Sales Detail");
|
||||
|
||||
btnBillDetails.Visible = Session.IsAllowed("Bill Details");
|
||||
@ -191,7 +203,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
if (login.LoginUser())
|
||||
{
|
||||
Text = "Main Menu - User: " + Session.User.Name;
|
||||
Text = "Point of Sale: " + Session.User.Name + " (" + Environment.MachineName + ")";
|
||||
btnLogin.Text = "Logout";
|
||||
btnSwipeLogin.Visible = false;
|
||||
}
|
||||
@ -199,7 +211,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
else
|
||||
{
|
||||
login.LogoutUser();
|
||||
Text = "Main Menu - Login";
|
||||
Text = "Point of Sale: Login (" + Environment.MachineName + ")";
|
||||
btnLogin.Text = "Login";
|
||||
btnSwipeLogin.Visible = true;
|
||||
}
|
||||
@ -297,5 +309,21 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
frm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnMachines_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Session.IsAllowed("Machines"))
|
||||
using (var frm = new MachineListForm())
|
||||
{
|
||||
frm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnTaxAnalysis_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Session.IsAllowed("Tax Analysis"))
|
||||
using (var frm = new frmTaxAnalysisForm())
|
||||
frm.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
118
Tanshu.Accounts.PointOfSale/MainForm.designer.cs
generated
118
Tanshu.Accounts.PointOfSale/MainForm.designer.cs
generated
@ -36,6 +36,7 @@
|
||||
this.btnProduct = new System.Windows.Forms.Button();
|
||||
this.btnProductGroup = new System.Windows.Forms.Button();
|
||||
this.btnReorderTables = new System.Windows.Forms.Button();
|
||||
this.btnMachines = new System.Windows.Forms.Button();
|
||||
this.btnModifiers = new System.Windows.Forms.Button();
|
||||
this.btnOpenBill = new System.Windows.Forms.Button();
|
||||
this.btnCreateUser = new System.Windows.Forms.Button();
|
||||
@ -43,13 +44,14 @@
|
||||
this.btnGroupRoles = new System.Windows.Forms.Button();
|
||||
this.btnCashierCheckout = new System.Windows.Forms.Button();
|
||||
this.btnSaleAnalysis = new System.Windows.Forms.Button();
|
||||
this.btnTaxAnalysis = new System.Windows.Forms.Button();
|
||||
this.btnSaleDetail = new System.Windows.Forms.Button();
|
||||
this.btnBillDetails = new System.Windows.Forms.Button();
|
||||
this.btnVoidOrReprints = new System.Windows.Forms.Button();
|
||||
this.btnDiscountReport = new System.Windows.Forms.Button();
|
||||
this.btnChangePassword = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.btnManagement = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@ -82,6 +84,7 @@
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnProduct);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnProductGroup);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnReorderTables);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnMachines);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnModifiers);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOpenBill);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCreateUser);
|
||||
@ -89,13 +92,14 @@
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnGroupRoles);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCashierCheckout);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnSaleAnalysis);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnTaxAnalysis);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnSaleDetail);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnBillDetails);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnVoidOrReprints);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnDiscountReport);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnChangePassword);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnExit);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnManagement);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnExit);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
@ -152,146 +156,166 @@
|
||||
this.btnReorderTables.UseVisualStyleBackColor = true;
|
||||
this.btnReorderTables.Click += new System.EventHandler(this.btnReorderTables_Click);
|
||||
//
|
||||
// btnMachines
|
||||
//
|
||||
this.btnMachines.Location = new System.Drawing.Point(315, 109);
|
||||
this.btnMachines.Name = "btnMachines";
|
||||
this.btnMachines.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnMachines.TabIndex = 7;
|
||||
this.btnMachines.Text = "Manage Machines";
|
||||
this.btnMachines.UseVisualStyleBackColor = true;
|
||||
this.btnMachines.Click += new System.EventHandler(this.btnMachines_Click);
|
||||
//
|
||||
// btnModifiers
|
||||
//
|
||||
this.btnModifiers.Location = new System.Drawing.Point(315, 109);
|
||||
this.btnModifiers.Location = new System.Drawing.Point(471, 109);
|
||||
this.btnModifiers.Name = "btnModifiers";
|
||||
this.btnModifiers.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnModifiers.TabIndex = 7;
|
||||
this.btnModifiers.TabIndex = 8;
|
||||
this.btnModifiers.Text = "Product Modifiers";
|
||||
this.btnModifiers.UseVisualStyleBackColor = true;
|
||||
this.btnModifiers.Click += new System.EventHandler(this.btnModifiers_Click);
|
||||
//
|
||||
// btnOpenBill
|
||||
//
|
||||
this.btnOpenBill.Location = new System.Drawing.Point(471, 109);
|
||||
this.btnOpenBill.Location = new System.Drawing.Point(627, 109);
|
||||
this.btnOpenBill.Name = "btnOpenBill";
|
||||
this.btnOpenBill.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnOpenBill.TabIndex = 8;
|
||||
this.btnOpenBill.TabIndex = 9;
|
||||
this.btnOpenBill.Text = "Open Bill";
|
||||
this.btnOpenBill.UseVisualStyleBackColor = true;
|
||||
this.btnOpenBill.Click += new System.EventHandler(this.btnOpenBill_Click);
|
||||
//
|
||||
// btnCreateUser
|
||||
//
|
||||
this.btnCreateUser.Location = new System.Drawing.Point(627, 109);
|
||||
this.btnCreateUser.Location = new System.Drawing.Point(3, 215);
|
||||
this.btnCreateUser.Name = "btnCreateUser";
|
||||
this.btnCreateUser.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnCreateUser.TabIndex = 9;
|
||||
this.btnCreateUser.TabIndex = 10;
|
||||
this.btnCreateUser.Text = "Create User";
|
||||
this.btnCreateUser.UseVisualStyleBackColor = true;
|
||||
this.btnCreateUser.Click += new System.EventHandler(this.btnCreateUser_Click);
|
||||
//
|
||||
// btnUserRoles
|
||||
//
|
||||
this.btnUserRoles.Location = new System.Drawing.Point(3, 215);
|
||||
this.btnUserRoles.Location = new System.Drawing.Point(159, 215);
|
||||
this.btnUserRoles.Name = "btnUserRoles";
|
||||
this.btnUserRoles.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnUserRoles.TabIndex = 10;
|
||||
this.btnUserRoles.TabIndex = 11;
|
||||
this.btnUserRoles.Text = "Manage User Roles";
|
||||
this.btnUserRoles.UseVisualStyleBackColor = true;
|
||||
this.btnUserRoles.Click += new System.EventHandler(this.btnUserRoles_Click);
|
||||
//
|
||||
// btnGroupRoles
|
||||
//
|
||||
this.btnGroupRoles.Location = new System.Drawing.Point(159, 215);
|
||||
this.btnGroupRoles.Location = new System.Drawing.Point(315, 215);
|
||||
this.btnGroupRoles.Name = "btnGroupRoles";
|
||||
this.btnGroupRoles.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnGroupRoles.TabIndex = 11;
|
||||
this.btnGroupRoles.TabIndex = 12;
|
||||
this.btnGroupRoles.Text = "Manage Group Roles";
|
||||
this.btnGroupRoles.UseVisualStyleBackColor = true;
|
||||
this.btnGroupRoles.Click += new System.EventHandler(this.btnGroupRoles_Click);
|
||||
//
|
||||
// btnCashierCheckout
|
||||
//
|
||||
this.btnCashierCheckout.Location = new System.Drawing.Point(315, 215);
|
||||
this.btnCashierCheckout.Location = new System.Drawing.Point(471, 215);
|
||||
this.btnCashierCheckout.Name = "btnCashierCheckout";
|
||||
this.btnCashierCheckout.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnCashierCheckout.TabIndex = 12;
|
||||
this.btnCashierCheckout.TabIndex = 13;
|
||||
this.btnCashierCheckout.Text = "Cashier Checkout";
|
||||
this.btnCashierCheckout.UseVisualStyleBackColor = true;
|
||||
this.btnCashierCheckout.Click += new System.EventHandler(this.btnCashierCheckout_Click);
|
||||
//
|
||||
// btnSaleAnalysis
|
||||
//
|
||||
this.btnSaleAnalysis.Location = new System.Drawing.Point(471, 215);
|
||||
this.btnSaleAnalysis.Location = new System.Drawing.Point(627, 215);
|
||||
this.btnSaleAnalysis.Name = "btnSaleAnalysis";
|
||||
this.btnSaleAnalysis.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnSaleAnalysis.TabIndex = 13;
|
||||
this.btnSaleAnalysis.TabIndex = 14;
|
||||
this.btnSaleAnalysis.Text = "Sale Analysis";
|
||||
this.btnSaleAnalysis.UseVisualStyleBackColor = true;
|
||||
this.btnSaleAnalysis.Click += new System.EventHandler(this.btnSaleAnalysis_Click);
|
||||
//
|
||||
// btnTaxAnalysis
|
||||
//
|
||||
this.btnTaxAnalysis.Location = new System.Drawing.Point(3, 321);
|
||||
this.btnTaxAnalysis.Name = "btnTaxAnalysis";
|
||||
this.btnTaxAnalysis.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnTaxAnalysis.TabIndex = 15;
|
||||
this.btnTaxAnalysis.Text = "Tax Analysis";
|
||||
this.btnTaxAnalysis.UseVisualStyleBackColor = true;
|
||||
this.btnTaxAnalysis.Click += new System.EventHandler(this.btnTaxAnalysis_Click);
|
||||
//
|
||||
// btnSaleDetail
|
||||
//
|
||||
this.btnSaleDetail.Location = new System.Drawing.Point(627, 215);
|
||||
this.btnSaleDetail.Location = new System.Drawing.Point(159, 321);
|
||||
this.btnSaleDetail.Name = "btnSaleDetail";
|
||||
this.btnSaleDetail.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnSaleDetail.TabIndex = 14;
|
||||
this.btnSaleDetail.TabIndex = 16;
|
||||
this.btnSaleDetail.Text = "Sale Detail";
|
||||
this.btnSaleDetail.UseVisualStyleBackColor = true;
|
||||
this.btnSaleDetail.Click += new System.EventHandler(this.btnSaleDetail_Click);
|
||||
//
|
||||
// btnBillDetails
|
||||
//
|
||||
this.btnBillDetails.Location = new System.Drawing.Point(3, 321);
|
||||
this.btnBillDetails.Location = new System.Drawing.Point(315, 321);
|
||||
this.btnBillDetails.Name = "btnBillDetails";
|
||||
this.btnBillDetails.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnBillDetails.TabIndex = 15;
|
||||
this.btnBillDetails.TabIndex = 17;
|
||||
this.btnBillDetails.Text = "Bill Details";
|
||||
this.btnBillDetails.UseVisualStyleBackColor = true;
|
||||
this.btnBillDetails.Click += new System.EventHandler(this.btnBillDetails_Click);
|
||||
//
|
||||
// btnVoidOrReprints
|
||||
//
|
||||
this.btnVoidOrReprints.Location = new System.Drawing.Point(159, 321);
|
||||
this.btnVoidOrReprints.Location = new System.Drawing.Point(471, 321);
|
||||
this.btnVoidOrReprints.Name = "btnVoidOrReprints";
|
||||
this.btnVoidOrReprints.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnVoidOrReprints.TabIndex = 16;
|
||||
this.btnVoidOrReprints.TabIndex = 18;
|
||||
this.btnVoidOrReprints.Text = "Voids or Reprints";
|
||||
this.btnVoidOrReprints.UseVisualStyleBackColor = true;
|
||||
this.btnVoidOrReprints.Click += new System.EventHandler(this.btnVoidOrReprints_Click);
|
||||
//
|
||||
// btnDiscountReport
|
||||
//
|
||||
this.btnDiscountReport.Location = new System.Drawing.Point(315, 321);
|
||||
this.btnDiscountReport.Location = new System.Drawing.Point(627, 321);
|
||||
this.btnDiscountReport.Name = "btnDiscountReport";
|
||||
this.btnDiscountReport.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnDiscountReport.TabIndex = 17;
|
||||
this.btnDiscountReport.TabIndex = 19;
|
||||
this.btnDiscountReport.Text = "Discount Report";
|
||||
this.btnDiscountReport.UseVisualStyleBackColor = true;
|
||||
this.btnDiscountReport.Click += new System.EventHandler(this.btnDiscountReport_Click);
|
||||
//
|
||||
// btnChangePassword
|
||||
//
|
||||
this.btnChangePassword.Location = new System.Drawing.Point(471, 321);
|
||||
this.btnChangePassword.Location = new System.Drawing.Point(3, 427);
|
||||
this.btnChangePassword.Name = "btnChangePassword";
|
||||
this.btnChangePassword.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnChangePassword.TabIndex = 18;
|
||||
this.btnChangePassword.TabIndex = 20;
|
||||
this.btnChangePassword.Text = "Change Password";
|
||||
this.btnChangePassword.UseVisualStyleBackColor = true;
|
||||
this.btnChangePassword.Click += new System.EventHandler(this.btnChangePassword_Click);
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
this.btnExit.Location = new System.Drawing.Point(627, 321);
|
||||
this.btnExit.Name = "btnExit";
|
||||
this.btnExit.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnExit.TabIndex = 19;
|
||||
this.btnExit.Text = "Exit";
|
||||
this.btnExit.UseVisualStyleBackColor = true;
|
||||
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
|
||||
//
|
||||
// btnManagement
|
||||
//
|
||||
this.btnManagement.Location = new System.Drawing.Point(3, 427);
|
||||
this.btnManagement.Location = new System.Drawing.Point(159, 427);
|
||||
this.btnManagement.Name = "btnManagement";
|
||||
this.btnManagement.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnManagement.TabIndex = 20;
|
||||
this.btnManagement.TabIndex = 21;
|
||||
this.btnManagement.Text = "Management";
|
||||
this.btnManagement.UseVisualStyleBackColor = true;
|
||||
this.btnManagement.Click += new System.EventHandler(this.btnManagement_Click);
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
this.btnExit.Location = new System.Drawing.Point(315, 427);
|
||||
this.btnExit.Name = "btnExit";
|
||||
this.btnExit.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnExit.TabIndex = 22;
|
||||
this.btnExit.Text = "Exit";
|
||||
this.btnExit.UseVisualStyleBackColor = true;
|
||||
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -317,21 +341,23 @@
|
||||
private System.Windows.Forms.Button btnProduct;
|
||||
private System.Windows.Forms.Button btnProductGroup;
|
||||
private System.Windows.Forms.Button btnCustomer;
|
||||
private System.Windows.Forms.Button btnExit;
|
||||
private System.Windows.Forms.Button btnSwipeLogin;
|
||||
private System.Windows.Forms.Button btnReorderTables;
|
||||
private System.Windows.Forms.Button btnMachines;
|
||||
private System.Windows.Forms.Button btnModifiers;
|
||||
private System.Windows.Forms.Button btnOpenBill;
|
||||
private System.Windows.Forms.Button btnCreateUser;
|
||||
private System.Windows.Forms.Button btnUserRoles;
|
||||
private System.Windows.Forms.Button btnChangePassword;
|
||||
private System.Windows.Forms.Button btnGroupRoles;
|
||||
private System.Windows.Forms.Button btnCashierCheckout;
|
||||
private System.Windows.Forms.Button btnSaleAnalysis;
|
||||
private System.Windows.Forms.Button btnGroupRoles;
|
||||
private System.Windows.Forms.Button btnSaleDetail;
|
||||
private System.Windows.Forms.Button btnSwipeLogin;
|
||||
private System.Windows.Forms.Button btnOpenBill;
|
||||
private System.Windows.Forms.Button btnBillDetails;
|
||||
private System.Windows.Forms.Button btnVoidOrReprints;
|
||||
private System.Windows.Forms.Button btnManagement;
|
||||
private System.Windows.Forms.Button btnDiscountReport;
|
||||
private System.Windows.Forms.Button btnReorderTables;
|
||||
private System.Windows.Forms.Button btnModifiers;
|
||||
private System.Windows.Forms.Button btnChangePassword;
|
||||
private System.Windows.Forms.Button btnManagement;
|
||||
private System.Windows.Forms.Button btnExit;
|
||||
private System.Windows.Forms.Button btnTaxAnalysis;
|
||||
}
|
||||
}
|
||||
@ -15,9 +15,23 @@ namespace Tanshu.Accounts.Management
|
||||
{
|
||||
Stopwatch _stopwatch;
|
||||
Stopwatch _totalStopwatch;
|
||||
private BackgroundWorker bwGo = new BackgroundWorker();
|
||||
private BackgroundWorker bwExcel = new BackgroundWorker();
|
||||
public ManagementForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
bwGo.WorkerReportsProgress = true;
|
||||
bwGo.WorkerSupportsCancellation = true;
|
||||
bwGo.DoWork += new DoWorkEventHandler(DoGo);
|
||||
bwGo.ProgressChanged += new ProgressChangedEventHandler(bwGo_ProgressChanged);
|
||||
bwGo.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwGo_RunWorkerCompleted);
|
||||
|
||||
bwExcel.WorkerReportsProgress = true;
|
||||
bwExcel.WorkerSupportsCancellation = true;
|
||||
bwExcel.DoWork += new DoWorkEventHandler(DoExcel);
|
||||
bwExcel.ProgressChanged += new ProgressChangedEventHandler(bwGo_ProgressChanged);
|
||||
bwExcel.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwExcel_RunWorkerCompleted);
|
||||
}
|
||||
|
||||
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
|
||||
@ -29,91 +43,207 @@ namespace Tanshu.Accounts.Management
|
||||
#region Go
|
||||
private void btnGo_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtStatus.Text = "";
|
||||
btnGo.Enabled = false;
|
||||
_stopwatch = Stopwatch.StartNew();
|
||||
_totalStopwatch = Stopwatch.StartNew();
|
||||
bwGo.RunWorkerAsync();
|
||||
}
|
||||
private void DoGo(BackgroundWorker worker)
|
||||
{
|
||||
var currentDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
var beer = Path.Combine(currentDirectory, "beer.json");
|
||||
var sale = Path.Combine(currentDirectory, "sale.json");
|
||||
var credit = Path.Combine(currentDirectory, "credit.json");
|
||||
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))
|
||||
if (btnGo.Text == "Go")
|
||||
{
|
||||
MessageBox.Show(error);
|
||||
txtStatus.Text = "";
|
||||
btnGo.Text = "Cancel";
|
||||
_stopwatch = Stopwatch.StartNew();
|
||||
_totalStopwatch = Stopwatch.StartNew();
|
||||
bwGo.RunWorkerAsync();
|
||||
}
|
||||
else
|
||||
bwGo.CancelAsync();
|
||||
}
|
||||
private void btnExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (btnExcel.Text == "Excel")
|
||||
{
|
||||
btnGo.Enabled = false;
|
||||
var beerDates = GetBeer(beer);
|
||||
var saleDates = GetSale(sale);
|
||||
var creditDates = GetCredit(credit);
|
||||
txtStatus.Text = "";
|
||||
btnExcel.Text = "Cancel";
|
||||
_stopwatch = Stopwatch.StartNew();
|
||||
_totalStopwatch = Stopwatch.StartNew();
|
||||
bwExcel.RunWorkerAsync();
|
||||
}
|
||||
else
|
||||
bwExcel.CancelAsync();
|
||||
}
|
||||
|
||||
var info = string.Empty;
|
||||
foreach (var item in saleDates)
|
||||
private void DoGo(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
var beer = GetBeer();
|
||||
var sale = GetSale();
|
||||
var credit = GetCredit();
|
||||
|
||||
var info = string.Empty;
|
||||
foreach (var item in sale)
|
||||
{
|
||||
var startDate = item.StartDate;
|
||||
var finishDate = item.FinishDate;
|
||||
var sDate = startDate.AddHours(7);
|
||||
var fDate = finishDate.AddDays(1).AddHours(7);
|
||||
int count = 0;
|
||||
bwGo.ReportProgress(++count, "Starting on " + startDate.ToShortDateString() + " to " + finishDate.ToShortDateString());
|
||||
using (var bi = new ManagementBI())
|
||||
{
|
||||
var startDate = item.SDate.Value;
|
||||
var finishDate = item.FDate.Value;
|
||||
var sDate = startDate.AddHours(7);
|
||||
var fDate = finishDate.AddDays(1).AddHours(7);
|
||||
Console.WriteLine("Starting on " + startDate.ToShortDateString() + " to " + finishDate.ToShortDateString());
|
||||
int count = 0;
|
||||
using (var bi = new ManagementBI())
|
||||
bi.DeleteVoid(sDate, fDate);
|
||||
bwGo.ReportProgress(++count, "Voids Deleted");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
worker.ReportProgress(++count, "Deleting Voids");
|
||||
bi.DeleteVoid(sDate, fDate);
|
||||
worker.ReportProgress(++count, "Deleting Staff");
|
||||
bi.MoveStaffToNc(sDate, fDate);
|
||||
worker.ReportProgress(++count, "Clearing Modifiers");
|
||||
bi.ClearModifiers(sDate, fDate);
|
||||
worker.ReportProgress(++count, "Combining Kots");
|
||||
bi.CombineKots(sDate, fDate);
|
||||
worker.ReportProgress(++count, "Removing Blank Kots");
|
||||
bi.RemoveBlankKots(sDate, fDate);
|
||||
worker.ReportProgress(++count, "Starting beer");
|
||||
foreach (var beerDate in beerDates)
|
||||
{
|
||||
if (beerDate.bDate < startDate || beerDate.bDate > finishDate)
|
||||
continue;
|
||||
var stDt = beerDate.bDate.Value.AddHours(7);
|
||||
var fiDt = stDt.AddDays(1);
|
||||
worker.ReportProgress(++count, "Setting beer for " + stDt.ToShortDateString());
|
||||
bi.SetBeer(stDt, fiDt, beerDate.Quantity);
|
||||
}
|
||||
bi.MoveToNc(sDate, fDate, item.Sale.Where(x => x.IsLiq).Sum(x => x.Amount) / .75M); // Do not put all in NC this will allow for about 25% discount on the rest of non nc liqour
|
||||
worker.ReportProgress(++count, "Starting sale");
|
||||
foreach (var saleItem in item.Sale)
|
||||
{
|
||||
worker.ReportProgress(++count, "Setting sale for " + saleItem.Rate.ToString());
|
||||
if (saleItem.IsLiq)
|
||||
bi.SetSaleDiscount(saleItem.Rate, saleItem.Amount, sDate, fDate);
|
||||
else
|
||||
bi.SetSaleQuantity(saleItem.Rate, saleItem.Amount, sDate, fDate);
|
||||
}
|
||||
worker.ReportProgress(++count, "Removing Blank Kots");
|
||||
bi.RemoveBlankKots(sDate, fDate);
|
||||
worker.ReportProgress(++count, "Starting cleanup");
|
||||
bi.SetPayments(sDate, fDate);
|
||||
bi.SaveChanges();
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
worker.ReportProgress(++count, "Cleanup done");
|
||||
bi.MoveStaffToNc(sDate, fDate);
|
||||
bwGo.ReportProgress(++count, "Staff Moved");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bi.ClearModifiers(sDate, fDate);
|
||||
bwGo.ReportProgress(++count, "Modifiers Cleared");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bi.CombineKots(sDate, fDate);
|
||||
bwGo.ReportProgress(++count, "Kots Combined");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bi.RemoveBlankKots(sDate, fDate);
|
||||
bwGo.ReportProgress(++count, "Blank Kots Removed");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bwGo.ReportProgress(++count, "Starting beer");
|
||||
foreach (var beerDate in beer)
|
||||
{
|
||||
if (beerDate.Date < startDate || beerDate.Date > finishDate)
|
||||
continue;
|
||||
bi.SetBeer(beerDate.Date.AddHours(7), beerDate.Date.AddDays(1).AddHours(7), beerDate.Quantity);
|
||||
bwGo.ReportProgress(++count, "Beer set for " + beerDate.Date.ToShortDateString());
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
bi.RemoveBlankKots(sDate, fDate);
|
||||
bwGo.ReportProgress(++count, "Blank Kots Removed");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bi.MoveToNc(sDate, fDate, item.Sale.Where(x => x.IsLiq).Sum(x => x.Amount) / .75M); // Do not put all in NC this will allow for about 25% discount on the rest of non nc liqour
|
||||
bwGo.ReportProgress(++count, "Moved to Nc");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
IList<CreditJson> creditJ = credit.Where(x => x.Date >= startDate && x.Date <= finishDate).ToList();
|
||||
bi.SetQuantityAndDiscount(item.Sale, creditJ, startDate, finishDate);
|
||||
bwGo.ReportProgress(++count, "Sale Done");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bi.RemoveBlankKots(sDate, fDate);
|
||||
bwGo.ReportProgress(++count, "Blank Kots Removed");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bi.SaveChanges();
|
||||
}
|
||||
bwGo.ReportProgress(++count, "Cleanup done");
|
||||
}
|
||||
}
|
||||
private void bwGo_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
|
||||
private void DoExcel(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
DoGo(sender as BackgroundWorker);
|
||||
var startDate = dtpStart.Value.Date;
|
||||
var finishDate = dtpFinish.Value.Date;
|
||||
string sheet;
|
||||
int count = 0;
|
||||
var info = new List<ExcelInfo>();
|
||||
var rates = new List<decimal>();
|
||||
using (var bi = new ManagementBI())
|
||||
{
|
||||
for (var date = startDate; date <= finishDate; date = date.AddDays(1))
|
||||
{
|
||||
if (bwExcel.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bwExcel.ReportProgress(++count, "Getting data for " + date.ToShortDateString());
|
||||
var currentStart = date.AddHours(7);
|
||||
var currentFinish = date.AddDays(1).AddHours(7);
|
||||
var bills = bi.GetMinMaxBills(currentStart, currentFinish);
|
||||
if (bills == null)
|
||||
continue;
|
||||
|
||||
var saleList = bi.GetSaleAndVat(currentStart, currentFinish);
|
||||
var serviceTax = bi.GetServiceTax(currentStart, currentFinish);
|
||||
|
||||
var ei = new ExcelInfo()
|
||||
{
|
||||
Date = date,
|
||||
StartBill = bi.FullBillID(bills.StartBill, Tanshu.Accounts.Entities.VoucherType.Regular),
|
||||
FinishBill = bi.FullBillID(bills.FinishBill, Tanshu.Accounts.Entities.VoucherType.Regular),
|
||||
SaleAndVat = new Dictionary<decimal, SaleInfo>(),
|
||||
ServiceTax = serviceTax
|
||||
};
|
||||
foreach (var item in saleList)
|
||||
{
|
||||
if (!rates.Contains(item.Rate))
|
||||
rates.Add(item.Rate);
|
||||
ei.SaleAndVat.Add(item.Rate, item);
|
||||
}
|
||||
info.Add(ei);
|
||||
}
|
||||
|
||||
rates.Sort();
|
||||
|
||||
sheet = "Date\tBill Start\tBill Final\t";
|
||||
|
||||
foreach (var item in rates)
|
||||
{
|
||||
sheet += string.Format("Sale {0:#0.00}%\tVat {0:#0.00}%\t", item * 100);
|
||||
}
|
||||
sheet += "Service Tax\n";
|
||||
|
||||
foreach (var item in info)
|
||||
{
|
||||
if (bwExcel.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bwExcel.ReportProgress(++count, "Compiling data for " + item.Date.ToShortDateString());
|
||||
sheet += string.Format("{0:dd-MMM-yyyy}\t'{1}\t'{2}\t", item.Date, item.StartBill, item.FinishBill);
|
||||
foreach (var rate in rates)
|
||||
{
|
||||
if (item.SaleAndVat.ContainsKey(rate))
|
||||
sheet += string.Format("{0:#0}\t{1:#0}\t", Math.Round(item.SaleAndVat[rate].Net), Math.Round(item.SaleAndVat[rate].Vat));
|
||||
else
|
||||
sheet += "0\t0\t";
|
||||
}
|
||||
sheet += string.Format("{0:#0}\n", Math.Round(item.ServiceTax));
|
||||
|
||||
}
|
||||
}
|
||||
e.Result = sheet;
|
||||
}
|
||||
|
||||
private void bwGo_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
|
||||
{
|
||||
var time = (_stopwatch.ElapsedMilliseconds / 1000).ToString() + "s / " + (_totalStopwatch.ElapsedMilliseconds / 1000).ToString() + "s";
|
||||
@ -123,16 +253,41 @@ namespace Tanshu.Accounts.Management
|
||||
}
|
||||
private void bwGo_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
txtStatus.Text += "Done !!!";
|
||||
_stopwatch.Stop();
|
||||
_totalStopwatch.Stop();
|
||||
btnGo.Enabled = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Get Data
|
||||
private IList<SaleJson> GetSale(string sale)
|
||||
btnGo.Text = "Go";
|
||||
if (!e.Cancelled)
|
||||
txtStatus.Text = "Done !!!\r\n" + txtStatus.Text;
|
||||
else
|
||||
txtStatus.Text = "Cancelled :(\r\n" + txtStatus.Text;
|
||||
}
|
||||
private void bwExcel_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
_stopwatch.Stop();
|
||||
_totalStopwatch.Stop();
|
||||
|
||||
btnExcel.Text = "Excel";
|
||||
if (!e.Cancelled)
|
||||
{
|
||||
txtStatus.Text = "Done !!!\r\n" + txtStatus.Text;
|
||||
var sheet = (string)e.Result;
|
||||
Clipboard.SetText(sheet, TextDataFormat.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
txtStatus.Text = "Cancelled :(\r\n" + txtStatus.Text;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Get Data
|
||||
private IList<SaleJson> GetSale()
|
||||
{
|
||||
var currentDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
var sale = Path.Combine(currentDirectory, "sale.json");
|
||||
if (!File.Exists(sale))
|
||||
throw new ArgumentException("Sale not found!");
|
||||
var startDate = dtpStart.Value.Date;
|
||||
var finishDate = dtpFinish.Value.Date;
|
||||
var fileContents = new StreamReader(File.OpenRead(sale)).ReadToEnd();
|
||||
@ -141,16 +296,18 @@ namespace Tanshu.Accounts.Management
|
||||
IList<SaleJson> list = new List<SaleJson>();
|
||||
foreach (var item in data)
|
||||
{
|
||||
if (!item.SDate.HasValue || !item.FDate.HasValue)
|
||||
continue;
|
||||
if (item.FDate.Value.Date < startDate.Date || item.SDate.Value.Date > finishDate.Date)
|
||||
if (item.FinishDate.Date < startDate.Date || item.StartDate.Date > finishDate.Date)
|
||||
continue;
|
||||
list.Add(item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
private IList<CreditJson> GetCredit(string credit)
|
||||
private IList<CreditJson> GetCredit()
|
||||
{
|
||||
var currentDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
var credit = Path.Combine(currentDirectory, "credit.json");
|
||||
if (!File.Exists(credit))
|
||||
throw new ArgumentException("Credit not found!");
|
||||
var startDate = dtpStart.Value.Date;
|
||||
var finishDate = dtpFinish.Value.Date;
|
||||
var fileContents = new StreamReader(File.OpenRead(credit)).ReadToEnd();
|
||||
@ -159,16 +316,21 @@ namespace Tanshu.Accounts.Management
|
||||
IList<CreditJson> list = new List<CreditJson>();
|
||||
foreach (var item in data)
|
||||
{
|
||||
if (!item.CDate.HasValue)
|
||||
continue;
|
||||
if (item.CDate.Value.Date < startDate.Date || item.CDate.Value.Date > finishDate.Date)
|
||||
if (item.Date.Date < startDate.Date || item.Date.Date > finishDate.Date)
|
||||
continue;
|
||||
list.Add(item);
|
||||
}
|
||||
var am = list.GroupBy(x => x.Date).Where(x => x.Count() > 1).Select(x => x.Key);
|
||||
if (am.Count() > 0)
|
||||
throw new ArgumentException("Duplicate dates in credit: " + am.Select(x => x.ToString("dd-MMM-yyyy")).Aggregate((c, n) => c + ", " + n));
|
||||
return list;
|
||||
}
|
||||
private IList<BeerJson> GetBeer(string beer)
|
||||
private IList<BeerJson> GetBeer()
|
||||
{
|
||||
var currentDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
var beer = Path.Combine(currentDirectory, "beer.json");
|
||||
if (!File.Exists(beer))
|
||||
throw new ArgumentException("Beer not found!");
|
||||
var startDate = dtpStart.Value.Date;
|
||||
var finishDate = dtpFinish.Value.Date;
|
||||
var fileContents = new StreamReader(File.OpenRead(beer)).ReadToEnd();
|
||||
@ -177,9 +339,7 @@ namespace Tanshu.Accounts.Management
|
||||
IList<BeerJson> list = new List<BeerJson>();
|
||||
foreach (var item in data)
|
||||
{
|
||||
if (!item.bDate.HasValue)
|
||||
continue;
|
||||
if (item.bDate.Value.Date < startDate.Date || item.bDate.Value.Date > finishDate.Date)
|
||||
if (item.Date.Date < startDate.Date || item.Date.Date > finishDate.Date)
|
||||
continue;
|
||||
list.Add(item);
|
||||
}
|
||||
@ -375,83 +535,14 @@ namespace Tanshu.Accounts.Management
|
||||
|
||||
private void btnFinalSanction_Click(object sender, EventArgs e)
|
||||
{
|
||||
var startDate = dtpStart.Value.Date.AddHours(7);
|
||||
var finishDate = dtpFinish.Value.Date.AddDays(1).AddHours(7);
|
||||
using (var bi = new ManagementBI())
|
||||
{
|
||||
bi.UpdateBillID(dtpStart.Value.Date.AddHours(7), dtpFinish.Value.Date.AddDays(1).AddHours(7));
|
||||
bi.SetPayments(startDate, finishDate);
|
||||
bi.UpdateBillID(startDate, finishDate);
|
||||
bi.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
#region Excel
|
||||
private void btnExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnExcel.Enabled = false;
|
||||
var startDate = dtpStart.Value.Date;
|
||||
var finishDate = dtpFinish.Value.Date;
|
||||
|
||||
var sheet = GetExcel(startDate, finishDate);
|
||||
Clipboard.SetText(sheet, TextDataFormat.Text);
|
||||
btnExcel.Enabled = true;
|
||||
}
|
||||
private static string GetExcel(DateTime startDate, DateTime finishDate)
|
||||
{
|
||||
var info = new List<ExcelInfo>();
|
||||
var rates = new List<decimal>();
|
||||
using (var bi = new ManagementBI())
|
||||
{
|
||||
for (var date = startDate; date <= finishDate; date = date.AddDays(1))
|
||||
{
|
||||
var currentStart = date.AddHours(7);
|
||||
var currentFinish = date.AddDays(1).AddHours(7);
|
||||
var bills = bi.GetMinMaxBills(currentStart, currentFinish);
|
||||
if (bills == null)
|
||||
continue;
|
||||
var saleList = bi.GetSaleAndVat(currentStart, currentFinish);
|
||||
var serviceTax = bi.GetServiceTax(currentStart, currentFinish);
|
||||
|
||||
var ei = new ExcelInfo()
|
||||
{
|
||||
Date = date,
|
||||
StartBill = bi.FullBillID(bills.StartBill, Tanshu.Accounts.Entities.VoucherType.Regular),
|
||||
FinishBill = bi.FullBillID(bills.FinishBill, Tanshu.Accounts.Entities.VoucherType.Regular),
|
||||
SaleAndVat = new Dictionary<decimal, SaleInfo>(),
|
||||
ServiceTax = serviceTax
|
||||
};
|
||||
foreach (var item in saleList)
|
||||
{
|
||||
if (!rates.Contains(item.Rate))
|
||||
rates.Add(item.Rate);
|
||||
ei.SaleAndVat.Add(item.Rate, item);
|
||||
}
|
||||
info.Add(ei);
|
||||
}
|
||||
|
||||
rates.Sort();
|
||||
|
||||
var sheet = "Date\tBill Start\tBill Final\t";
|
||||
|
||||
foreach (var item in rates)
|
||||
{
|
||||
sheet += string.Format("Sale {0:#0.00}%\tVat {0:#0.00}%\t", item * 100);
|
||||
}
|
||||
sheet += "Service Tax\n";
|
||||
|
||||
foreach (var item in info)
|
||||
{
|
||||
sheet += string.Format("{0:dd-MMM-yyyy}\t'{1}\t'{2}\t", item.Date, item.StartBill, item.FinishBill);
|
||||
foreach (var rate in rates)
|
||||
{
|
||||
if (item.SaleAndVat.ContainsKey(rate))
|
||||
sheet += string.Format("{0:#0}\t{1:#0}\t", Math.Round(item.SaleAndVat[rate].Net), Math.Round(item.SaleAndVat[rate].Vat));
|
||||
else
|
||||
sheet += "0\t0\t";
|
||||
}
|
||||
sheet += string.Format("{0:#0}\n", Math.Round(item.ServiceTax));
|
||||
|
||||
}
|
||||
return sheet;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
this.btnTally = new System.Windows.Forms.Button();
|
||||
this.btnFinalSanction = new System.Windows.Forms.Button();
|
||||
this.btnExcel = new System.Windows.Forms.Button();
|
||||
this.bwGo = new System.ComponentModel.BackgroundWorker();
|
||||
this.txtStatus = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@ -106,13 +105,6 @@
|
||||
this.btnExcel.UseVisualStyleBackColor = true;
|
||||
this.btnExcel.Click += new System.EventHandler(this.btnExcel_Click);
|
||||
//
|
||||
// bwGo
|
||||
//
|
||||
this.bwGo.WorkerReportsProgress = true;
|
||||
this.bwGo.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bwGo_DoWork);
|
||||
this.bwGo.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bwGo_RunWorkerCompleted);
|
||||
this.bwGo.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bwGo_ProgressChanged);
|
||||
//
|
||||
// txtStatus
|
||||
//
|
||||
this.txtStatus.AcceptsReturn = true;
|
||||
@ -156,7 +148,6 @@
|
||||
private System.Windows.Forms.Button btnTally;
|
||||
private System.Windows.Forms.Button btnFinalSanction;
|
||||
private System.Windows.Forms.Button btnExcel;
|
||||
private System.ComponentModel.BackgroundWorker bwGo;
|
||||
private System.Windows.Forms.TextBox txtStatus;
|
||||
}
|
||||
}
|
||||
@ -117,7 +117,4 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="bwGo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
136
Tanshu.Accounts.PointOfSale/Masters/MachineEditForm.Designer.cs
generated
Normal file
136
Tanshu.Accounts.PointOfSale/Masters/MachineEditForm.Designer.cs
generated
Normal file
@ -0,0 +1,136 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class MachineEditForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.txtMachine = new System.Windows.Forms.TextBox();
|
||||
this.Label2 = new System.Windows.Forms.Label();
|
||||
this.Label5 = new System.Windows.Forms.Label();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.cmbLocation = new System.Windows.Forms.ComboBox();
|
||||
this.bsLocations = new System.Windows.Forms.BindingSource(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsLocations)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtMachine
|
||||
//
|
||||
this.txtMachine.AccessibleName = "";
|
||||
this.txtMachine.Location = new System.Drawing.Point(94, 12);
|
||||
this.txtMachine.Name = "txtMachine";
|
||||
this.txtMachine.Size = new System.Drawing.Size(276, 20);
|
||||
this.txtMachine.TabIndex = 0;
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(40, 15);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(48, 13);
|
||||
this.Label2.TabIndex = 10;
|
||||
this.Label2.Text = "Machine";
|
||||
//
|
||||
// Label5
|
||||
//
|
||||
this.Label5.AutoSize = true;
|
||||
this.Label5.Location = new System.Drawing.Point(40, 41);
|
||||
this.Label5.Name = "Label5";
|
||||
this.Label5.Size = new System.Drawing.Size(48, 13);
|
||||
this.Label5.TabIndex = 11;
|
||||
this.Label5.Text = "Location";
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(214, 65);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnOk.TabIndex = 6;
|
||||
this.btnOk.Text = "&Ok";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Location = new System.Drawing.Point(295, 65);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnCancel.TabIndex = 7;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// cmbLocation
|
||||
//
|
||||
this.cmbLocation.DataSource = this.bsLocations;
|
||||
this.cmbLocation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbLocation.Location = new System.Drawing.Point(94, 38);
|
||||
this.cmbLocation.Name = "cmbLocation";
|
||||
this.cmbLocation.Size = new System.Drawing.Size(276, 21);
|
||||
this.cmbLocation.TabIndex = 21;
|
||||
//
|
||||
// bsLocations
|
||||
//
|
||||
this.bsLocations.DataSource = typeof(string);
|
||||
//
|
||||
// MachineEditForm
|
||||
//
|
||||
this.AcceptButton = this.btnOk;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(382, 153);
|
||||
this.Controls.Add(this.cmbLocation);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.Label5);
|
||||
this.Controls.Add(this.txtMachine);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MachineEditForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Machine Location";
|
||||
this.Load += new System.EventHandler(this.MachineEditForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsLocations)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.TextBox txtMachine;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.Label Label5;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
internal System.Windows.Forms.ComboBox cmbLocation;
|
||||
private System.Windows.Forms.BindingSource bsLocations;
|
||||
}
|
||||
}
|
||||
89
Tanshu.Accounts.PointOfSale/Masters/MachineEditForm.cs
Normal file
89
Tanshu.Accounts.PointOfSale/Masters/MachineEditForm.cs
Normal file
@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class MachineEditForm : Form
|
||||
{
|
||||
private Guid? _machineLocationID;
|
||||
private string _machineName;
|
||||
public MachineEditForm(Guid machineLocationID)
|
||||
: this()
|
||||
{
|
||||
_machineLocationID = machineLocationID;
|
||||
}
|
||||
|
||||
public MachineEditForm(string machineName)
|
||||
: this()
|
||||
{
|
||||
_machineName = machineName;
|
||||
}
|
||||
|
||||
public MachineEditForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void MachineEditForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
MachineLocation machineLocation;
|
||||
using (var bi = new MachineLocationBI())
|
||||
{
|
||||
bsLocations.DataSource = bi.LocationList();
|
||||
if (_machineLocationID.HasValue)
|
||||
{
|
||||
machineLocation = bi.Get(x => x.MachineLocationID == _machineLocationID.Value);
|
||||
txtMachine.Text = machineLocation.Machine;
|
||||
cmbLocation.SelectedItem = machineLocation.Location;
|
||||
txtMachine.Focus();
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(_machineName))
|
||||
{
|
||||
txtMachine.Text = _machineName;
|
||||
txtMachine.ReadOnly = true;
|
||||
cmbLocation.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
txtMachine.Focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
MachineLocation machineLocation;
|
||||
using (var bi = new MachineLocationBI())
|
||||
{
|
||||
if (_machineLocationID.HasValue)
|
||||
machineLocation = bi.Get(x => x.MachineLocationID == _machineLocationID.Value);
|
||||
else
|
||||
machineLocation = new MachineLocation();
|
||||
|
||||
if (string.IsNullOrEmpty(txtMachine.Text.Trim()))
|
||||
return;
|
||||
machineLocation.Machine = txtMachine.Text.Trim();
|
||||
var location = (string)cmbLocation.SelectedItem;
|
||||
if (string.IsNullOrEmpty(location))
|
||||
return;
|
||||
machineLocation.Location = location;
|
||||
if (_machineLocationID.HasValue)
|
||||
bi.Update(machineLocation);
|
||||
else
|
||||
bi.Insert(machineLocation);
|
||||
bi.SaveChanges();
|
||||
}
|
||||
MessageBox.Show("Update / Save Successful");
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
123
Tanshu.Accounts.PointOfSale/Masters/MachineEditForm.resx
Normal file
123
Tanshu.Accounts.PointOfSale/Masters/MachineEditForm.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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="bsLocations.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
152
Tanshu.Accounts.PointOfSale/Masters/MachineListForm.Designer.cs
generated
Normal file
152
Tanshu.Accounts.PointOfSale/Masters/MachineListForm.Designer.cs
generated
Normal file
@ -0,0 +1,152 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class MachineListForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.btnAdd = new System.Windows.Forms.Button();
|
||||
this.btnEdit = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.dgvProductGroups = new System.Windows.Forms.DataGridView();
|
||||
this.bsList = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.machineDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.locationDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProductGroups)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsList)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(12, 255);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnAdd.TabIndex = 68;
|
||||
this.btnAdd.Text = "&Add";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
this.btnEdit.AccessibleName = "Done";
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(93, 255);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnEdit.TabIndex = 62;
|
||||
this.btnEdit.Text = "&Edit";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
this.btnExit.AccessibleName = "Done";
|
||||
this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnExit.Location = new System.Drawing.Point(514, 255);
|
||||
this.btnExit.Name = "btnExit";
|
||||
this.btnExit.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnExit.TabIndex = 61;
|
||||
this.btnExit.Text = "E&xit";
|
||||
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
|
||||
//
|
||||
// dgvProductGroups
|
||||
//
|
||||
this.dgvProductGroups.AllowUserToAddRows = false;
|
||||
this.dgvProductGroups.AllowUserToDeleteRows = false;
|
||||
this.dgvProductGroups.AllowUserToResizeRows = false;
|
||||
this.dgvProductGroups.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.dgvProductGroups.AutoGenerateColumns = false;
|
||||
this.dgvProductGroups.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.dgvProductGroups.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvProductGroups.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.machineDataGridViewTextBoxColumn,
|
||||
this.locationDataGridViewTextBoxColumn});
|
||||
this.dgvProductGroups.DataSource = this.bsList;
|
||||
this.dgvProductGroups.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
|
||||
this.dgvProductGroups.Location = new System.Drawing.Point(12, 12);
|
||||
this.dgvProductGroups.MultiSelect = false;
|
||||
this.dgvProductGroups.Name = "dgvProductGroups";
|
||||
this.dgvProductGroups.ReadOnly = true;
|
||||
this.dgvProductGroups.RowHeadersVisible = false;
|
||||
this.dgvProductGroups.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
|
||||
this.dgvProductGroups.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvProductGroups.Size = new System.Drawing.Size(577, 237);
|
||||
this.dgvProductGroups.TabIndex = 74;
|
||||
//
|
||||
// bsList
|
||||
//
|
||||
this.bsList.DataSource = typeof(Tanshu.Accounts.Entities.MachineLocation);
|
||||
//
|
||||
// machineDataGridViewTextBoxColumn
|
||||
//
|
||||
this.machineDataGridViewTextBoxColumn.DataPropertyName = "Machine";
|
||||
this.machineDataGridViewTextBoxColumn.HeaderText = "Machine";
|
||||
this.machineDataGridViewTextBoxColumn.Name = "machineDataGridViewTextBoxColumn";
|
||||
this.machineDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.machineDataGridViewTextBoxColumn.Width = 73;
|
||||
//
|
||||
// locationDataGridViewTextBoxColumn
|
||||
//
|
||||
this.locationDataGridViewTextBoxColumn.DataPropertyName = "Location";
|
||||
this.locationDataGridViewTextBoxColumn.HeaderText = "Location";
|
||||
this.locationDataGridViewTextBoxColumn.Name = "locationDataGridViewTextBoxColumn";
|
||||
this.locationDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.locationDataGridViewTextBoxColumn.Width = 73;
|
||||
//
|
||||
// MachineListForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(601, 342);
|
||||
this.Controls.Add(this.dgvProductGroups);
|
||||
this.Controls.Add(this.btnAdd);
|
||||
this.Controls.Add(this.btnEdit);
|
||||
this.Controls.Add(this.btnExit);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MachineListForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Machines";
|
||||
this.Load += new System.EventHandler(this.MachineListForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProductGroups)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsList)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.Button btnAdd;
|
||||
internal System.Windows.Forms.Button btnEdit;
|
||||
internal System.Windows.Forms.Button btnExit;
|
||||
private System.Windows.Forms.DataGridView dgvProductGroups;
|
||||
private System.Windows.Forms.BindingSource bsList;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn machineDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn locationDataGridViewTextBoxColumn;
|
||||
}
|
||||
}
|
||||
53
Tanshu.Accounts.PointOfSale/Masters/MachineListForm.cs
Normal file
53
Tanshu.Accounts.PointOfSale/Masters/MachineListForm.cs
Normal file
@ -0,0 +1,53 @@
|
||||
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.Entities;
|
||||
using Tanshu.Accounts.Repository;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class MachineListForm : Form
|
||||
{
|
||||
private IList<MachineLocation> _list;
|
||||
public MachineListForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var frm = new MachineEditForm())
|
||||
frm.ShowDialog();
|
||||
using (var bi = new MachineLocationBI())
|
||||
_list = bi.List();
|
||||
bsList.DataSource = _list;
|
||||
}
|
||||
|
||||
private void MachineListForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
using (var bi = new MachineLocationBI())
|
||||
_list = bi.List();
|
||||
bsList.DataSource = _list;
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
var id = ((MachineLocation)bsList.Current).MachineLocationID;
|
||||
using (var frm = new MachineEditForm(id))
|
||||
frm.ShowDialog();
|
||||
using (var bi = new MachineLocationBI())
|
||||
_list = bi.List();
|
||||
bsList.DataSource = _list;
|
||||
}
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
126
Tanshu.Accounts.PointOfSale/Masters/MachineListForm.resx
Normal file
126
Tanshu.Accounts.PointOfSale/Masters/MachineListForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="locationDataGridViewTextBoxColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bsList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@ -177,7 +177,7 @@
|
||||
this.Name = "ModifierListForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Product Types";
|
||||
this.Load += new System.EventHandler(this.ProductGroupListForm_Load);
|
||||
this.Load += new System.EventHandler(this.ModifierListForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProductGroups)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsList)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
@ -29,7 +29,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
bsList.DataSource = _list;
|
||||
}
|
||||
|
||||
private void ProductGroupListForm_Load(object sender, EventArgs e)
|
||||
private void ModifierListForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
using (var bi = new ModifierBI())
|
||||
_list = bi.List();
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public class BlockTimer : IDisposable
|
||||
{
|
||||
private readonly string _description;
|
||||
private readonly long _start;
|
||||
|
||||
public BlockTimer(string description)
|
||||
{
|
||||
_description = description;
|
||||
_start = DateTime.Now.Ticks;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
var totalTime = DateTime.Now.Ticks - _start;
|
||||
Console.WriteLine(_description);
|
||||
Console.Write(" - Total Execution Time: ");
|
||||
Console.Write(new TimeSpan(totalTime).TotalMilliseconds.ToString());
|
||||
Console.WriteLine(" ms.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -40,8 +40,38 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
if (DateTime.Today.Subtract(dtpStart.Value.Date).Days > 5 &&
|
||||
!Session.IsAllowed("Accounts Audit"))
|
||||
return;
|
||||
var start = dtpStart.Value.Date.AddHours(6);
|
||||
var finish = dtpFinish.Value.Date.AddDays(1).AddHours(5);
|
||||
_list = new List<SalesAnalysis>();
|
||||
if (finish > start)
|
||||
{
|
||||
var bi = new SalesAnalysisBI();
|
||||
var list = new List<SalesAnalysis>();
|
||||
list.AddRange(bi.GetSale(start, finish));
|
||||
list.Add(new SalesAnalysis() { GroupType = " -- ", Amount = 0 });
|
||||
list.AddRange(bi.GetSettlements(start, finish));
|
||||
list.Add(new SalesAnalysis() { GroupType = " -- ", Amount = 0 });
|
||||
var sc = bi.GetServiceCharge(start, finish);
|
||||
if (sc != null)
|
||||
list.Add(sc);
|
||||
|
||||
foreach (var item in bi.GetServiceTax(start, finish))
|
||||
{
|
||||
if (item.TaxAmount != 0)
|
||||
{
|
||||
list.Add(new SalesAnalysis() { GroupType = item.Name, Amount = item.TaxAmount });
|
||||
}
|
||||
}
|
||||
foreach (var item in bi.GetVat(start, finish))
|
||||
{
|
||||
if (item.TaxAmount != 0)
|
||||
{
|
||||
list.Add(new SalesAnalysis() { GroupType = item.Name, Amount = item.TaxAmount });
|
||||
}
|
||||
}
|
||||
_list = list;
|
||||
}
|
||||
|
||||
_list = new SalesAnalysisBI().GetSaleAnalysis(dtpStart.Value, dtpFinish.Value);
|
||||
|
||||
dgvSale.AutoGenerateColumns = true;
|
||||
dgvSale.DataSource = _list;
|
||||
|
||||
82
Tanshu.Accounts.PointOfSale/Reports/TaxAnalysisForm.cs
Normal file
82
Tanshu.Accounts.PointOfSale/Reports/TaxAnalysisForm.cs
Normal file
@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class frmTaxAnalysisForm : Form
|
||||
{
|
||||
IList<TaxAnalysis> _list;
|
||||
bool _loading;
|
||||
public frmTaxAnalysisForm()
|
||||
{
|
||||
_loading = true;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SaleAnalysisForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Format = DateTimePickerFormat.Custom;
|
||||
dtpStart.CustomFormat = "dd-MMM-yyyy";
|
||||
dtpStart.Value = DateTime.Now.Date;
|
||||
dtpFinish.Format = DateTimePickerFormat.Custom;
|
||||
dtpFinish.CustomFormat = "dd-MMM-yyyy";
|
||||
dtpFinish.Value = DateTime.Now.Date;
|
||||
_loading = false;
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void dtpStart_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void ShowStatement()
|
||||
{
|
||||
if (_loading)
|
||||
return;
|
||||
if (DateTime.Today.Subtract(dtpStart.Value.Date).Days > 5 &&
|
||||
!Session.IsAllowed("Accounts Audit"))
|
||||
return;
|
||||
var start = dtpStart.Value.Date.AddHours(6);
|
||||
var finish = dtpFinish.Value.Date.AddDays(1).AddHours(5);
|
||||
_list = new List<TaxAnalysis>();
|
||||
if (finish > start)
|
||||
{
|
||||
var bi = new SalesAnalysisBI();
|
||||
var list = new List<TaxAnalysis>();
|
||||
list.AddRange(bi.GetServiceTax(start, finish));
|
||||
list.AddRange(bi.GetVat(start, finish));
|
||||
_list = list;
|
||||
}
|
||||
|
||||
|
||||
dgvSale.AutoGenerateColumns = true;
|
||||
dgvSale.DataSource = _list;
|
||||
dgvSale.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
dgvSale.Columns[1].DefaultCellStyle.Format = "#.##%;(#.##%);0%";
|
||||
dgvSale.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
|
||||
dgvSale.Columns[2].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
|
||||
dgvSale.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
|
||||
dgvSale.Columns[3].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
|
||||
dgvSale.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
|
||||
}
|
||||
|
||||
private void dtpFinish_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_list != null)
|
||||
{
|
||||
var startDate = dtpStart.Value.Date.AddHours(6);
|
||||
var finishDate = dtpFinish.Value.Date.AddDays(1).AddHours(5);
|
||||
//Accounts.Print.Thermal.PrintSale(Session.User.Name, _list, startDate, finishDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
128
Tanshu.Accounts.PointOfSale/Reports/TaxAnalysisForm.designer.cs
generated
Normal file
128
Tanshu.Accounts.PointOfSale/Reports/TaxAnalysisForm.designer.cs
generated
Normal file
@ -0,0 +1,128 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class frmTaxAnalysisForm
|
||||
{
|
||||
/// <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.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();
|
||||
//
|
||||
// dgvSale
|
||||
//
|
||||
this.dgvSale.AllowUserToAddRows = false;
|
||||
this.dgvSale.AllowUserToDeleteRows = false;
|
||||
this.dgvSale.AllowUserToResizeRows = false;
|
||||
this.dgvSale.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.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(383, 466);
|
||||
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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnPrint.Location = new System.Drawing.Point(320, 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);
|
||||
//
|
||||
// frmTaxAnalysisForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(407, 519);
|
||||
this.Controls.Add(this.btnPrint);
|
||||
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 = "frmTaxAnalysisForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Sale Analysis Form";
|
||||
this.Load += new System.EventHandler(this.SaleAnalysisForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
120
Tanshu.Accounts.PointOfSale/Reports/TaxAnalysisForm.resx
Normal file
120
Tanshu.Accounts.PointOfSale/Reports/TaxAnalysisForm.resx
Normal 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>
|
||||
@ -112,6 +112,18 @@
|
||||
<Compile Include="Management\ManagementForm.designer.cs">
|
||||
<DependentUpon>ManagementForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Masters\MachineListForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Masters\MachineListForm.Designer.cs">
|
||||
<DependentUpon>MachineListForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Masters\MachineEditForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Masters\MachineEditForm.Designer.cs">
|
||||
<DependentUpon>MachineEditForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Products\ModifierEditForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -142,7 +154,6 @@
|
||||
<Compile Include="Products\ProductGroupListForm.Designer.cs">
|
||||
<DependentUpon>ProductGroupListForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Profiling\BlockTimer.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
@ -154,6 +165,12 @@
|
||||
<Compile Include="Reports\BillDetailsForm.designer.cs">
|
||||
<DependentUpon>BillDetailsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Reports\TaxAnalysisForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Reports\TaxAnalysisForm.designer.cs">
|
||||
<DependentUpon>TaxAnalysisForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Reports\DiscountReportForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -172,10 +189,10 @@
|
||||
<Compile Include="Reports\SaleDetail.designer.cs">
|
||||
<DependentUpon>SaleDetail.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Sales\ReorderTableForm.cs">
|
||||
<Compile Include="Masters\ReorderTableForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Sales\ReorderTableForm.Designer.cs">
|
||||
<Compile Include="Masters\ReorderTableForm.Designer.cs">
|
||||
<DependentUpon>ReorderTableForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Sales\VoucherTypeForm.cs">
|
||||
@ -293,6 +310,14 @@
|
||||
<EmbeddedResource Include="Management\ManagementForm.resx">
|
||||
<DependentUpon>ManagementForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Masters\MachineListForm.resx">
|
||||
<DependentUpon>MachineListForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Masters\MachineEditForm.resx">
|
||||
<DependentUpon>MachineEditForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Products\ModifierEditForm.resx">
|
||||
<DependentUpon>ModifierEditForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@ -322,6 +347,10 @@
|
||||
<DependentUpon>BillDetailsForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Reports\TaxAnalysisForm.resx">
|
||||
<DependentUpon>TaxAnalysisForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Reports\DiscountReportForm.resx">
|
||||
<DependentUpon>DiscountReportForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@ -334,7 +363,7 @@
|
||||
<DependentUpon>SaleDetail.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Sales\ReorderTableForm.resx">
|
||||
<EmbeddedResource Include="Masters\ReorderTableForm.resx">
|
||||
<DependentUpon>ReorderTableForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Sales\VoucherTypeForm.resx">
|
||||
|
||||
Reference in New Issue
Block a user