User management fixed. Reports working now. Deployed
This commit is contained in:
17
Tanshu.Accounts.Contracts/Attributes/PermissionAttribute.cs
Normal file
17
Tanshu.Accounts.Contracts/Attributes/PermissionAttribute.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Tanshu.Accounts.Contracts
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)]
|
||||
public class PermissionAttribute : Attribute
|
||||
{
|
||||
public PermissionAttribute(RoleConstants role)
|
||||
{
|
||||
Role = role;
|
||||
}
|
||||
public RoleConstants Role { get; set; }
|
||||
}
|
||||
}
|
||||
@ -8,13 +8,9 @@ namespace Tanshu.Accounts.Contracts
|
||||
public class BillInventory
|
||||
{
|
||||
public int ProductID { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public decimal Price { get; set; }
|
||||
|
||||
public decimal Quantity { get; set; }
|
||||
|
||||
private decimal discount = 0;
|
||||
public decimal Discount
|
||||
{
|
||||
@ -88,10 +84,9 @@ namespace Tanshu.Accounts.Contracts
|
||||
{
|
||||
get
|
||||
{
|
||||
return Quantity - printed;
|
||||
return Quantity - Printed;
|
||||
}
|
||||
}
|
||||
|
||||
public bool isNew;
|
||||
|
||||
public string Display
|
||||
|
||||
@ -6,18 +6,14 @@ namespace Tanshu.Accounts.Contracts
|
||||
{
|
||||
public class SalesAnalysis
|
||||
{
|
||||
public virtual int TypeID { get; set; }
|
||||
public virtual string Section { get; set; }
|
||||
public virtual decimal Quantity { get; set; }
|
||||
public virtual decimal Gross { get; set; }
|
||||
public virtual decimal Net { get; set; }
|
||||
public virtual string GroupType { get; set; }
|
||||
public virtual decimal Amount { get; set; }
|
||||
}
|
||||
|
||||
public class SalesAnalysisDetail
|
||||
{
|
||||
public virtual string Section { get; set; }
|
||||
public virtual string Product { get; set; }
|
||||
public virtual decimal Quantity { get; set; }
|
||||
public virtual decimal Amount { get; set; }
|
||||
public virtual decimal Sale { get; set; }
|
||||
public virtual decimal NC { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,10 +11,10 @@ namespace Tanshu.Accounts.Entities.Auth
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Password { get; set; }
|
||||
public virtual bool LockedOut { get; set; }
|
||||
public virtual IList<Group> Groups { get; set; }
|
||||
public virtual IList<UserGroup> UserGroups { get; set; }
|
||||
public User()
|
||||
{
|
||||
Groups = new List<Group>();
|
||||
UserGroups = new List<UserGroup>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,78 +12,24 @@ namespace Tanshu.Accounts.Entities
|
||||
public virtual Voucher Voucher { get; set; }
|
||||
public virtual Product Product { get; set; }
|
||||
|
||||
private decimal quantity;
|
||||
public virtual decimal Quantity
|
||||
{
|
||||
get { return quantity; }
|
||||
set
|
||||
{
|
||||
quantity = value;
|
||||
if (amount != null)
|
||||
CalculateAmount();
|
||||
}
|
||||
}
|
||||
public virtual decimal Quantity { get; set; }
|
||||
|
||||
private decimal rate;
|
||||
public virtual decimal Rate
|
||||
{
|
||||
get { return rate; }
|
||||
set
|
||||
{
|
||||
rate = value;
|
||||
if (amount != null)
|
||||
CalculateAmount();
|
||||
}
|
||||
}
|
||||
public virtual decimal Rate { get; set; }
|
||||
|
||||
decimal tax;
|
||||
public virtual decimal Tax
|
||||
{
|
||||
get { return tax; }
|
||||
set
|
||||
{
|
||||
tax = value;
|
||||
if (amount != null)
|
||||
CalculateAmount();
|
||||
}
|
||||
}
|
||||
public virtual decimal Tax { get; set; }
|
||||
|
||||
decimal discount;
|
||||
public virtual decimal Discount
|
||||
{
|
||||
get { return discount; }
|
||||
set
|
||||
{
|
||||
discount = value;
|
||||
if (amount != null)
|
||||
CalculateAmount();
|
||||
}
|
||||
}
|
||||
public virtual decimal Discount { get; set; }
|
||||
|
||||
private decimal serviceCharge;
|
||||
public virtual decimal ServiceCharge
|
||||
{
|
||||
get { return serviceCharge; }
|
||||
set
|
||||
{
|
||||
discount = value;
|
||||
if (amount != null)
|
||||
CalculateAmount();
|
||||
}
|
||||
|
||||
}
|
||||
public virtual decimal ServiceCharge { get; set;}
|
||||
|
||||
[Cascade]
|
||||
public virtual IList<InventoryModifier> InventoryModifier { get; set; }
|
||||
|
||||
decimal? amount;
|
||||
public virtual decimal Amount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!amount.HasValue)
|
||||
CalculateAmount();
|
||||
return amount.Value;
|
||||
return Quantity * Rate * (1 + Tax) * (1 + ServiceCharge) * (1 - Discount);
|
||||
}
|
||||
set
|
||||
{ }
|
||||
@ -96,10 +42,6 @@ namespace Tanshu.Accounts.Entities
|
||||
// return quantity * rate * (1 + tax) * (1 + serviceCharge) * discount;
|
||||
// }
|
||||
//}
|
||||
protected void CalculateAmount()
|
||||
{
|
||||
amount = quantity * rate * (1 + tax) * (1 + serviceCharge) * (1 - discount);
|
||||
}
|
||||
public Inventory()
|
||||
{
|
||||
InventoryModifier = new List<InventoryModifier>();
|
||||
|
||||
@ -11,6 +11,7 @@ namespace Tanshu.Accounts.Entities
|
||||
public virtual string Name { get; set; }
|
||||
public virtual decimal DiscountLimit { get; set; }
|
||||
public virtual bool IsModifierCompulsory { get; set; }
|
||||
public virtual string GroupType { get; set; }
|
||||
public virtual IList<Product> Products { get; set; }
|
||||
public ProductGroup()
|
||||
{
|
||||
|
||||
@ -5,23 +5,44 @@ using System.Text;
|
||||
|
||||
namespace Tanshu.Accounts.Contracts
|
||||
{
|
||||
public static class RolesConstants
|
||||
public sealed class RoleConstants
|
||||
{
|
||||
public const string SALES_CHECKOUT = "Sales/Checkout";
|
||||
public const string SALES_SALES_BILL = "Sales/SalesBill";
|
||||
public const string SALES_SALE_DETAIL = "Sales/SaleDetail";
|
||||
public const string SALES_VOID_BILL = "Sales/VoidPrintedBill";
|
||||
public const string SALES_EDIT_BILL = "Sales/EditBill";
|
||||
public const string SALES_PRINT_KOT = "Sales/PrintKOT";
|
||||
public const string SALES_PRINT_BILL = "Sales/PrintBill";
|
||||
public const string SALES_CHANGE_RATE = "Sales/ChangeRate";
|
||||
public const string SALES_EDIT_PRINTED_PRODUCT = "Sales/EditPrintedProduct";
|
||||
private readonly string role;
|
||||
private RoleConstants(string role)
|
||||
{
|
||||
this.role = role;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return role;
|
||||
}
|
||||
public string Role
|
||||
{
|
||||
get { return role; }
|
||||
}
|
||||
public static RoleConstants ADJUST_ADVANCE = new RoleConstants("Sales/AdjustAdvance");
|
||||
public static RoleConstants RECEIVE_ADVANCE = new RoleConstants("Sales/ReceiveAdvance");
|
||||
public static RoleConstants CHANGE_RATE = new RoleConstants("Sales/ChangeRate");
|
||||
public static RoleConstants CASHIER_CHECKOUT = new RoleConstants("Sales/CashierCheckout");
|
||||
public static RoleConstants CUSTOMERS = new RoleConstants("Sales/Customers");
|
||||
public static RoleConstants DISCOUNT = new RoleConstants("Sales/Discount");
|
||||
public static RoleConstants EDIT_PRINTED_BILL = new RoleConstants("Sales/EditBill");
|
||||
public static RoleConstants EDIT_PRINTED_PRODUCT = new RoleConstants("Sales/EditPrintedProduct");
|
||||
public static RoleConstants PRINT_BILL = new RoleConstants("Sales/PrintBill");
|
||||
public static RoleConstants PRINT_KOT = new RoleConstants("Sales/PrintKOT");
|
||||
public static RoleConstants SALES = new RoleConstants("Sales/SalesBill");
|
||||
public static RoleConstants SALE_ANALYSIS = new RoleConstants("Sales/SaleAnalysis");
|
||||
public static RoleConstants SALE_DETAIL = new RoleConstants("Sales/SaleDetail");
|
||||
public static RoleConstants VOID_BILL = new RoleConstants("Sales/VoidPrintedBill");
|
||||
public static RoleConstants ZERO_RATE = new RoleConstants("Sales/ZeroRate");
|
||||
public static RoleConstants SETTLE_BILL = new RoleConstants("Sales/SettleBill");
|
||||
|
||||
public const string MASTER_PRODUCTS = "Master/Products";
|
||||
public static RoleConstants PRODUCTS = new RoleConstants("Master/Products");
|
||||
|
||||
public const string SECURITY_MANAGE_ROLES = "Security/ManageRoles";
|
||||
public const string LOG_VIEW = "Log/View";
|
||||
public const string MASTER_OWNER = "Master/Owner";
|
||||
public static RoleConstants SECURITY_MANAGE_USERS = new RoleConstants("Security/ManageUsers");
|
||||
public static RoleConstants SECURITY_MANAGE_ROLES = new RoleConstants("Security/ManageRoles");
|
||||
public static RoleConstants LOG_VIEW = new RoleConstants("Log/View");
|
||||
public static RoleConstants MASTER_OWNER = new RoleConstants("Master/Owner");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,10 +41,6 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Include\Fluent\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.DynamicProxy2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Include\Fluent\Castle.DynamicProxy2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FluentNHibernate, Version=1.1.0.685, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Include\Fluent\FluentNHibernate.dll</HintPath>
|
||||
@ -53,10 +49,6 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Include\Fluent\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Include\Fluent\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Include\Fluent\NHibernate.dll</HintPath>
|
||||
@ -86,6 +78,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Attributes\CascadeAttribute.cs" />
|
||||
<Compile Include="Attributes\PermissionAttribute.cs" />
|
||||
<Compile Include="Attributes\SecutiryAttribute.cs" />
|
||||
<Compile Include="Attributes\NotNullAttribute.cs" />
|
||||
<Compile Include="Data Contracts Display\BillItemKey.cs">
|
||||
|
||||
Reference in New Issue
Block a user