Added inverse Attribute to ProductGroup.
BillInventory Renamed. Refactored Bill to be more usable. Added Bill Detail Report. Added Open Bill and Bill Details Roles. Zero Rate Products have Yellow background Color. Refactored UserBI, FoodTableBI, ModifierBI, PrintLocationBI, ProductBI, ProductGroupBI, TaxBI, UserBI, Cached the Products List. Product and Product Group Form Working.
This commit is contained in:
279
Tanshu.Accounts.PointOfSale/Products/ProductForm.Designer.cs
generated
Normal file
279
Tanshu.Accounts.PointOfSale/Products/ProductForm.Designer.cs
generated
Normal file
@ -0,0 +1,279 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class ProductForm
|
||||
{
|
||||
/// <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.Label4 = new System.Windows.Forms.Label();
|
||||
this.bsProductGroups = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.Label7 = new System.Windows.Forms.Label();
|
||||
this.bsTax = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.txtProductID = new System.Windows.Forms.TextBox();
|
||||
this.txtCode = new System.Windows.Forms.TextBox();
|
||||
this.Label2 = new System.Windows.Forms.Label();
|
||||
this.txtUnits = new System.Windows.Forms.TextBox();
|
||||
this.txtName = new System.Windows.Forms.TextBox();
|
||||
this.txtSalePrice = new System.Windows.Forms.TextBox();
|
||||
this.cmbTax = new System.Windows.Forms.ComboBox();
|
||||
this.chkDiscontinued = new System.Windows.Forms.CheckBox();
|
||||
this.txtServiceCharge = new System.Windows.Forms.TextBox();
|
||||
this.btnAddProductGroup = new System.Windows.Forms.Button();
|
||||
this.cmbProductGroup = new System.Windows.Forms.ComboBox();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProductGroups)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsTax)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// Label4
|
||||
//
|
||||
this.Label4.AutoSize = true;
|
||||
this.Label4.Location = new System.Drawing.Point(22, 67);
|
||||
this.Label4.Name = "Label4";
|
||||
this.Label4.Size = new System.Drawing.Size(84, 13);
|
||||
this.Label4.TabIndex = 59;
|
||||
this.Label4.Text = "Sale Price / Tax";
|
||||
//
|
||||
// bsProductGroups
|
||||
//
|
||||
this.bsProductGroups.DataSource = typeof(Tanshu.Accounts.Entities.ProductGroup);
|
||||
//
|
||||
// Label7
|
||||
//
|
||||
this.Label7.AutoSize = true;
|
||||
this.Label7.Location = new System.Drawing.Point(30, 120);
|
||||
this.Label7.Name = "Label7";
|
||||
this.Label7.Size = new System.Drawing.Size(36, 13);
|
||||
this.Label7.TabIndex = 33;
|
||||
this.Label7.Text = "Group";
|
||||
//
|
||||
// bsTax
|
||||
//
|
||||
this.bsTax.DataSource = typeof(Tanshu.Accounts.Entities.Tax);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(26, 93);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(80, 13);
|
||||
this.label5.TabIndex = 84;
|
||||
this.label5.Text = "Service Charge";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(12, 15);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(94, 13);
|
||||
this.label3.TabIndex = 86;
|
||||
this.label3.Text = "Product ID / Code";
|
||||
//
|
||||
// txtProductID
|
||||
//
|
||||
this.txtProductID.Location = new System.Drawing.Point(112, 12);
|
||||
this.txtProductID.Name = "txtProductID";
|
||||
this.txtProductID.ReadOnly = true;
|
||||
this.txtProductID.Size = new System.Drawing.Size(189, 20);
|
||||
this.txtProductID.TabIndex = 87;
|
||||
//
|
||||
// txtCode
|
||||
//
|
||||
this.txtCode.AccessibleName = "";
|
||||
this.txtCode.Enabled = false;
|
||||
this.txtCode.Location = new System.Drawing.Point(307, 12);
|
||||
this.txtCode.Name = "txtCode";
|
||||
this.txtCode.Size = new System.Drawing.Size(96, 20);
|
||||
this.txtCode.TabIndex = 88;
|
||||
this.txtCode.WordWrap = false;
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(36, 41);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(70, 13);
|
||||
this.Label2.TabIndex = 89;
|
||||
this.Label2.Text = "Name / Units";
|
||||
//
|
||||
// txtUnits
|
||||
//
|
||||
this.txtUnits.AccessibleName = "";
|
||||
this.txtUnits.Location = new System.Drawing.Point(307, 38);
|
||||
this.txtUnits.Name = "txtUnits";
|
||||
this.txtUnits.Size = new System.Drawing.Size(96, 20);
|
||||
this.txtUnits.TabIndex = 91;
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.AccessibleName = "";
|
||||
this.txtName.Location = new System.Drawing.Point(112, 38);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.Size = new System.Drawing.Size(189, 20);
|
||||
this.txtName.TabIndex = 90;
|
||||
//
|
||||
// txtSalePrice
|
||||
//
|
||||
this.txtSalePrice.AccessibleName = "";
|
||||
this.txtSalePrice.Location = new System.Drawing.Point(112, 64);
|
||||
this.txtSalePrice.Name = "txtSalePrice";
|
||||
this.txtSalePrice.Size = new System.Drawing.Size(189, 20);
|
||||
this.txtSalePrice.TabIndex = 92;
|
||||
this.txtSalePrice.Text = "0";
|
||||
//
|
||||
// cmbTax
|
||||
//
|
||||
this.cmbTax.DataSource = this.bsTax;
|
||||
this.cmbTax.DisplayMember = "Name";
|
||||
this.cmbTax.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbTax.Location = new System.Drawing.Point(307, 65);
|
||||
this.cmbTax.Name = "cmbTax";
|
||||
this.cmbTax.Size = new System.Drawing.Size(96, 21);
|
||||
this.cmbTax.TabIndex = 93;
|
||||
this.cmbTax.ValueMember = "TaxID";
|
||||
//
|
||||
// chkDiscontinued
|
||||
//
|
||||
this.chkDiscontinued.AutoSize = true;
|
||||
this.chkDiscontinued.Location = new System.Drawing.Point(307, 92);
|
||||
this.chkDiscontinued.Name = "chkDiscontinued";
|
||||
this.chkDiscontinued.Size = new System.Drawing.Size(88, 17);
|
||||
this.chkDiscontinued.TabIndex = 94;
|
||||
this.chkDiscontinued.Text = "Discontinued";
|
||||
this.chkDiscontinued.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// txtServiceCharge
|
||||
//
|
||||
this.txtServiceCharge.AccessibleName = "Phone 1";
|
||||
this.txtServiceCharge.Location = new System.Drawing.Point(112, 90);
|
||||
this.txtServiceCharge.Name = "txtServiceCharge";
|
||||
this.txtServiceCharge.Size = new System.Drawing.Size(189, 20);
|
||||
this.txtServiceCharge.TabIndex = 95;
|
||||
this.txtServiceCharge.Text = "0";
|
||||
//
|
||||
// btnAddProductGroup
|
||||
//
|
||||
this.btnAddProductGroup.Location = new System.Drawing.Point(307, 116);
|
||||
this.btnAddProductGroup.Name = "btnAddProductGroup";
|
||||
this.btnAddProductGroup.Size = new System.Drawing.Size(96, 21);
|
||||
this.btnAddProductGroup.TabIndex = 97;
|
||||
this.btnAddProductGroup.Text = "Add Group";
|
||||
//
|
||||
// cmbProductGroup
|
||||
//
|
||||
this.cmbProductGroup.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.bsProductGroups, "ProductGroupID", true));
|
||||
this.cmbProductGroup.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsProductGroups, "Name", true));
|
||||
this.cmbProductGroup.DataSource = this.bsProductGroups;
|
||||
this.cmbProductGroup.DisplayMember = "Name";
|
||||
this.cmbProductGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbProductGroup.Location = new System.Drawing.Point(112, 116);
|
||||
this.cmbProductGroup.Name = "cmbProductGroup";
|
||||
this.cmbProductGroup.Size = new System.Drawing.Size(189, 21);
|
||||
this.cmbProductGroup.TabIndex = 96;
|
||||
this.cmbProductGroup.ValueMember = "ProductGroupID";
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Location = new System.Drawing.Point(328, 143);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnCancel.TabIndex = 99;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(247, 143);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnOk.TabIndex = 98;
|
||||
this.btnOk.Text = "&Ok";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// ProductForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(415, 230);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.btnAddProductGroup);
|
||||
this.Controls.Add(this.cmbProductGroup);
|
||||
this.Controls.Add(this.chkDiscontinued);
|
||||
this.Controls.Add(this.txtServiceCharge);
|
||||
this.Controls.Add(this.Label7);
|
||||
this.Controls.Add(this.txtSalePrice);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.cmbTax);
|
||||
this.Controls.Add(this.txtUnits);
|
||||
this.Controls.Add(this.txtName);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.Controls.Add(this.txtCode);
|
||||
this.Controls.Add(this.txtProductID);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.Label4);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProductForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Products";
|
||||
this.Load += new System.EventHandler(this.Products_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProductGroups)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsTax)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.Label Label4;
|
||||
internal System.Windows.Forms.Label Label7;
|
||||
private System.Windows.Forms.BindingSource bsProductGroups;
|
||||
private System.Windows.Forms.BindingSource bsTax;
|
||||
internal System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox txtProductID;
|
||||
internal System.Windows.Forms.TextBox txtCode;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.TextBox txtUnits;
|
||||
internal System.Windows.Forms.TextBox txtName;
|
||||
internal System.Windows.Forms.TextBox txtSalePrice;
|
||||
internal System.Windows.Forms.ComboBox cmbTax;
|
||||
private System.Windows.Forms.CheckBox chkDiscontinued;
|
||||
internal System.Windows.Forms.TextBox txtServiceCharge;
|
||||
internal System.Windows.Forms.Button btnAddProductGroup;
|
||||
internal System.Windows.Forms.ComboBox cmbProductGroup;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
}
|
||||
}
|
||||
135
Tanshu.Accounts.PointOfSale/Products/ProductForm.cs
Normal file
135
Tanshu.Accounts.PointOfSale/Products/ProductForm.cs
Normal file
@ -0,0 +1,135 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Helpers;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using Tanshu.Accounts.Entities.Auth;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class ProductForm : Form
|
||||
{
|
||||
private int? _productID;
|
||||
public ProductForm(int? productID)
|
||||
{
|
||||
_productID = productID;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Products_Load(object sender, EventArgs e)
|
||||
{
|
||||
FillCombos();
|
||||
if (_productID.HasValue)
|
||||
{
|
||||
Product product;
|
||||
using (var bi = new ProductBI())
|
||||
product = bi.Get(x => x.ProductID == _productID.Value);
|
||||
txtProductID.Text = _productID.Value.ToString();
|
||||
txtCode.Text = product.Code.ToString();
|
||||
txtName.Text = product.Name;
|
||||
txtUnits.Text = product.Units;
|
||||
txtSalePrice.Text = product.SalePrice.ToString("#.##");
|
||||
cmbTax.SelectedValue = product.Tax.TaxID;
|
||||
txtServiceCharge.Text = product.ServiceCharge.ToString("#.##");
|
||||
chkDiscontinued.Checked = product.Discontinued;
|
||||
cmbProductGroup.SelectedValue = product.ProductGroup.ProductGroupID;
|
||||
}
|
||||
else
|
||||
{
|
||||
txtProductID.Text = "(Auto)";
|
||||
txtName.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
private void FillCombos()
|
||||
{
|
||||
using (var bi = new ProductGroupBI())
|
||||
bsProductGroups.DataSource = bi.List();
|
||||
using (var bi = new TaxBI())
|
||||
bsTax.DataSource = bi.List();
|
||||
}
|
||||
|
||||
private void btnAddCategory_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var frm = new ProductGroupListForm())
|
||||
frm.ShowDialog();
|
||||
FillCombos();
|
||||
cmbProductGroup.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private Product IsFormValid()
|
||||
{
|
||||
var product = new Product();
|
||||
|
||||
if (_productID.HasValue)
|
||||
product.ProductID = _productID.Value;
|
||||
|
||||
int code;
|
||||
if (!int.TryParse(txtCode.Text, out code))
|
||||
return null;
|
||||
if (code < 0)
|
||||
return null;
|
||||
product.Code = code;
|
||||
|
||||
if (string.IsNullOrEmpty(txtName.Text.Trim()))
|
||||
return null;
|
||||
product.Name = txtName.Text.Trim();
|
||||
if (string.IsNullOrEmpty(txtUnits.Text.Trim()))
|
||||
return null;
|
||||
product.Units = txtUnits.Text.Trim();
|
||||
|
||||
decimal salePrice;
|
||||
if (!decimal.TryParse(txtSalePrice.Text, out salePrice))
|
||||
return null;
|
||||
if (salePrice < 0)
|
||||
return null;
|
||||
product.SalePrice = salePrice;
|
||||
|
||||
// Tax
|
||||
if (cmbTax.SelectedItem == null)
|
||||
return null;
|
||||
product.Tax = (Tax)cmbTax.SelectedItem;
|
||||
|
||||
decimal serviceCharge;
|
||||
if (!decimal.TryParse(txtServiceCharge.Text, out serviceCharge))
|
||||
return null;
|
||||
if (serviceCharge < 0 || serviceCharge > 1)
|
||||
return null;
|
||||
product.ServiceCharge = serviceCharge;
|
||||
|
||||
product.Discontinued = chkDiscontinued.Checked;
|
||||
|
||||
//Group
|
||||
if (cmbProductGroup.SelectedItem == null)
|
||||
return null;
|
||||
product.ProductGroup = (ProductGroup)cmbProductGroup.SelectedItem;
|
||||
return product;
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
var product = IsFormValid();
|
||||
if (product != null)
|
||||
{
|
||||
using (var bi = new ProductBI())
|
||||
if (_productID.HasValue)
|
||||
bi.Update(product);
|
||||
else
|
||||
bi.Insert(product);
|
||||
MessageBox.Show("Update / Save Successful");
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
MessageBox.Show("The form is not valid");
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -117,9 +117,6 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="bsProducts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="bsProductGroups.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>211, 17</value>
|
||||
</metadata>
|
||||
189
Tanshu.Accounts.PointOfSale/Products/ProductGroupForm.Designer.cs
generated
Normal file
189
Tanshu.Accounts.PointOfSale/Products/ProductGroupForm.Designer.cs
generated
Normal file
@ -0,0 +1,189 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class ProductGroupForm
|
||||
{
|
||||
/// <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.txtName = new System.Windows.Forms.TextBox();
|
||||
this.txtProductGroupID = new System.Windows.Forms.TextBox();
|
||||
this.Label2 = new System.Windows.Forms.Label();
|
||||
this.Label1 = new System.Windows.Forms.Label();
|
||||
this.txtDiscountLimit = new System.Windows.Forms.TextBox();
|
||||
this.Label5 = new System.Windows.Forms.Label();
|
||||
this.chkModifierCompulsory = new System.Windows.Forms.CheckBox();
|
||||
this.txtGroupType = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.AccessibleName = "";
|
||||
this.txtName.Location = new System.Drawing.Point(94, 38);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.Size = new System.Drawing.Size(267, 20);
|
||||
this.txtName.TabIndex = 57;
|
||||
//
|
||||
// txtProductGroupID
|
||||
//
|
||||
this.txtProductGroupID.AccessibleName = "Unique ID";
|
||||
this.txtProductGroupID.Enabled = false;
|
||||
this.txtProductGroupID.Location = new System.Drawing.Point(94, 12);
|
||||
this.txtProductGroupID.Name = "txtProductGroupID";
|
||||
this.txtProductGroupID.ReadOnly = true;
|
||||
this.txtProductGroupID.Size = new System.Drawing.Size(267, 20);
|
||||
this.txtProductGroupID.TabIndex = 60;
|
||||
this.txtProductGroupID.Text = "ProductGroupID";
|
||||
this.txtProductGroupID.WordWrap = false;
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(53, 41);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(35, 13);
|
||||
this.Label2.TabIndex = 58;
|
||||
this.Label2.Text = "Name";
|
||||
//
|
||||
// Label1
|
||||
//
|
||||
this.Label1.AutoSize = true;
|
||||
this.Label1.Location = new System.Drawing.Point(70, 15);
|
||||
this.Label1.Name = "Label1";
|
||||
this.Label1.Size = new System.Drawing.Size(18, 13);
|
||||
this.Label1.TabIndex = 59;
|
||||
this.Label1.Text = "ID";
|
||||
//
|
||||
// txtDiscountLimit
|
||||
//
|
||||
this.txtDiscountLimit.AccessibleName = "Phone 1";
|
||||
this.txtDiscountLimit.Location = new System.Drawing.Point(94, 64);
|
||||
this.txtDiscountLimit.Name = "txtDiscountLimit";
|
||||
this.txtDiscountLimit.Size = new System.Drawing.Size(65, 20);
|
||||
this.txtDiscountLimit.TabIndex = 72;
|
||||
this.txtDiscountLimit.Text = "0";
|
||||
this.txtDiscountLimit.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// Label5
|
||||
//
|
||||
this.Label5.AutoSize = true;
|
||||
this.Label5.Location = new System.Drawing.Point(15, 67);
|
||||
this.Label5.Name = "Label5";
|
||||
this.Label5.Size = new System.Drawing.Size(73, 13);
|
||||
this.Label5.TabIndex = 73;
|
||||
this.Label5.Text = "Discount Limit";
|
||||
//
|
||||
// chkModifierCompulsory
|
||||
//
|
||||
this.chkModifierCompulsory.AutoSize = true;
|
||||
this.chkModifierCompulsory.Location = new System.Drawing.Point(94, 90);
|
||||
this.chkModifierCompulsory.Name = "chkModifierCompulsory";
|
||||
this.chkModifierCompulsory.Size = new System.Drawing.Size(137, 17);
|
||||
this.chkModifierCompulsory.TabIndex = 74;
|
||||
this.chkModifierCompulsory.Text = "Is Modifier Compulsory?";
|
||||
this.chkModifierCompulsory.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// txtGroupType
|
||||
//
|
||||
this.txtGroupType.AccessibleName = "";
|
||||
this.txtGroupType.Location = new System.Drawing.Point(94, 113);
|
||||
this.txtGroupType.Name = "txtGroupType";
|
||||
this.txtGroupType.Size = new System.Drawing.Size(267, 20);
|
||||
this.txtGroupType.TabIndex = 75;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(25, 116);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(63, 13);
|
||||
this.label3.TabIndex = 76;
|
||||
this.label3.Text = "Group Type";
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(205, 139);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnOk.TabIndex = 77;
|
||||
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(286, 139);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnCancel.TabIndex = 78;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// ProductGroupForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(373, 226);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.txtGroupType);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.chkModifierCompulsory);
|
||||
this.Controls.Add(this.txtDiscountLimit);
|
||||
this.Controls.Add(this.Label5);
|
||||
this.Controls.Add(this.txtName);
|
||||
this.Controls.Add(this.txtProductGroupID);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.Controls.Add(this.Label1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProductGroupForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Product Types";
|
||||
this.Load += new System.EventHandler(this.ProductGroupForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.TextBox txtName;
|
||||
internal System.Windows.Forms.TextBox txtProductGroupID;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.Label Label1;
|
||||
internal System.Windows.Forms.TextBox txtDiscountLimit;
|
||||
internal System.Windows.Forms.Label Label5;
|
||||
private System.Windows.Forms.CheckBox chkModifierCompulsory;
|
||||
internal System.Windows.Forms.TextBox txtGroupType;
|
||||
internal System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
}
|
||||
}
|
||||
81
Tanshu.Accounts.PointOfSale/Products/ProductGroupForm.cs
Normal file
81
Tanshu.Accounts.PointOfSale/Products/ProductGroupForm.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using System.Linq;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class ProductGroupForm : Form
|
||||
{
|
||||
private int? _productGroupID;
|
||||
public ProductGroupForm(int? productGroupID)
|
||||
{
|
||||
_productGroupID = productGroupID;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ProductGroupForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (_productGroupID.HasValue)
|
||||
{
|
||||
ProductGroup productGroup;
|
||||
using (var bi = new ProductGroupBI())
|
||||
productGroup = bi.Get(x => x.ProductGroupID == _productGroupID.Value);
|
||||
txtProductGroupID.Text = _productGroupID.Value.ToString();
|
||||
|
||||
txtName.Text = productGroup.Name;
|
||||
txtDiscountLimit.Text = productGroup.DiscountLimit.ToString();
|
||||
chkModifierCompulsory.Checked = productGroup.IsModifierCompulsory;
|
||||
txtGroupType.Text = productGroup.GroupType;
|
||||
}
|
||||
else
|
||||
{
|
||||
txtProductGroupID.Text = "(Auto)";
|
||||
txtName.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
var productGroup = IsFormValid();
|
||||
if (productGroup != null)
|
||||
{
|
||||
using (var bi = new ProductGroupBI())
|
||||
if (_productGroupID.HasValue)
|
||||
bi.Update(productGroup);
|
||||
else
|
||||
bi.Insert(productGroup);
|
||||
MessageBox.Show("Update / Save Successful");
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
MessageBox.Show("The form is not valid");
|
||||
}
|
||||
private ProductGroup IsFormValid()
|
||||
{
|
||||
var productGroup = new ProductGroup();
|
||||
if (_productGroupID.HasValue)
|
||||
productGroup.ProductGroupID = _productGroupID.Value;
|
||||
if (string.IsNullOrEmpty(txtName.Text.Trim()))
|
||||
return null;
|
||||
productGroup.Name = txtName.Text.Trim();
|
||||
decimal discount;
|
||||
if (!decimal.TryParse(txtDiscountLimit.Text, out discount))
|
||||
return null;
|
||||
if (discount < 0 || discount > 1)
|
||||
return null;
|
||||
productGroup.DiscountLimit = discount;
|
||||
productGroup.IsModifierCompulsory = chkModifierCompulsory.Checked;
|
||||
if (string.IsNullOrEmpty(txtGroupType.Text.Trim()))
|
||||
return null;
|
||||
productGroup.GroupType = txtGroupType.Text.Trim();
|
||||
return productGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
167
Tanshu.Accounts.PointOfSale/Products/ProductGroupListForm.Designer.cs
generated
Normal file
167
Tanshu.Accounts.PointOfSale/Products/ProductGroupListForm.Designer.cs
generated
Normal file
@ -0,0 +1,167 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class ProductGroupListForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.btnAdd = new System.Windows.Forms.Button();
|
||||
this.btnEdit = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.dgvProductTypes = new System.Windows.Forms.DataGridView();
|
||||
this.bsList = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.discountLimitDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.groupTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProductTypes)).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(286, 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);
|
||||
//
|
||||
// dgvProductTypes
|
||||
//
|
||||
this.dgvProductTypes.AllowUserToAddRows = false;
|
||||
this.dgvProductTypes.AllowUserToDeleteRows = false;
|
||||
this.dgvProductTypes.AllowUserToResizeRows = false;
|
||||
this.dgvProductTypes.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.dgvProductTypes.AutoGenerateColumns = false;
|
||||
this.dgvProductTypes.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.dgvProductTypes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvProductTypes.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.nameDataGridViewTextBoxColumn,
|
||||
this.discountLimitDataGridViewTextBoxColumn,
|
||||
this.groupTypeDataGridViewTextBoxColumn});
|
||||
this.dgvProductTypes.DataSource = this.bsList;
|
||||
this.dgvProductTypes.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
|
||||
this.dgvProductTypes.Location = new System.Drawing.Point(12, 12);
|
||||
this.dgvProductTypes.MultiSelect = false;
|
||||
this.dgvProductTypes.Name = "dgvProductTypes";
|
||||
this.dgvProductTypes.ReadOnly = true;
|
||||
this.dgvProductTypes.RowHeadersVisible = false;
|
||||
this.dgvProductTypes.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
|
||||
this.dgvProductTypes.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvProductTypes.Size = new System.Drawing.Size(349, 237);
|
||||
this.dgvProductTypes.TabIndex = 74;
|
||||
//
|
||||
// bsList
|
||||
//
|
||||
this.bsList.DataSource = typeof(Tanshu.Accounts.Entities.ProductGroup);
|
||||
//
|
||||
// nameDataGridViewTextBoxColumn
|
||||
//
|
||||
this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
|
||||
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.nameDataGridViewTextBoxColumn.Width = 60;
|
||||
//
|
||||
// discountLimitDataGridViewTextBoxColumn
|
||||
//
|
||||
this.discountLimitDataGridViewTextBoxColumn.DataPropertyName = "DiscountLimit";
|
||||
dataGridViewCellStyle2.Format = "P0";
|
||||
dataGridViewCellStyle2.NullValue = null;
|
||||
this.discountLimitDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.discountLimitDataGridViewTextBoxColumn.HeaderText = "Discount";
|
||||
this.discountLimitDataGridViewTextBoxColumn.Name = "discountLimitDataGridViewTextBoxColumn";
|
||||
this.discountLimitDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.discountLimitDataGridViewTextBoxColumn.Width = 74;
|
||||
//
|
||||
// groupTypeDataGridViewTextBoxColumn
|
||||
//
|
||||
this.groupTypeDataGridViewTextBoxColumn.DataPropertyName = "GroupType";
|
||||
this.groupTypeDataGridViewTextBoxColumn.HeaderText = "Type";
|
||||
this.groupTypeDataGridViewTextBoxColumn.Name = "groupTypeDataGridViewTextBoxColumn";
|
||||
this.groupTypeDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.groupTypeDataGridViewTextBoxColumn.Width = 56;
|
||||
//
|
||||
// ProductGroupListForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(373, 342);
|
||||
this.Controls.Add(this.dgvProductTypes);
|
||||
this.Controls.Add(this.btnAdd);
|
||||
this.Controls.Add(this.btnEdit);
|
||||
this.Controls.Add(this.btnExit);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProductGroupListForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Product Types";
|
||||
this.Load += new System.EventHandler(this.ProductGroupListForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProductTypes)).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 dgvProductTypes;
|
||||
private System.Windows.Forms.BindingSource bsList;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn discountLimitDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn groupTypeDataGridViewTextBoxColumn;
|
||||
}
|
||||
}
|
||||
49
Tanshu.Accounts.PointOfSale/Products/ProductGroupListForm.cs
Normal file
49
Tanshu.Accounts.PointOfSale/Products/ProductGroupListForm.cs
Normal file
@ -0,0 +1,49 @@
|
||||
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 ProductGroupListForm : Form
|
||||
{
|
||||
public ProductGroupListForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var frm = new ProductGroupForm(null))
|
||||
frm.ShowDialog();
|
||||
using (var bi = new ProductGroupBI())
|
||||
bsList.DataSource = bi.List();
|
||||
}
|
||||
|
||||
private void ProductGroupListForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
using (var bi = new ProductGroupBI())
|
||||
bsList.DataSource = bi.List();
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
var id = ((ProductGroup)bsList.Current).ProductGroupID;
|
||||
using (var frm = new ProductGroupForm(id))
|
||||
frm.ShowDialog();
|
||||
using (var bi = new ProductGroupBI())
|
||||
bsList.DataSource = bi.List();
|
||||
}
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
123
Tanshu.Accounts.PointOfSale/Products/ProductGroupListForm.resx
Normal file
123
Tanshu.Accounts.PointOfSale/Products/ProductGroupListForm.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="bsList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
229
Tanshu.Accounts.PointOfSale/Products/ProductListForm.Designer.cs
generated
Normal file
229
Tanshu.Accounts.PointOfSale/Products/ProductListForm.Designer.cs
generated
Normal file
@ -0,0 +1,229 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class ProductListForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.btnAdd = new System.Windows.Forms.Button();
|
||||
this.btnEdit = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.dgvProductTypes = new System.Windows.Forms.DataGridView();
|
||||
this.bsList = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.unitsDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Tax = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Group = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.serviceChargeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.salePriceDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.discontinuedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.sortOrderDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProductTypes)).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(286, 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);
|
||||
//
|
||||
// dgvProductTypes
|
||||
//
|
||||
this.dgvProductTypes.AllowUserToAddRows = false;
|
||||
this.dgvProductTypes.AllowUserToDeleteRows = false;
|
||||
this.dgvProductTypes.AllowUserToResizeRows = false;
|
||||
this.dgvProductTypes.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.dgvProductTypes.AutoGenerateColumns = false;
|
||||
this.dgvProductTypes.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.dgvProductTypes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvProductTypes.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.nameDataGridViewTextBoxColumn,
|
||||
this.unitsDataGridViewTextBoxColumn,
|
||||
this.Tax,
|
||||
this.Group,
|
||||
this.serviceChargeDataGridViewTextBoxColumn,
|
||||
this.salePriceDataGridViewTextBoxColumn,
|
||||
this.discontinuedDataGridViewCheckBoxColumn,
|
||||
this.sortOrderDataGridViewTextBoxColumn});
|
||||
this.dgvProductTypes.DataSource = this.bsList;
|
||||
this.dgvProductTypes.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
|
||||
this.dgvProductTypes.Location = new System.Drawing.Point(12, 12);
|
||||
this.dgvProductTypes.MultiSelect = false;
|
||||
this.dgvProductTypes.Name = "dgvProductTypes";
|
||||
this.dgvProductTypes.ReadOnly = true;
|
||||
this.dgvProductTypes.RowHeadersVisible = false;
|
||||
this.dgvProductTypes.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
|
||||
this.dgvProductTypes.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvProductTypes.Size = new System.Drawing.Size(349, 237);
|
||||
this.dgvProductTypes.TabIndex = 74;
|
||||
this.dgvProductTypes.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvProductTypes_CellFormatting);
|
||||
//
|
||||
// bsList
|
||||
//
|
||||
this.bsList.DataSource = typeof(Tanshu.Accounts.Entities.Product);
|
||||
//
|
||||
// nameDataGridViewTextBoxColumn
|
||||
//
|
||||
this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
|
||||
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.nameDataGridViewTextBoxColumn.Width = 60;
|
||||
//
|
||||
// unitsDataGridViewTextBoxColumn
|
||||
//
|
||||
this.unitsDataGridViewTextBoxColumn.DataPropertyName = "Units";
|
||||
this.unitsDataGridViewTextBoxColumn.HeaderText = "Units";
|
||||
this.unitsDataGridViewTextBoxColumn.Name = "unitsDataGridViewTextBoxColumn";
|
||||
this.unitsDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.unitsDataGridViewTextBoxColumn.Width = 56;
|
||||
//
|
||||
// Tax
|
||||
//
|
||||
this.Tax.DataPropertyName = "Tax";
|
||||
this.Tax.HeaderText = "Tax";
|
||||
this.Tax.Name = "Tax";
|
||||
this.Tax.ReadOnly = true;
|
||||
this.Tax.Width = 50;
|
||||
//
|
||||
// Group
|
||||
//
|
||||
this.Group.DataPropertyName = "ProductGroup";
|
||||
this.Group.HeaderText = "ProductGroup";
|
||||
this.Group.Name = "Group";
|
||||
this.Group.ReadOnly = true;
|
||||
this.Group.Width = 98;
|
||||
//
|
||||
// serviceChargeDataGridViewTextBoxColumn
|
||||
//
|
||||
this.serviceChargeDataGridViewTextBoxColumn.DataPropertyName = "ServiceCharge";
|
||||
dataGridViewCellStyle1.Format = "P0";
|
||||
this.serviceChargeDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.serviceChargeDataGridViewTextBoxColumn.HeaderText = "SC";
|
||||
this.serviceChargeDataGridViewTextBoxColumn.Name = "serviceChargeDataGridViewTextBoxColumn";
|
||||
this.serviceChargeDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.serviceChargeDataGridViewTextBoxColumn.Width = 46;
|
||||
//
|
||||
// salePriceDataGridViewTextBoxColumn
|
||||
//
|
||||
this.salePriceDataGridViewTextBoxColumn.DataPropertyName = "SalePrice";
|
||||
dataGridViewCellStyle2.Format = "N0";
|
||||
this.salePriceDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.salePriceDataGridViewTextBoxColumn.HeaderText = "SalePrice";
|
||||
this.salePriceDataGridViewTextBoxColumn.Name = "salePriceDataGridViewTextBoxColumn";
|
||||
this.salePriceDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.salePriceDataGridViewTextBoxColumn.Width = 77;
|
||||
//
|
||||
// discontinuedDataGridViewCheckBoxColumn
|
||||
//
|
||||
this.discontinuedDataGridViewCheckBoxColumn.DataPropertyName = "Discontinued";
|
||||
this.discontinuedDataGridViewCheckBoxColumn.HeaderText = "Discontinued";
|
||||
this.discontinuedDataGridViewCheckBoxColumn.Name = "discontinuedDataGridViewCheckBoxColumn";
|
||||
this.discontinuedDataGridViewCheckBoxColumn.ReadOnly = true;
|
||||
this.discontinuedDataGridViewCheckBoxColumn.Width = 75;
|
||||
//
|
||||
// sortOrderDataGridViewTextBoxColumn
|
||||
//
|
||||
this.sortOrderDataGridViewTextBoxColumn.DataPropertyName = "SortOrder";
|
||||
this.sortOrderDataGridViewTextBoxColumn.HeaderText = "SortOrder";
|
||||
this.sortOrderDataGridViewTextBoxColumn.Name = "sortOrderDataGridViewTextBoxColumn";
|
||||
this.sortOrderDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.sortOrderDataGridViewTextBoxColumn.Width = 77;
|
||||
//
|
||||
// ProductListForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(373, 342);
|
||||
this.Controls.Add(this.dgvProductTypes);
|
||||
this.Controls.Add(this.btnAdd);
|
||||
this.Controls.Add(this.btnEdit);
|
||||
this.Controls.Add(this.btnExit);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProductListForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Products";
|
||||
this.Load += new System.EventHandler(this.ProductGroupListForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProductTypes)).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 dgvProductTypes;
|
||||
private System.Windows.Forms.BindingSource bsList;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn discountLimitDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn groupTypeDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn productGroupDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn taxDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn unitsDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Tax;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Group;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn serviceChargeDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn salePriceDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn discontinuedDataGridViewCheckBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn sortOrderDataGridViewTextBoxColumn;
|
||||
}
|
||||
}
|
||||
63
Tanshu.Accounts.PointOfSale/Products/ProductListForm.cs
Normal file
63
Tanshu.Accounts.PointOfSale/Products/ProductListForm.cs
Normal file
@ -0,0 +1,63 @@
|
||||
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 ProductListForm : Form
|
||||
{
|
||||
public ProductListForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var frm = new ProductForm(null))
|
||||
frm.ShowDialog();
|
||||
using (var bi = new ProductBI())
|
||||
bsList.DataSource = bi.List();
|
||||
}
|
||||
|
||||
private void ProductGroupListForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
using (var bi = new ProductBI())
|
||||
bsList.DataSource = bi.List();
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
var id = ((Product)bsList.Current).ProductID;
|
||||
using (var frm = new ProductForm(id))
|
||||
frm.ShowDialog();
|
||||
using (var bi = new ProductBI())
|
||||
bsList.DataSource = bi.List();
|
||||
}
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void dgvProductTypes_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
|
||||
{
|
||||
if (e.Value == null)
|
||||
return;
|
||||
if (e.Value.ToString() == "Castle.Proxies.TaxProxy")
|
||||
{
|
||||
e.Value = ((Product)bsList[e.RowIndex]).Tax.Name;
|
||||
}
|
||||
else if (e.Value.ToString() == "Castle.Proxies.ProductGroupProxy")
|
||||
{
|
||||
e.Value = ((Product)bsList[e.RowIndex]).ProductGroup.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
129
Tanshu.Accounts.PointOfSale/Products/ProductListForm.resx
Normal file
129
Tanshu.Accounts.PointOfSale/Products/ProductListForm.resx
Normal file
@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="Tax.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Group.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>
|
||||
@ -1,255 +0,0 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class ProductTypes
|
||||
{
|
||||
/// <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.chkMaintainStock = new System.Windows.Forms.CheckBox();
|
||||
this.chkInUse = new System.Windows.Forms.CheckBox();
|
||||
this.btnAdd = new System.Windows.Forms.Button();
|
||||
this.btnDelete = new System.Windows.Forms.Button();
|
||||
this.btnNavFirst = new System.Windows.Forms.Button();
|
||||
this.btnNavPrev = new System.Windows.Forms.Button();
|
||||
this.lblNavLocation = new System.Windows.Forms.Label();
|
||||
this.btnNavNext = new System.Windows.Forms.Button();
|
||||
this.btnLast = new System.Windows.Forms.Button();
|
||||
this.txtName = new System.Windows.Forms.TextBox();
|
||||
this.btnUpdate = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.txtUniqueID = new System.Windows.Forms.TextBox();
|
||||
this.Label2 = new System.Windows.Forms.Label();
|
||||
this.Label1 = new System.Windows.Forms.Label();
|
||||
this.txtTaxRate = new System.Windows.Forms.TextBox();
|
||||
this.Label5 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// chkMaintainStock
|
||||
//
|
||||
this.chkMaintainStock.AutoSize = true;
|
||||
this.chkMaintainStock.Location = new System.Drawing.Point(259, 85);
|
||||
this.chkMaintainStock.Name = "chkMaintainStock";
|
||||
this.chkMaintainStock.Size = new System.Drawing.Size(89, 17);
|
||||
this.chkMaintainStock.TabIndex = 71;
|
||||
this.chkMaintainStock.Text = "For Purchase";
|
||||
this.chkMaintainStock.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkInUse
|
||||
//
|
||||
this.chkInUse.AutoSize = true;
|
||||
this.chkInUse.Location = new System.Drawing.Point(178, 86);
|
||||
this.chkInUse.Name = "chkInUse";
|
||||
this.chkInUse.Size = new System.Drawing.Size(65, 17);
|
||||
this.chkInUse.TabIndex = 70;
|
||||
this.chkInUse.Text = "For Sale";
|
||||
this.chkInUse.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Location = new System.Drawing.Point(35, 117);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnAdd.TabIndex = 68;
|
||||
this.btnAdd.Text = "&Add";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
this.btnDelete.Location = new System.Drawing.Point(115, 117);
|
||||
this.btnDelete.Name = "btnDelete";
|
||||
this.btnDelete.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnDelete.TabIndex = 69;
|
||||
this.btnDelete.Text = "&Delete";
|
||||
//
|
||||
// btnNavFirst
|
||||
//
|
||||
this.btnNavFirst.Location = new System.Drawing.Point(67, 147);
|
||||
this.btnNavFirst.Name = "btnNavFirst";
|
||||
this.btnNavFirst.Size = new System.Drawing.Size(40, 23);
|
||||
this.btnNavFirst.TabIndex = 63;
|
||||
this.btnNavFirst.Text = "<<";
|
||||
//
|
||||
// btnNavPrev
|
||||
//
|
||||
this.btnNavPrev.Location = new System.Drawing.Point(107, 147);
|
||||
this.btnNavPrev.Name = "btnNavPrev";
|
||||
this.btnNavPrev.Size = new System.Drawing.Size(35, 23);
|
||||
this.btnNavPrev.TabIndex = 64;
|
||||
this.btnNavPrev.Text = "<";
|
||||
//
|
||||
// lblNavLocation
|
||||
//
|
||||
this.lblNavLocation.BackColor = System.Drawing.Color.White;
|
||||
this.lblNavLocation.Location = new System.Drawing.Point(139, 147);
|
||||
this.lblNavLocation.Name = "lblNavLocation";
|
||||
this.lblNavLocation.Size = new System.Drawing.Size(95, 23);
|
||||
this.lblNavLocation.TabIndex = 65;
|
||||
this.lblNavLocation.Text = "No Records";
|
||||
this.lblNavLocation.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// btnNavNext
|
||||
//
|
||||
this.btnNavNext.Location = new System.Drawing.Point(235, 147);
|
||||
this.btnNavNext.Name = "btnNavNext";
|
||||
this.btnNavNext.Size = new System.Drawing.Size(35, 23);
|
||||
this.btnNavNext.TabIndex = 66;
|
||||
this.btnNavNext.Text = ">";
|
||||
//
|
||||
// btnLast
|
||||
//
|
||||
this.btnLast.Location = new System.Drawing.Point(275, 147);
|
||||
this.btnLast.Name = "btnLast";
|
||||
this.btnLast.Size = new System.Drawing.Size(40, 23);
|
||||
this.btnLast.TabIndex = 67;
|
||||
this.btnLast.Text = ">>";
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.AccessibleName = "";
|
||||
this.txtName.Location = new System.Drawing.Point(94, 48);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.Size = new System.Drawing.Size(254, 20);
|
||||
this.txtName.TabIndex = 57;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
this.btnUpdate.AccessibleName = "Done";
|
||||
this.btnUpdate.Location = new System.Drawing.Point(195, 117);
|
||||
this.btnUpdate.Name = "btnUpdate";
|
||||
this.btnUpdate.Size = new System.Drawing.Size(72, 24);
|
||||
this.btnUpdate.TabIndex = 62;
|
||||
this.btnUpdate.Text = "&Update";
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
this.btnExit.AccessibleName = "Done";
|
||||
this.btnExit.Location = new System.Drawing.Point(273, 117);
|
||||
this.btnExit.Name = "btnExit";
|
||||
this.btnExit.Size = new System.Drawing.Size(72, 24);
|
||||
this.btnExit.TabIndex = 61;
|
||||
this.btnExit.Text = "E&xit";
|
||||
//
|
||||
// txtUniqueID
|
||||
//
|
||||
this.txtUniqueID.AccessibleName = "Unique ID";
|
||||
this.txtUniqueID.Enabled = false;
|
||||
this.txtUniqueID.Location = new System.Drawing.Point(94, 13);
|
||||
this.txtUniqueID.Name = "txtUniqueID";
|
||||
this.txtUniqueID.Size = new System.Drawing.Size(254, 20);
|
||||
this.txtUniqueID.TabIndex = 60;
|
||||
this.txtUniqueID.Text = "UniqueID";
|
||||
this.txtUniqueID.WordWrap = false;
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(53, 48);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(35, 13);
|
||||
this.Label2.TabIndex = 58;
|
||||
this.Label2.Text = "Name";
|
||||
//
|
||||
// Label1
|
||||
//
|
||||
this.Label1.AutoSize = true;
|
||||
this.Label1.Location = new System.Drawing.Point(33, 13);
|
||||
this.Label1.Name = "Label1";
|
||||
this.Label1.Size = new System.Drawing.Size(55, 13);
|
||||
this.Label1.TabIndex = 59;
|
||||
this.Label1.Text = "Unique ID";
|
||||
//
|
||||
// txtTaxRate
|
||||
//
|
||||
this.txtTaxRate.AccessibleName = "Phone 1";
|
||||
this.txtTaxRate.Location = new System.Drawing.Point(94, 83);
|
||||
this.txtTaxRate.Name = "txtTaxRate";
|
||||
this.txtTaxRate.Size = new System.Drawing.Size(65, 20);
|
||||
this.txtTaxRate.TabIndex = 72;
|
||||
this.txtTaxRate.Text = "0";
|
||||
this.txtTaxRate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// Label5
|
||||
//
|
||||
this.Label5.AutoSize = true;
|
||||
this.Label5.Location = new System.Drawing.Point(15, 83);
|
||||
this.Label5.Name = "Label5";
|
||||
this.Label5.Size = new System.Drawing.Size(73, 13);
|
||||
this.Label5.TabIndex = 73;
|
||||
this.Label5.Text = "Discount Limit";
|
||||
//
|
||||
// ProductTypes
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(373, 180);
|
||||
this.Controls.Add(this.txtTaxRate);
|
||||
this.Controls.Add(this.Label5);
|
||||
this.Controls.Add(this.chkMaintainStock);
|
||||
this.Controls.Add(this.chkInUse);
|
||||
this.Controls.Add(this.btnAdd);
|
||||
this.Controls.Add(this.btnDelete);
|
||||
this.Controls.Add(this.btnNavFirst);
|
||||
this.Controls.Add(this.btnNavPrev);
|
||||
this.Controls.Add(this.lblNavLocation);
|
||||
this.Controls.Add(this.btnNavNext);
|
||||
this.Controls.Add(this.btnLast);
|
||||
this.Controls.Add(this.txtName);
|
||||
this.Controls.Add(this.btnUpdate);
|
||||
this.Controls.Add(this.btnExit);
|
||||
this.Controls.Add(this.txtUniqueID);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.Controls.Add(this.Label1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProductTypes";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Product Types";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.CheckBox chkMaintainStock;
|
||||
internal System.Windows.Forms.CheckBox chkInUse;
|
||||
internal System.Windows.Forms.Button btnAdd;
|
||||
internal System.Windows.Forms.Button btnDelete;
|
||||
internal System.Windows.Forms.Button btnNavFirst;
|
||||
internal System.Windows.Forms.Button btnNavPrev;
|
||||
internal System.Windows.Forms.Label lblNavLocation;
|
||||
internal System.Windows.Forms.Button btnNavNext;
|
||||
internal System.Windows.Forms.Button btnLast;
|
||||
internal System.Windows.Forms.TextBox txtName;
|
||||
internal System.Windows.Forms.Button btnUpdate;
|
||||
internal System.Windows.Forms.Button btnExit;
|
||||
internal System.Windows.Forms.TextBox txtUniqueID;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.Label Label1;
|
||||
internal System.Windows.Forms.TextBox txtTaxRate;
|
||||
internal System.Windows.Forms.Label Label5;
|
||||
}
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
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;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class ProductTypes : Form
|
||||
{
|
||||
public ProductTypes()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,450 +0,0 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class ProductsForm
|
||||
{
|
||||
/// <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.Label4 = new System.Windows.Forms.Label();
|
||||
this.txtSalePrice = new System.Windows.Forms.TextBox();
|
||||
this.bsProducts = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.btnAddProductGroup = new System.Windows.Forms.Button();
|
||||
this.cmbProductGroup = new System.Windows.Forms.ComboBox();
|
||||
this.bsProductGroups = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.Label7 = new System.Windows.Forms.Label();
|
||||
this.txtName = new System.Windows.Forms.TextBox();
|
||||
this.Label2 = new System.Windows.Forms.Label();
|
||||
this.btnNavFirst = new System.Windows.Forms.Button();
|
||||
this.btnNavPrev = new System.Windows.Forms.Button();
|
||||
this.lblNavLocation = new System.Windows.Forms.Label();
|
||||
this.btnNavNext = new System.Windows.Forms.Button();
|
||||
this.btnLast = new System.Windows.Forms.Button();
|
||||
this.txtUniqueID = new System.Windows.Forms.TextBox();
|
||||
this.Label1 = new System.Windows.Forms.Label();
|
||||
this.btnAdd = new System.Windows.Forms.Button();
|
||||
this.btnDelete = new System.Windows.Forms.Button();
|
||||
this.btnUpdate = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.chkDiscontinued = new System.Windows.Forms.CheckBox();
|
||||
this.cmbSalesTax = new System.Windows.Forms.ComboBox();
|
||||
this.bsTax = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.txtProductID = new System.Windows.Forms.TextBox();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.txtUnits = new System.Windows.Forms.TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProducts)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProductGroups)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsTax)).BeginInit();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// Label4
|
||||
//
|
||||
this.Label4.AutoSize = true;
|
||||
this.Label4.Location = new System.Drawing.Point(3, 105);
|
||||
this.Label4.Name = "Label4";
|
||||
this.Label4.Size = new System.Drawing.Size(84, 13);
|
||||
this.Label4.TabIndex = 59;
|
||||
this.Label4.Text = "Sale Price / Tax";
|
||||
//
|
||||
// txtSalePrice
|
||||
//
|
||||
this.txtSalePrice.AccessibleName = "";
|
||||
this.txtSalePrice.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsProducts, "SalePrice", true));
|
||||
this.txtSalePrice.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.txtSalePrice.Location = new System.Drawing.Point(106, 108);
|
||||
this.txtSalePrice.Name = "txtSalePrice";
|
||||
this.txtSalePrice.Size = new System.Drawing.Size(149, 20);
|
||||
this.txtSalePrice.TabIndex = 53;
|
||||
this.txtSalePrice.Text = "0";
|
||||
//
|
||||
// bsProducts
|
||||
//
|
||||
this.bsProducts.DataSource = typeof(Tanshu.Accounts.Entities.Product);
|
||||
this.bsProducts.AddingNew += new System.ComponentModel.AddingNewEventHandler(this.bsProducts_AddingNew);
|
||||
this.bsProducts.PositionChanged += new System.EventHandler(this.bsProducts_PositionChanged);
|
||||
//
|
||||
// btnAddProductGroup
|
||||
//
|
||||
this.btnAddProductGroup.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.btnAddProductGroup.Location = new System.Drawing.Point(261, 73);
|
||||
this.btnAddProductGroup.Name = "btnAddProductGroup";
|
||||
this.btnAddProductGroup.Size = new System.Drawing.Size(151, 21);
|
||||
this.btnAddProductGroup.TabIndex = 37;
|
||||
this.btnAddProductGroup.Text = "Add Group";
|
||||
this.btnAddProductGroup.Click += new System.EventHandler(this.btnAddCategory_Click);
|
||||
//
|
||||
// cmbProductGroup
|
||||
//
|
||||
this.cmbProductGroup.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.bsProducts, "ProductGroup", true));
|
||||
this.cmbProductGroup.DataSource = this.bsProductGroups;
|
||||
this.cmbProductGroup.DisplayMember = "Name";
|
||||
this.cmbProductGroup.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.cmbProductGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbProductGroup.Location = new System.Drawing.Point(106, 73);
|
||||
this.cmbProductGroup.Name = "cmbProductGroup";
|
||||
this.cmbProductGroup.Size = new System.Drawing.Size(149, 21);
|
||||
this.cmbProductGroup.TabIndex = 35;
|
||||
this.cmbProductGroup.ValueMember = "ProductTypeID";
|
||||
//
|
||||
// bsProductGroups
|
||||
//
|
||||
this.bsProductGroups.DataSource = typeof(Tanshu.Accounts.Entities.ProductGroup);
|
||||
//
|
||||
// Label7
|
||||
//
|
||||
this.Label7.AutoSize = true;
|
||||
this.Label7.Location = new System.Drawing.Point(3, 70);
|
||||
this.Label7.Name = "Label7";
|
||||
this.Label7.Size = new System.Drawing.Size(76, 13);
|
||||
this.Label7.TabIndex = 33;
|
||||
this.Label7.Text = "Product Group";
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.AccessibleName = "";
|
||||
this.txtName.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsProducts, "Name", true));
|
||||
this.txtName.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.txtName.Location = new System.Drawing.Point(106, 38);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.Size = new System.Drawing.Size(149, 20);
|
||||
this.txtName.TabIndex = 0;
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(3, 35);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(70, 13);
|
||||
this.Label2.TabIndex = 28;
|
||||
this.Label2.Text = "Name / Units";
|
||||
//
|
||||
// btnNavFirst
|
||||
//
|
||||
this.btnNavFirst.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnNavFirst.Location = new System.Drawing.Point(3, 53);
|
||||
this.btnNavFirst.Name = "btnNavFirst";
|
||||
this.btnNavFirst.Size = new System.Drawing.Size(97, 44);
|
||||
this.btnNavFirst.TabIndex = 44;
|
||||
this.btnNavFirst.Text = "<<";
|
||||
this.btnNavFirst.Click += new System.EventHandler(this.btnNavFirst_Click);
|
||||
//
|
||||
// btnNavPrev
|
||||
//
|
||||
this.btnNavPrev.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnNavPrev.Location = new System.Drawing.Point(106, 53);
|
||||
this.btnNavPrev.Name = "btnNavPrev";
|
||||
this.btnNavPrev.Size = new System.Drawing.Size(97, 44);
|
||||
this.btnNavPrev.TabIndex = 45;
|
||||
this.btnNavPrev.Text = "<";
|
||||
this.btnNavPrev.Click += new System.EventHandler(this.btnNavPrev_Click);
|
||||
//
|
||||
// lblNavLocation
|
||||
//
|
||||
this.lblNavLocation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lblNavLocation.BackColor = System.Drawing.Color.White;
|
||||
this.lblNavLocation.Location = new System.Drawing.Point(12, 186);
|
||||
this.lblNavLocation.Name = "lblNavLocation";
|
||||
this.lblNavLocation.Size = new System.Drawing.Size(391, 23);
|
||||
this.lblNavLocation.TabIndex = 46;
|
||||
this.lblNavLocation.Text = "No Records";
|
||||
this.lblNavLocation.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.lblNavLocation.Click += new System.EventHandler(this.lblNavLocation_Click);
|
||||
//
|
||||
// btnNavNext
|
||||
//
|
||||
this.btnNavNext.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnNavNext.Location = new System.Drawing.Point(209, 53);
|
||||
this.btnNavNext.Name = "btnNavNext";
|
||||
this.btnNavNext.Size = new System.Drawing.Size(97, 44);
|
||||
this.btnNavNext.TabIndex = 47;
|
||||
this.btnNavNext.Text = ">";
|
||||
this.btnNavNext.Click += new System.EventHandler(this.btnNavNext_Click);
|
||||
//
|
||||
// btnLast
|
||||
//
|
||||
this.btnLast.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnLast.Location = new System.Drawing.Point(312, 53);
|
||||
this.btnLast.Name = "btnLast";
|
||||
this.btnLast.Size = new System.Drawing.Size(100, 44);
|
||||
this.btnLast.TabIndex = 48;
|
||||
this.btnLast.Text = ">>";
|
||||
this.btnLast.Click += new System.EventHandler(this.btnLast_Click);
|
||||
//
|
||||
// txtUniqueID
|
||||
//
|
||||
this.txtUniqueID.AccessibleName = "";
|
||||
this.txtUniqueID.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsProducts, "Code", true));
|
||||
this.txtUniqueID.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.txtUniqueID.Enabled = false;
|
||||
this.txtUniqueID.Location = new System.Drawing.Point(261, 3);
|
||||
this.txtUniqueID.Name = "txtUniqueID";
|
||||
this.txtUniqueID.Size = new System.Drawing.Size(151, 20);
|
||||
this.txtUniqueID.TabIndex = 37;
|
||||
this.txtUniqueID.WordWrap = false;
|
||||
//
|
||||
// Label1
|
||||
//
|
||||
this.Label1.AutoSize = true;
|
||||
this.Label1.Location = new System.Drawing.Point(3, 0);
|
||||
this.Label1.Name = "Label1";
|
||||
this.Label1.Size = new System.Drawing.Size(32, 13);
|
||||
this.Label1.TabIndex = 36;
|
||||
this.Label1.Text = "Code";
|
||||
this.Label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnAdd.Location = new System.Drawing.Point(3, 3);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(97, 44);
|
||||
this.btnAdd.TabIndex = 72;
|
||||
this.btnAdd.Text = "&Add";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
this.btnDelete.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnDelete.Location = new System.Drawing.Point(106, 3);
|
||||
this.btnDelete.Name = "btnDelete";
|
||||
this.btnDelete.Size = new System.Drawing.Size(97, 44);
|
||||
this.btnDelete.TabIndex = 73;
|
||||
this.btnDelete.Text = "&Delete";
|
||||
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
this.btnUpdate.AccessibleName = "Done";
|
||||
this.btnUpdate.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnUpdate.Location = new System.Drawing.Point(209, 3);
|
||||
this.btnUpdate.Name = "btnUpdate";
|
||||
this.btnUpdate.Size = new System.Drawing.Size(97, 44);
|
||||
this.btnUpdate.TabIndex = 71;
|
||||
this.btnUpdate.Text = "&Update";
|
||||
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
this.btnExit.AccessibleName = "Done";
|
||||
this.btnExit.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnExit.Location = new System.Drawing.Point(312, 3);
|
||||
this.btnExit.Name = "btnExit";
|
||||
this.btnExit.Size = new System.Drawing.Size(100, 44);
|
||||
this.btnExit.TabIndex = 70;
|
||||
this.btnExit.Text = "E&xit";
|
||||
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
|
||||
//
|
||||
// chkDiscontinued
|
||||
//
|
||||
this.chkDiscontinued.AutoSize = true;
|
||||
this.chkDiscontinued.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.bsProducts, "Discontinued", true));
|
||||
this.chkDiscontinued.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.chkDiscontinued.Location = new System.Drawing.Point(261, 143);
|
||||
this.chkDiscontinued.Name = "chkDiscontinued";
|
||||
this.chkDiscontinued.Size = new System.Drawing.Size(151, 17);
|
||||
this.chkDiscontinued.TabIndex = 78;
|
||||
this.chkDiscontinued.Text = "Discontinued";
|
||||
this.chkDiscontinued.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cmbSalesTax
|
||||
//
|
||||
this.cmbSalesTax.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.bsProducts, "Tax", true));
|
||||
this.cmbSalesTax.DataSource = this.bsTax;
|
||||
this.cmbSalesTax.DisplayMember = "Name";
|
||||
this.cmbSalesTax.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.cmbSalesTax.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbSalesTax.Location = new System.Drawing.Point(261, 108);
|
||||
this.cmbSalesTax.Name = "cmbSalesTax";
|
||||
this.cmbSalesTax.Size = new System.Drawing.Size(151, 21);
|
||||
this.cmbSalesTax.TabIndex = 82;
|
||||
this.cmbSalesTax.ValueMember = "LedgerID";
|
||||
//
|
||||
// bsTax
|
||||
//
|
||||
this.bsTax.DataSource = typeof(Tanshu.Accounts.Entities.Tax);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(3, 140);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(80, 13);
|
||||
this.label5.TabIndex = 84;
|
||||
this.label5.Text = "Service Charge";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.AccessibleName = "Phone 1";
|
||||
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsProducts, "ServiceCharge", true));
|
||||
this.textBox1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.textBox1.Location = new System.Drawing.Point(106, 143);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(149, 20);
|
||||
this.textBox1.TabIndex = 83;
|
||||
this.textBox1.Text = "0";
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 3;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 37.5F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 37.5F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtUnits, 2, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtProductID, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.chkDiscontinued, 2, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtSalePrice, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.textBox1, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.btnAddProductGroup, 2, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.Label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.cmbSalesTax, 2, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.cmbProductGroup, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtUniqueID, 2, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.Label7, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.Label2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtName, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.Label4, 0, 3);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 5;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(415, 175);
|
||||
this.tableLayoutPanel1.TabIndex = 85;
|
||||
//
|
||||
// txtProductID
|
||||
//
|
||||
this.txtProductID.AccessibleName = "";
|
||||
this.txtProductID.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsProducts, "ProductID", true));
|
||||
this.txtProductID.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.txtProductID.Enabled = false;
|
||||
this.txtProductID.Location = new System.Drawing.Point(106, 3);
|
||||
this.txtProductID.Name = "txtProductID";
|
||||
this.txtProductID.Size = new System.Drawing.Size(149, 20);
|
||||
this.txtProductID.TabIndex = 83;
|
||||
this.txtProductID.WordWrap = false;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
this.tableLayoutPanel2.ColumnCount = 4;
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnAdd, 0, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnDelete, 1, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnNavPrev, 1, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnLast, 3, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnNavNext, 2, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnNavFirst, 0, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnExit, 3, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.btnUpdate, 2, 0);
|
||||
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 212);
|
||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
this.tableLayoutPanel2.RowCount = 2;
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(415, 100);
|
||||
this.tableLayoutPanel2.TabIndex = 86;
|
||||
//
|
||||
// txtUnits
|
||||
//
|
||||
this.txtUnits.AccessibleName = "";
|
||||
this.txtUnits.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsProducts, "Units", true));
|
||||
this.txtUnits.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.txtUnits.Location = new System.Drawing.Point(261, 38);
|
||||
this.txtUnits.Name = "txtUnits";
|
||||
this.txtUnits.Size = new System.Drawing.Size(151, 20);
|
||||
this.txtUnits.TabIndex = 85;
|
||||
//
|
||||
// ProductsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(415, 312);
|
||||
this.Controls.Add(this.tableLayoutPanel2);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Controls.Add(this.lblNavLocation);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProductsForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Products";
|
||||
this.Load += new System.EventHandler(this.Products_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProducts)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProductGroups)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsTax)).EndInit();
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.Label Label4;
|
||||
internal System.Windows.Forms.TextBox txtSalePrice;
|
||||
internal System.Windows.Forms.Button btnAddProductGroup;
|
||||
internal System.Windows.Forms.ComboBox cmbProductGroup;
|
||||
internal System.Windows.Forms.Label Label7;
|
||||
internal System.Windows.Forms.TextBox txtName;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.Button btnNavFirst;
|
||||
internal System.Windows.Forms.Button btnNavPrev;
|
||||
internal System.Windows.Forms.Label lblNavLocation;
|
||||
internal System.Windows.Forms.Button btnNavNext;
|
||||
internal System.Windows.Forms.Button btnLast;
|
||||
internal System.Windows.Forms.TextBox txtUniqueID;
|
||||
internal System.Windows.Forms.Label Label1;
|
||||
internal System.Windows.Forms.Button btnAdd;
|
||||
internal System.Windows.Forms.Button btnDelete;
|
||||
internal System.Windows.Forms.Button btnUpdate;
|
||||
internal System.Windows.Forms.Button btnExit;
|
||||
private System.Windows.Forms.CheckBox chkDiscontinued;
|
||||
internal System.Windows.Forms.ComboBox cmbSalesTax;
|
||||
private System.Windows.Forms.BindingSource bsProducts;
|
||||
private System.Windows.Forms.BindingSource bsProductGroups;
|
||||
private System.Windows.Forms.BindingSource bsTax;
|
||||
internal System.Windows.Forms.Label label5;
|
||||
internal System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
internal System.Windows.Forms.TextBox txtProductID;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
internal System.Windows.Forms.TextBox txtUnits;
|
||||
}
|
||||
}
|
||||
@ -1,228 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Helpers;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using Tanshu.Accounts.Entities.Auth;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class ProductsForm : Form
|
||||
{
|
||||
bool createOnly = false;
|
||||
IList<Product> productList = new List<Product>();
|
||||
|
||||
#region Form Load
|
||||
public ProductsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Products_Load(object sender, EventArgs e)
|
||||
{
|
||||
productList = ProductBI.GetProducts();
|
||||
bsProducts.DataSource = productList;
|
||||
FillCombos();
|
||||
bsProducts.MoveFirst();
|
||||
}
|
||||
|
||||
private void FillCombos()
|
||||
{
|
||||
bsProductGroups.DataSource = new ProductGroupBI().GetProductGroups();
|
||||
bsTax.DataSource = TaxBI.GetTaxes();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Buttons
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (btnAdd.Text == "&Add")
|
||||
{
|
||||
bsProducts.AddNew();
|
||||
LockControls(true);
|
||||
this.lblNavLocation.Text = "Add New";
|
||||
txtName.Select();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ValidateValues())
|
||||
{
|
||||
MessageBox.Show("Missing Information: Please check the form.");
|
||||
bsProducts.CancelEdit();
|
||||
}
|
||||
else
|
||||
{
|
||||
bsProducts.EndEdit();
|
||||
Save(true);
|
||||
if (createOnly)
|
||||
btnExit_Click(sender, e);
|
||||
else
|
||||
{
|
||||
productList = ProductBI.GetProducts();
|
||||
bsProducts.DataSource = productList;
|
||||
LockControls(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (btnDelete.Text == "&Delete")
|
||||
{
|
||||
if (productList.Count() > 0)
|
||||
{
|
||||
if (MessageBox.Show("Are you sure?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
|
||||
{
|
||||
if (ProductBI.Delete(productList.Single(p => p.Code == Convert.ToInt32(txtUniqueID.Text)).ProductID))
|
||||
{
|
||||
productList = ProductBI.GetProducts();
|
||||
btnNavFirst_Click(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
LockControls(false);
|
||||
bsProducts.CancelEdit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageBox.Show("Are you sure?", "Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
|
||||
{
|
||||
Save(false);
|
||||
bsProducts.ResetItem(bsProducts.Position);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Add / Edit / Delete
|
||||
private bool ValidateValues()
|
||||
{
|
||||
if (txtName.Text.Trim().Length == 0)
|
||||
return false;
|
||||
if (cmbProductGroup.SelectedValue == null)
|
||||
return false;
|
||||
if (cmbSalesTax.SelectedValue == null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool Save(bool addNew)
|
||||
{
|
||||
#region Setup Products
|
||||
Product product = new Product();
|
||||
if (!addNew)
|
||||
product = (Product)bsProducts.Current;
|
||||
product.Name = txtName.Text;
|
||||
product.Units = txtUnits.Text;
|
||||
product.ProductGroup = new ProductGroupBI().GetProductGroup((int)cmbProductGroup.SelectedValue);
|
||||
product.SalePrice = Convert.ToDecimal(txtSalePrice.Text);
|
||||
product.Discontinued = chkDiscontinued.Checked;
|
||||
product.Tax = new Tax();
|
||||
if (addNew)
|
||||
ProductBI.Insert(product);
|
||||
else
|
||||
ProductBI.Update(product);
|
||||
|
||||
return true;
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void LockControls(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
btnAdd.Text = "&Save";
|
||||
btnDelete.Text = "&Cancel";
|
||||
}
|
||||
else
|
||||
{
|
||||
btnAdd.Text = "&Add";
|
||||
btnDelete.Text = "&Delete";
|
||||
}
|
||||
btnExit.Enabled = !enable;
|
||||
btnLast.Enabled = !enable;
|
||||
btnNavPrev.Enabled = !enable;
|
||||
btnNavNext.Enabled = !enable;
|
||||
btnUpdate.Enabled = !enable;
|
||||
btnNavFirst.Enabled = !enable;
|
||||
}
|
||||
|
||||
private void btnAddCategory_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProductTypes frm = new ProductTypes();
|
||||
frm.ShowDialog();
|
||||
frm.Dispose();
|
||||
FillCombos();
|
||||
cmbProductGroup.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
#region Move Buttons
|
||||
private void btnNavFirst_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.bsProducts.MoveFirst();
|
||||
}
|
||||
private void btnNavPrev_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.bsProducts.MovePrevious();
|
||||
}
|
||||
private void btnNavNext_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.bsProducts.MoveNext();
|
||||
}
|
||||
private void btnLast_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.bsProducts.MoveLast();
|
||||
}
|
||||
private void lblNavLocation_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (SelectProduct selectProduct = new SelectProduct(ProductBI.GetFilteredProducts, true))
|
||||
{
|
||||
selectProduct.ShowDialog();
|
||||
if (selectProduct.SelectedItem != null)
|
||||
{
|
||||
bsProducts.Position = GetPosition(productList, selectProduct.SelectedItem.ProductID);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Binding Source Events
|
||||
private void bsProducts_AddingNew(object sender, AddingNewEventArgs e)
|
||||
{
|
||||
e.NewObject = new Product();
|
||||
}
|
||||
|
||||
private void bsProducts_PositionChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.lblNavLocation.Text = string.Format("{0} of {1}", bsProducts.Position + 1, bsProducts.Count);
|
||||
}
|
||||
#endregion
|
||||
private int GetPosition(IList<Product> list, int id)
|
||||
{
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
if (list[i].ProductID == id)
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user