From 98e1e1df30a99621f46756223d0c05ceda405c92 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Jan 2011 18:08:30 +0530 Subject: [PATCH] Item Modifier added --- Tanshu.Accounts.BI/ModifierBI.cs | 70 +++++++++++++++ Tanshu.Accounts.BI/ProductBI.cs | 24 ++--- .../{ProductTypeBI.cs => ProductGroupBI.cs} | 32 +++---- Tanshu.Accounts.BI/ProductGroupModifierBI.cs | 81 +++++++++++++++++ Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj | 4 +- .../DAOFactory/ModifierDAO.cs | 15 ++++ .../DAOFactory/ProductGroupDAO.cs | 17 ++++ .../DAOFactory/ProductGroupModifierDAO.cs | 16 ++++ .../DAOFactory/ProductTypeDAO.cs | 17 ---- .../Data Contracts/ComplexProductBO.cs | 28 ------ .../Data Contracts/ModifierBO.cs | 10 +++ .../Data Contracts/ProductBO.cs | 2 +- .../Data Contracts/ProductDisplayBO.cs | 2 +- .../Data Contracts/ProductGroupBO.cs | 13 +++ .../Data Contracts/ProductGroupModifierBO.cs | 13 +++ .../Data Contracts/ProductTypeBO.cs | 22 ----- .../Service Contracts/ProductBI.cs | 21 ----- .../Service Contracts/ProductGroupBI.cs | 18 ++++ .../Service Contracts/ProductTypesBI.cs | 19 ---- .../Tanshu.Accounts.Contracts.csproj | 12 +-- Tanshu.Accounts.DAOFactory/DAOFactory.cs | 4 +- .../SqlServerDAOFactory.cs | 14 ++- Tanshu.Accounts.Helpers/ControlFactory.cs | 48 ++++++++-- Tanshu.Accounts.PointOfSale/App.config | 2 +- .../Controllers/BillController.cs | 17 ++++ .../Controllers/ISaleForm.cs | 1 + Tanshu.Accounts.PointOfSale/MainForm.cs | 2 +- .../ProductsForm.Designer.cs | 2 +- Tanshu.Accounts.PointOfSale/ProductsForm.cs | 20 ++--- .../Sales/SalesForm.cs | 23 +++-- .../Updates/UpdateForm.Designer.cs | 51 ++++++++--- .../Updates/UpdateForm.cs | 2 + .../Updates/UpdateSales.Designer.cs | 55 ++++++------ .../Updates/UpdateSales.cs | 2 + Tanshu.Accounts.Print/Thermal.cs | 2 +- Tanshu.Accounts.SqlDAO/MembershipDAO.cs | 20 ++--- Tanshu.Accounts.SqlDAO/ModifierDAO.cs | 52 +++++++++++ Tanshu.Accounts.SqlDAO/ProductDAO.cs | 24 ++--- .../ProductGroupModifierDAO.cs | 89 +++++++++++++++++++ Tanshu.Accounts.SqlDAO/ProductTypeDAO.cs | 68 ++++++-------- .../Tanshu.Accounts.SqlDAO.csproj | 2 + Tanshu.Accounts.SqlDAO/UserDAO.cs | 22 ++--- 42 files changed, 674 insertions(+), 284 deletions(-) create mode 100644 Tanshu.Accounts.BI/ModifierBI.cs rename Tanshu.Accounts.BI/{ProductTypeBI.cs => ProductGroupBI.cs} (58%) create mode 100644 Tanshu.Accounts.BI/ProductGroupModifierBI.cs create mode 100644 Tanshu.Accounts.Contracts/DAOFactory/ModifierDAO.cs create mode 100644 Tanshu.Accounts.Contracts/DAOFactory/ProductGroupDAO.cs create mode 100644 Tanshu.Accounts.Contracts/DAOFactory/ProductGroupModifierDAO.cs delete mode 100644 Tanshu.Accounts.Contracts/DAOFactory/ProductTypeDAO.cs delete mode 100644 Tanshu.Accounts.Contracts/Data Contracts/ComplexProductBO.cs create mode 100644 Tanshu.Accounts.Contracts/Data Contracts/ModifierBO.cs create mode 100644 Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs create mode 100644 Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifierBO.cs delete mode 100644 Tanshu.Accounts.Contracts/Data Contracts/ProductTypeBO.cs delete mode 100644 Tanshu.Accounts.Contracts/Service Contracts/ProductBI.cs create mode 100644 Tanshu.Accounts.Contracts/Service Contracts/ProductGroupBI.cs delete mode 100644 Tanshu.Accounts.Contracts/Service Contracts/ProductTypesBI.cs create mode 100644 Tanshu.Accounts.SqlDAO/ModifierDAO.cs create mode 100644 Tanshu.Accounts.SqlDAO/ProductGroupModifierDAO.cs diff --git a/Tanshu.Accounts.BI/ModifierBI.cs b/Tanshu.Accounts.BI/ModifierBI.cs new file mode 100644 index 0000000..9f21888 --- /dev/null +++ b/Tanshu.Accounts.BI/ModifierBI.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using Tanshu.Accounts.DAOFactory; +using Tanshu.Data.DAO; +using Tanshu.Accounts.Contracts; + +namespace Tanshu.Accounts.BI +{ + public static class ModifierBI + { + public static void Insert(ModifierBO modifier) + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IModifierDAO dao = factory.GetModifierDAO(connection)) + { + dao.Insert(modifier); + } + } + } + //public void Update(ModifierBO modifier) + //{ + // GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + // using (IConnectionDAO connection = factory.Connection) + // { + // using (var dao = factory.GetModifierDAO(connection)) + // { + // dao.Update(modifier); + // } + // } + //} + public static void Delete(string modifierID) + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IModifierDAO dao = factory.GetModifierDAO(connection)) + { + dao.Delete(modifierID); + } + } + } + public static ModifierBO GetModifier(string modifierID) + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IModifierDAO dao = factory.GetModifierDAO(connection)) + { + return dao.GetModifier(modifierID); + } + } + } + public static List GetModifiers() + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IModifierDAO dao = factory.GetModifierDAO(connection)) + { + return dao.GetModifiers(); + } + } + } + } +} diff --git a/Tanshu.Accounts.BI/ProductBI.cs b/Tanshu.Accounts.BI/ProductBI.cs index 37a42d2..0b0b0c5 100644 --- a/Tanshu.Accounts.BI/ProductBI.cs +++ b/Tanshu.Accounts.BI/ProductBI.cs @@ -8,9 +8,9 @@ using Tanshu.Data.DAO; namespace Tanshu.Accounts.BI { - public class ProductBI : IProductBI + public static class ProductBI { - public bool Insert(ProductBO product) + public static bool Insert(ProductBO product) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -21,7 +21,7 @@ namespace Tanshu.Accounts.BI } } } - public bool Update(ProductBO product) + public static bool Update(ProductBO product) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -32,7 +32,7 @@ namespace Tanshu.Accounts.BI } } } - public bool Delete(Guid productID) + public static bool Delete(Guid productID) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -43,7 +43,7 @@ namespace Tanshu.Accounts.BI } } } - public ProductBO GetProductFromName(string nameAndUnits) + public static ProductBO GetProductFromName(string nameAndUnits) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -54,7 +54,7 @@ namespace Tanshu.Accounts.BI } } } - public ProductBO GetProduct(Guid productID) + public static ProductBO GetProduct(Guid productID) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -65,7 +65,7 @@ namespace Tanshu.Accounts.BI } } } - public decimal GetProductStock(DateTime date, Guid productID, Guid? voucherID) + public static decimal GetProductStock(DateTime date, Guid productID, Guid? voucherID) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -76,7 +76,7 @@ namespace Tanshu.Accounts.BI } } } - public List GetProducts() + public static List GetProducts() { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -88,7 +88,7 @@ namespace Tanshu.Accounts.BI } } - public List GetFilteredProducts(Dictionary filter) + public static List GetFilteredProducts(Dictionary filter) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -100,7 +100,7 @@ namespace Tanshu.Accounts.BI } } - public void UpdateShortName() + public static void UpdateShortName() { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) @@ -112,14 +112,14 @@ namespace Tanshu.Accounts.BI } } - public List GetUnFilteredProducts() + public static List GetUnFilteredProducts() { Dictionary filter = new Dictionary(); filter.Add("Name", ""); filter.Add("Type", ""); return GetFilteredProducts(filter); } - public List GetProducts(Guid productTypeID) + public static List GetProducts(Guid productTypeID) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) diff --git a/Tanshu.Accounts.BI/ProductTypeBI.cs b/Tanshu.Accounts.BI/ProductGroupBI.cs similarity index 58% rename from Tanshu.Accounts.BI/ProductTypeBI.cs rename to Tanshu.Accounts.BI/ProductGroupBI.cs index e13624d..c2126c5 100644 --- a/Tanshu.Accounts.BI/ProductTypeBI.cs +++ b/Tanshu.Accounts.BI/ProductGroupBI.cs @@ -8,60 +8,60 @@ using Tanshu.Data.DAO; namespace Tanshu.Accounts.BI { - public class ProductTypeBI : IProductTypeBI + public class ProductGroupBI : IProductGroupBI { - public ProductTypeBO GetProductType(Guid productTypeID) + public ProductGroupBO GetProductGroup(Guid productGroupID) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) { - using (var dao = factory.GetProductTypeDAO(connection)) + using (var dao = factory.GetProductGroupDAO(connection)) { - return dao.GetProductType(productTypeID); + return dao.GetProductGroup(productGroupID); } } } - public ProductTypeBO GetProductTypeByName(string name) + public ProductGroupBO GetProductGroupByName(string name) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) { - using (var dao = factory.GetProductTypeDAO(connection)) + using (var dao = factory.GetProductGroupDAO(connection)) { - return dao.GetProductType(name); + return dao.GetProductGroup(name); } } } - public bool Insert(ProductTypeBO productType) + public bool Insert(ProductGroupBO productGroup) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) { - using (var dao = factory.GetProductTypeDAO(connection)) + using (var dao = factory.GetProductGroupDAO(connection)) { - return dao.Insert(productType); + return dao.Insert(productGroup); } } } - public bool Update(ProductTypeBO productType) + public bool Update(ProductGroupBO productGroup) { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) { - using (var dao = factory.GetProductTypeDAO(connection)) + using (var dao = factory.GetProductGroupDAO(connection)) { - return dao.Update(productType); + return dao.Update(productGroup); } } } - public List GetProductTypes() + public List GetProductGroups() { GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); using (IConnectionDAO connection = factory.Connection) { - using (var dao = factory.GetProductTypeDAO(connection)) + using (var dao = factory.GetProductGroupDAO(connection)) { - return dao.GetProductTypes(); + return dao.GetProductGroups(); } } } diff --git a/Tanshu.Accounts.BI/ProductGroupModifierBI.cs b/Tanshu.Accounts.BI/ProductGroupModifierBI.cs new file mode 100644 index 0000000..8f3d695 --- /dev/null +++ b/Tanshu.Accounts.BI/ProductGroupModifierBI.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Tanshu.Accounts.Contracts; +using Tanshu.Accounts.DAOFactory; +using System.Data.SqlClient; +using Tanshu.Data.DAO; + +namespace Tanshu.Accounts.BI +{ + public static class ProductGroupModifierBI + { + public static bool Insert(ProductGroupModifierBO productGroupModifier) + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IProductGroupModifierDAO dao = factory.GetProductGroupModifierDAO(connection)) + { + return dao.Insert(productGroupModifier); + } + } + } + public static bool Update(ProductGroupModifierBO productGroupModifier) + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IProductGroupModifierDAO dao = factory.GetProductGroupModifierDAO(connection)) + { + return dao.Update(productGroupModifier); + } + } + } + public static bool Delete(int productGroupModifierID) + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IProductGroupModifierDAO dao = factory.GetProductGroupModifierDAO(connection)) + { + return dao.Delete(productGroupModifierID); + } + } + } + public static List GetProductGroupModifiers() + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IProductGroupModifierDAO dao = factory.GetProductGroupModifierDAO(connection)) + { + return dao.GetProductGroupModifiers(); + } + } + } + + public static List GetProductGroupModifiers(Guid productGroupID) + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IProductGroupModifierDAO dao = factory.GetProductGroupModifierDAO(connection)) + { + return dao.GetProductGroupModifiers(productGroupID); + } + } + } + public static bool HasCompulsoryModifier(Guid productGroupID) + { + GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType); + using (IConnectionDAO connection = factory.Connection) + { + using (IProductGroupModifierDAO dao = factory.GetProductGroupModifierDAO(connection)) + { + return dao.HasCompulsoryModifier(productGroupID); + } + } + } + } +} diff --git a/Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj b/Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj index cb24d68..0c68bb6 100644 --- a/Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj +++ b/Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj @@ -64,9 +64,11 @@ + + - + diff --git a/Tanshu.Accounts.Contracts/DAOFactory/ModifierDAO.cs b/Tanshu.Accounts.Contracts/DAOFactory/ModifierDAO.cs new file mode 100644 index 0000000..b4f382a --- /dev/null +++ b/Tanshu.Accounts.Contracts/DAOFactory/ModifierDAO.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using Tanshu.Accounts.Contracts; + +namespace Tanshu.Accounts.DAOFactory +{ + public interface IModifierDAO : IDisposable + { + void Insert(ModifierBO modifier); + //void Update(ModifierBO modifier); + void Delete(string modifierID); + ModifierBO GetModifier(string modifierID); + List GetModifiers(); + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/DAOFactory/ProductGroupDAO.cs b/Tanshu.Accounts.Contracts/DAOFactory/ProductGroupDAO.cs new file mode 100644 index 0000000..106f6fc --- /dev/null +++ b/Tanshu.Accounts.Contracts/DAOFactory/ProductGroupDAO.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Tanshu.Accounts.Contracts; + +namespace Tanshu.Accounts.DAOFactory +{ + public interface IProductGroupDAO : IDisposable + { + bool Insert(ProductGroupBO productType); + ProductGroupBO GetProductGroup(Guid productGroupID); + ProductGroupBO GetProductGroup(string name); + bool Delete(Guid productGroupID); + bool Update(ProductGroupBO productGroup); + List GetProductGroups(); + + } +} diff --git a/Tanshu.Accounts.Contracts/DAOFactory/ProductGroupModifierDAO.cs b/Tanshu.Accounts.Contracts/DAOFactory/ProductGroupModifierDAO.cs new file mode 100644 index 0000000..4b1cb96 --- /dev/null +++ b/Tanshu.Accounts.Contracts/DAOFactory/ProductGroupModifierDAO.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using Tanshu.Accounts.Contracts; + +namespace Tanshu.Accounts.DAOFactory +{ + public interface IProductGroupModifierDAO : IDisposable + { + bool Insert(ProductGroupModifierBO productGroupModifier); + bool Delete(int productGroupModifierID); + bool Update(ProductGroupModifierBO productGroupModifier); + List GetProductGroupModifiers(Guid productGroupID); + List GetProductGroupModifiers(); + bool HasCompulsoryModifier(Guid productGroupID); + } +} diff --git a/Tanshu.Accounts.Contracts/DAOFactory/ProductTypeDAO.cs b/Tanshu.Accounts.Contracts/DAOFactory/ProductTypeDAO.cs deleted file mode 100644 index 590a84e..0000000 --- a/Tanshu.Accounts.Contracts/DAOFactory/ProductTypeDAO.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using Tanshu.Accounts.Contracts; - -namespace Tanshu.Accounts.DAOFactory -{ - public interface IProductTypeDAO : IDisposable - { - bool Insert(ProductTypeBO productType); - ProductTypeBO GetProductType(Guid productTypeID); - ProductTypeBO GetProductType(string name); - bool Delete(Guid productTypeID); - bool Update(ProductTypeBO productType); - List GetProductTypes(); - - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ComplexProductBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ComplexProductBO.cs deleted file mode 100644 index 7f70ad2..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/ComplexProductBO.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Tanshu.Accounts.Contracts -{ - [DataContract] - public class ComplexProductBO - { - [DataMember] - public Guid ComplexProductID { get; set; } - [DataMember] - public Guid ProductID { get; set; } - [DataMember] - public int Code { get; set; } - [DataMember] - public string Name { get; set; } - [DataMember] - public string Units { get; set; } - [DataMember] - public decimal SalePrice { get; set; } - [DataMember] - public Guid SaleTaxID { get; set; } - [DataMember] - public decimal Quantity { get; set; } - [DataMember] - public byte[] timestamp { get; set; } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ModifierBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ModifierBO.cs new file mode 100644 index 0000000..7c6ea60 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/ModifierBO.cs @@ -0,0 +1,10 @@ +using System; +using System.Runtime.Serialization; + +namespace Tanshu.Accounts.Contracts +{ + public class ModifierBO + { + public string ModifierID { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs index da4163d..e378387 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs @@ -15,7 +15,7 @@ namespace Tanshu.Accounts.Contracts [DataMember] public string Units { get; set; } [DataMember] - public Guid ProductTypeID { get; set; } + public Guid ProductGroupID { get; set; } [DataMember] public Guid SaleLedgerID { get; set; } [DataMember] diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductDisplayBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductDisplayBO.cs index 330ae33..4f630e4 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductDisplayBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductDisplayBO.cs @@ -9,6 +9,6 @@ namespace Tanshu.Accounts.Contracts [DataMember] public decimal Price { get; set; } [DataMember] - public string Type { get; set; } + public string Group { get; set; } } } diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs new file mode 100644 index 0000000..de40ba3 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs @@ -0,0 +1,13 @@ +using System; +using System.Runtime.Serialization; + +namespace Tanshu.Accounts.Contracts +{ + public class ProductGroupBO + { + public Guid ProductGroupID { get; set; } + public string Name { get; set; } + public decimal DiscountLimit { get; set; } + public bool IsModifierCompulsory { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifierBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifierBO.cs new file mode 100644 index 0000000..7bc7c93 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifierBO.cs @@ -0,0 +1,13 @@ +using System; +using System.Runtime.Serialization; + +namespace Tanshu.Accounts.Contracts +{ + public class ProductGroupModifierBO + { + public virtual int ProductGroupModifierID { get; set; } + public virtual Guid? ProductGroupID { get; set; } + public virtual string ModifierID { get; set; } + public virtual bool ShowAutomatically { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductTypeBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductTypeBO.cs deleted file mode 100644 index 2a9252e..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductTypeBO.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Tanshu.Accounts.Contracts -{ - [DataContract] - public class ProductTypeBO - { - [DataMember] - public Guid ProductTypeID { get; set; } - [DataMember] - public string Name { get; set; } - [DataMember] - public decimal DiscountLimit { get; set; } - [DataMember] - public bool IsForSale { get; set; } - [DataMember] - public bool IsForPurchae { get; set; } - [DataMember] - public byte[] timestamp { get; set; } - } -} diff --git a/Tanshu.Accounts.Contracts/Service Contracts/ProductBI.cs b/Tanshu.Accounts.Contracts/Service Contracts/ProductBI.cs deleted file mode 100644 index a0b319f..0000000 --- a/Tanshu.Accounts.Contracts/Service Contracts/ProductBI.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ServiceModel; -using System.Data.SqlClient; - -namespace Tanshu.Accounts.Contracts -{ - public interface IProductBI - { - bool Insert(ProductBO product); - bool Update(ProductBO product); - bool Delete(Guid productID); - ProductBO GetProductFromName(string nameAndUnits); - ProductBO GetProduct(Guid productID); - decimal GetProductStock(DateTime date, Guid productID, Guid? voucherID); - List GetProducts(); - List GetFilteredProducts(Dictionary filter); - List GetProducts(Guid productTypeID); - } -} diff --git a/Tanshu.Accounts.Contracts/Service Contracts/ProductGroupBI.cs b/Tanshu.Accounts.Contracts/Service Contracts/ProductGroupBI.cs new file mode 100644 index 0000000..5ea2f35 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Service Contracts/ProductGroupBI.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.ServiceModel; + +using System.Data.SqlClient; + +namespace Tanshu.Accounts.Contracts +{ + public interface IProductGroupBI + { + ProductGroupBO GetProductGroup(Guid productGroupID); + ProductGroupBO GetProductGroupByName(string name); + bool Insert(ProductGroupBO productGroup); + bool Update(ProductGroupBO productGroup); + List GetProductGroups(); + } +} diff --git a/Tanshu.Accounts.Contracts/Service Contracts/ProductTypesBI.cs b/Tanshu.Accounts.Contracts/Service Contracts/ProductTypesBI.cs deleted file mode 100644 index 83aa989..0000000 --- a/Tanshu.Accounts.Contracts/Service Contracts/ProductTypesBI.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ServiceModel; - -using System.Data.SqlClient; - -namespace Tanshu.Accounts.Contracts -{ - public interface IProductTypeBI - { - ProductTypeBO GetProductType(Guid productTypeID); - - ProductTypeBO GetProductTypeByName(string name); - bool Insert(ProductTypeBO productType); - bool Update(ProductTypeBO productType); - List GetProductTypes(); - } -} diff --git a/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj b/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj index 6c3bd78..d1187c7 100644 --- a/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj +++ b/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj @@ -56,9 +56,11 @@ + + - + @@ -75,8 +77,9 @@ - + + @@ -104,7 +107,7 @@ - + @@ -116,13 +119,12 @@ - + - diff --git a/Tanshu.Accounts.DAOFactory/DAOFactory.cs b/Tanshu.Accounts.DAOFactory/DAOFactory.cs index 8158b3f..d01729c 100644 --- a/Tanshu.Accounts.DAOFactory/DAOFactory.cs +++ b/Tanshu.Accounts.DAOFactory/DAOFactory.cs @@ -24,10 +24,12 @@ namespace Tanshu.Accounts.DAOFactory public abstract ILedgerDAO GetLedgerDAO(IConnectionDAO connection); public abstract IManagementDAO GetManagementDAO(DateTime startDate, DateTime finishDate, IConnectionDAO connection); public abstract IMembershipDAO GetMembershipDAO(IConnectionDAO connection); + public abstract IModifierDAO GetModifierDAO(IConnectionDAO connection); public abstract IPaymentDAO GetPaymentDAO(IConnectionDAO connection); public abstract IPrintLocationDAO GetPrintLocationDAO(IConnectionDAO connection); public abstract IProductDAO GetProductDAO(IConnectionDAO connection); - public abstract IProductTypeDAO GetProductTypeDAO(IConnectionDAO connection); + public abstract IProductGroupDAO GetProductGroupDAO(IConnectionDAO connection); + public abstract IProductGroupModifierDAO GetProductGroupModifierDAO(IConnectionDAO connection); public abstract ISalesAnalysisDAO GetSalesAnalysisDAO(IConnectionDAO connection); public abstract ISaleVoucherDAO GetSaleVoucherDAO(IConnectionDAO connection); public abstract ISaleVoucherMixDAO GetSaleVoucherMixDAO(IConnectionDAO connection); diff --git a/Tanshu.Accounts.DAOFactory/SqlServerDAOFactory.cs b/Tanshu.Accounts.DAOFactory/SqlServerDAOFactory.cs index 12ce3c4..3a3a1b4 100644 --- a/Tanshu.Accounts.DAOFactory/SqlServerDAOFactory.cs +++ b/Tanshu.Accounts.DAOFactory/SqlServerDAOFactory.cs @@ -54,6 +54,11 @@ namespace Tanshu.Accounts.DAOFactory return new MembershipDAO(connection); } + public override IModifierDAO GetModifierDAO(IConnectionDAO connection) + { + return new ModifierDAO(connection); + } + public override IPaymentDAO GetPaymentDAO(IConnectionDAO connection) { return new PaymentDAO(connection); @@ -68,9 +73,14 @@ namespace Tanshu.Accounts.DAOFactory { return new ProductDAO(connection); } - public override IProductTypeDAO GetProductTypeDAO(IConnectionDAO connection) + public override IProductGroupDAO GetProductGroupDAO(IConnectionDAO connection) { - return new ProductTypeDAO(connection); + return new ProductGroupDAO(connection); + } + + public override IProductGroupModifierDAO GetProductGroupModifierDAO(IConnectionDAO connection) + { + return new ProductGroupModifierDAO(connection); } public override ISalesAnalysisDAO GetSalesAnalysisDAO(IConnectionDAO connection) diff --git a/Tanshu.Accounts.Helpers/ControlFactory.cs b/Tanshu.Accounts.Helpers/ControlFactory.cs index 613bc7e..ad674ff 100644 --- a/Tanshu.Accounts.Helpers/ControlFactory.cs +++ b/Tanshu.Accounts.Helpers/ControlFactory.cs @@ -40,7 +40,7 @@ namespace Tanshu.Accounts.Helpers } } - public static void GenerateButtons(ref Panel panel, ref List