├── docs
└── readme.md
├── source
└── BizBook
│ ├── Server.Identity
│ ├── favicon.ico
│ ├── Global.asax
│ ├── Service References
│ │ └── Application Insights
│ │ │ └── ConnectedService.json
│ ├── App_Start
│ │ ├── FilterConfig.cs
│ │ ├── RouteConfig.cs
│ │ └── CacheConfig.cs
│ ├── Filters
│ │ ├── MessageHandler.cs
│ │ └── MultipleOperationsWithSameVerbFilter.cs
│ ├── Models
│ │ ├── SecurityHelperModels.cs
│ │ ├── IdentityRequestModels.cs
│ │ ├── ApplicationResourceViewModel.cs
│ │ ├── ApplicationPermissionViewModel.cs
│ │ ├── SecurityDbContext.cs
│ │ └── ApplicationUser.cs
│ ├── Migrations
│ │ ├── Configuration.cs
│ │ └── 201901181446153_Init.Designer.cs
│ ├── Global.asax.cs
│ ├── Providers
│ │ └── OAuthTokenProvider.cs
│ ├── Helper
│ │ ├── ApplicationInsightHelpers.cs
│ │ └── B2BSignalrEventHandlers.cs
│ ├── Results
│ │ └── ChallengeResult.cs
│ ├── Controllers
│ │ ├── QueryControllers
│ │ │ └── System
│ │ │ │ ├── ApplicationUserRoleQueryController.cs
│ │ │ │ └── ApplicationResourceQueryController.cs
│ │ └── ValuesController.cs
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Startup.cs
│ ├── Server.Inventory
│ ├── favicon.ico
│ ├── Global.asax
│ ├── Attributes
│ │ └── PermissionRequest.cs
│ ├── Models
│ │ ├── Location.cs
│ │ ├── ClientRequestModel.cs
│ │ └── ApplicationUser.cs
│ ├── App_Start
│ │ ├── FilterConfig.cs
│ │ ├── RouteConfig.cs
│ │ └── WebApiConfig.cs
│ ├── Helpers
│ │ └── ConnectionModel.cs
│ ├── Filters
│ │ └── MessageHandler.cs
│ ├── Handlers
│ │ └── CustomExceptionHandler.cs
│ ├── Controllers
│ │ ├── CommandControllers
│ │ │ ├── Message
│ │ │ │ ├── SmsController.cs
│ │ │ │ ├── SmsHookController.cs
│ │ │ │ ├── HookDetailController.cs
│ │ │ │ └── SmsHistoryController.cs
│ │ │ ├── Customers
│ │ │ │ ├── CustomerController.cs
│ │ │ │ ├── CustomerAddressController.cs
│ │ │ │ └── CustomerFeedbackController.cs
│ │ │ ├── Shops
│ │ │ │ ├── BrandController.cs
│ │ │ │ ├── CourierController.cs
│ │ │ │ ├── DealerController.cs
│ │ │ │ └── SupplierController.cs
│ │ │ ├── Warehouses
│ │ │ │ ├── DamageController.cs
│ │ │ │ ├── WarehouseController.cs
│ │ │ │ └── StockTransferController.cs
│ │ │ ├── Products
│ │ │ │ ├── ProductDetailController.cs
│ │ │ │ ├── ProductGroupController.cs
│ │ │ │ ├── ProductCategoryController.cs
│ │ │ │ └── SupplierProductController.cs
│ │ │ ├── Transactions
│ │ │ │ ├── WalletController.cs
│ │ │ │ ├── TransactionController.cs
│ │ │ │ └── AccountHeadController.cs
│ │ │ ├── Operation
│ │ │ │ └── OperationLogController.cs
│ │ │ └── Employees
│ │ │ │ └── EmployeeInfoController.cs
│ │ └── QueryControllers
│ │ │ ├── Message
│ │ │ ├── SmsQueryController.cs
│ │ │ ├── HookDetailQueryController.cs
│ │ │ └── SmsHistoryQueryController.cs
│ │ │ ├── Shops
│ │ │ ├── CourierQueryController.cs
│ │ │ ├── DealerQueryController.cs
│ │ │ └── BrandQueryController.cs
│ │ │ ├── Warehouses
│ │ │ ├── DamageQueryController.cs
│ │ │ └── StockTransferQueryController.cs
│ │ │ ├── Transactions
│ │ │ ├── WalletQueryController.cs
│ │ │ └── AccountHeadQueryController.cs
│ │ │ ├── Operation
│ │ │ ├── OperationLogQueryController.cs
│ │ │ └── OperationLogDetailQueryController.cs
│ │ │ ├── Sales
│ │ │ ├── InstallmentQueryController.cs
│ │ │ └── InstallmentDetailQueryController.cs
│ │ │ ├── Customers
│ │ │ └── CustomerFeedbackQueryController.cs
│ │ │ ├── Employees
│ │ │ └── EmployeeInfoQueryController.cs
│ │ │ ├── Products
│ │ │ ├── DealerProductQueryController.cs
│ │ │ ├── SupplierProductQueryController.cs
│ │ │ ├── ProductGroupQueryController.cs
│ │ │ └── ProductCategoryQueryController.cs
│ │ │ └── OtherQueryController.cs
│ ├── Providers
│ │ └── OAuthTokenProvider.cs
│ ├── Results
│ │ └── ChallengeResult.cs
│ ├── Startup.cs
│ ├── Web.Debug.config
│ ├── Global.asax.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
│ ├── Utility
│ ├── packages.config
│ ├── Extensions.cs
│ ├── App.config
│ └── Properties
│ │ └── AssemblyInfo.cs
│ ├── CommonLibrary
│ ├── Model
│ │ ├── BusinessConstants.cs
│ │ └── Entity.cs
│ ├── packages.config
│ ├── ViewModel
│ │ ├── IsViewable.cs
│ │ ├── DropdownViewModel.cs
│ │ └── BaseViewModel.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
│ ├── ReportModel
│ ├── packages.config
│ ├── Parameters
│ │ ├── ProductReportParameter.cs
│ │ ├── SaleReportParameter.cs
│ │ ├── ReportParameterBase.cs
│ │ └── TransactionReportParameter.cs
│ ├── BaseReport.cs
│ ├── App.config
│ └── Properties
│ │ └── AssemblyInfo.cs
│ ├── ViewModel
│ ├── packages.config
│ ├── Products
│ │ ├── ProductGroupReportModel.cs
│ │ ├── ProductCategoryReportModel.cs
│ │ ├── ProductDetailReportModel.cs
│ │ ├── ProductGroupViewModel.cs
│ │ ├── ProductCategoryViewModel.cs
│ │ ├── DealerProductViewModel.cs
│ │ └── SupplierProductViewModel.cs
│ ├── Sales
│ │ ├── IBaseReportViewModel.cs
│ │ ├── SalesDuesUpdateModel.cs
│ │ └── InstallmentDetailViewModel.cs
│ ├── Transactions
│ │ ├── AccountHeadReportModel.cs
│ │ ├── TransactionReportModel.cs
│ │ ├── AccountHeadViewModel.cs
│ │ └── WalletViewModel.cs
│ ├── Shops
│ │ ├── SupplierReportModel.cs
│ │ ├── BrandReportModel.cs
│ │ ├── CourierViewModel.cs
│ │ ├── SupplierViewModel.cs
│ │ ├── BrandViewModel.cs
│ │ └── DealerViewModel.cs
│ ├── Employees
│ │ ├── EmployeeReportModel.cs
│ │ └── EmployeeInfoViewModel.cs
│ ├── Customers
│ │ ├── CustomerReportModel.cs
│ │ ├── CustomerProductViewModel.cs
│ │ ├── CustomerFeedbackViewModel.cs
│ │ └── AddressViewModel.cs
│ ├── Warehouses
│ │ ├── WarehouseProductHistoryViewModel.cs
│ │ ├── WarehouseHistoryViewModel.cs
│ │ ├── WarehouseViewModel.cs
│ │ └── DamageViewModel.cs
│ ├── Purchases
│ │ └── PurchaseReportModel.cs
│ ├── ShopChildViewModel.cs
│ ├── Message
│ │ ├── SmsHistoryViewModel.cs
│ │ ├── SmsHookViewModel.cs
│ │ ├── HookDetailViewModel.cs
│ │ └── SmsViewModel.cs
│ ├── Reports
│ │ ├── BaseReportViewModel.cs
│ │ ├── AccountReportViewModel.cs
│ │ └── SaleReportGridModel.cs
│ ├── BaseViewModel.cs
│ ├── Operation
│ │ └── OperationLogViewModel.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
│ ├── Model
│ ├── packages.config
│ ├── Message
│ │ ├── SmsHistory.cs
│ │ ├── SmsHook.cs
│ │ ├── HookDetail.cs
│ │ └── Sms.cs
│ ├── Customers
│ │ ├── District.cs
│ │ ├── Zone.cs
│ │ ├── CustomerFeedback.cs
│ │ └── Address.cs
│ ├── ShopChild.cs
│ ├── Transactions
│ │ ├── AccountHead.cs
│ │ └── Wallet.cs
│ ├── Shops
│ │ ├── Courier.cs
│ │ └── Brand.cs
│ ├── Sales
│ │ ├── SaleState.cs
│ │ ├── Shipping.cs
│ │ ├── Billing.cs
│ │ ├── Installment.cs
│ │ └── InstallmentDetail.cs
│ ├── Products
│ │ ├── ProductGroup.cs
│ │ ├── ProductImage.cs
│ │ ├── ProductSerial.cs
│ │ ├── DealerProductTransaction.cs
│ │ ├── SupplierProductTransaction.cs
│ │ ├── ProductCategory.cs
│ │ ├── ProductVariation.cs
│ │ ├── DealerProduct.cs
│ │ ├── SupplierProduct.cs
│ │ └── WarehouseProduct.cs
│ ├── Operations
│ │ ├── OperationLog.cs
│ │ └── OperationLogDetail.cs
│ ├── Warehouses
│ │ ├── Damage.cs
│ │ ├── Warehouse.cs
│ │ └── StockTransferDetail.cs
│ ├── Employees
│ │ └── EmployeeInfo.cs
│ ├── Migrations
│ │ ├── 201901191332239_Init.Designer.cs
│ │ └── Configuration.cs
│ ├── Purchases
│ │ └── PurchaseDetail.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
│ ├── RequestModel
│ ├── Reports
│ │ ├── SalesByProductRequestModel.cs
│ │ ├── CustomerBySaleRequestModel.cs
│ │ ├── DailySalesOverviewRequestModel.cs
│ │ ├── BaseReportRequestModel.cs
│ │ └── SaleReportRequestModel.cs
│ ├── FilterCollection.cs
│ ├── packages.config
│ ├── PartnerRequestModel.cs
│ ├── Message
│ │ ├── MessageRequestModel.cs
│ │ ├── SmsHookRequestModel.cs
│ │ ├── SmsHistoryRequestModel.cs
│ │ ├── SmsRequestModel.cs
│ │ └── HookDetailRequestModel.cs
│ ├── Shops
│ │ ├── DealerRequestModel.cs
│ │ ├── CourierRequestModel.cs
│ │ ├── BrandRequestModel.cs
│ │ ├── SupplierRequestModel.cs
│ │ └── ShopRequestModel.cs
│ ├── Transactions
│ │ ├── AccountHeadRequestModel.cs
│ │ └── WalletRequestModel.cs
│ ├── Warehouses
│ │ ├── WarehouseHistoryRequestModel.cs
│ │ └── WarehouseRequestModel.cs
│ ├── Products
│ │ ├── ProductSerialRequestModel.cs
│ │ └── ProductGroupRequestModel.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Sales
│ │ └── InstallmentDetailRequestModel.cs
│ ├── ServiceLibrary
│ ├── Products
│ │ └── ProductCategoryService.cs
│ ├── Sales
│ │ └── SaleDetailService.cs
│ ├── packages.config
│ ├── Shops
│ │ └── ShopService.cs
│ ├── Reports
│ │ ├── IReportService.cs
│ │ ├── BaseReportService.cs
│ │ └── SchedulerService.cs
│ ├── Subscription
│ │ ├── MD5Hash.cs
│ │ └── HardwareInfo.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
│ └── LoggingService
│ ├── packages.config
│ └── Properties
│ └── AssemblyInfo.cs
└── scripts
└── sql
├── 001_Permission_Seed_Data_Insert.sql
└── 002_SuperAdmin_Data_Insert.sql
/docs/readme.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foyzulkarim/bizbook-server/HEAD/source/BizBook/Server.Identity/favicon.ico
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foyzulkarim/bizbook-server/HEAD/source/BizBook/Server.Inventory/favicon.ico
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Server.Identity.WebApiApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/scripts/sql/001_Permission_Seed_Data_Insert.sql:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foyzulkarim/bizbook-server/HEAD/scripts/sql/001_Permission_Seed_Data_Insert.sql
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Server.Inventory.WebApiApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/source/BizBook/Utility/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/source/BizBook/CommonLibrary/Model/BusinessConstants.cs:
--------------------------------------------------------------------------------
1 | namespace CommonLibrary.Model
2 | {
3 | public enum CustomerType
4 | {
5 | Registered, Unregistered
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/source/BizBook/CommonLibrary/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/source/BizBook/ReportModel/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Products/ProductGroupReportModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Products
2 | {
3 | public class ProductGroupReportModel
4 | {
5 | public string Name { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Attributes/PermissionRequest.cs:
--------------------------------------------------------------------------------
1 | namespace Server.Inventory.Attributes
2 | {
3 | public class PermissionRequest
4 | {
5 | public string Name { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Products/ProductCategoryReportModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Products
2 | {
3 | public class ProductCategoryReportModel
4 | {
5 | public string Name { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Sales/IBaseReportViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Sales
2 | {
3 | public interface IBaseReportViewModel
4 | {
5 | string DateRange { get; set; }
6 | int EntryFound { get; set; }
7 | }
8 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Transactions/AccountHeadReportModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Transactions
2 | {
3 | public class AccountHeadReportModel
4 | {
5 | public string AccountType { get; set; }
6 | public string Name { get; set; }
7 | }
8 | }
--------------------------------------------------------------------------------
/source/BizBook/CommonLibrary/ViewModel/IsViewable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace CommonLibrary.ViewModel
4 | {
5 | [AttributeUsage(AttributeTargets.Property)]
6 | public class IsViewable: Attribute
7 | {
8 | public bool Value { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Shops/SupplierReportModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Shops
2 | {
3 | public class SupplierReportModel
4 | {
5 | public string Name { get; set; }
6 | public string Address { get; set; }
7 | public string Phone { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Employees/EmployeeReportModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Employees
2 | {
3 | public class EmployeeReportModel
4 | {
5 | public string Name { get; set; }
6 | public string Email { get; set; }
7 | public string Phone { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Message/SmsHistory.cs:
--------------------------------------------------------------------------------
1 | namespace Model.Message
2 | {
3 | public class SmsHistory : ShopChild
4 | {
5 | public double Amount { get; set; }
6 |
7 | public string SmsId { get; set; }
8 |
9 | public string Text { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Customers/CustomerReportModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Customers
2 | {
3 | public class CustomerReportModel
4 | {
5 | public string Name { get; set; }
6 | public string District { get; set; }
7 | public string Phone { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Products/ProductDetailReportModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Products
2 | {
3 | public class ProductDetailReportModel
4 | {
5 | public string Name { get; set; }
6 | public double Price { get; set; }
7 | public int OnHand { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/source/BizBook/CommonLibrary/ViewModel/DropdownViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommonLibrary.ViewModel
2 | {
3 | public class DropdownViewModel
4 | {
5 | public string Id { get; set; }
6 | public string Text { get; set; }
7 |
8 | public object Data { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Service References/Application Insights/ConnectedService.json:
--------------------------------------------------------------------------------
1 | {
2 | "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider",
3 | "Version": "8.6.404.2",
4 | "GettingStartedDocument": {
5 | "Uri": "https://go.microsoft.com/fwlink/?LinkID=613413"
6 | }
7 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Models/Location.cs:
--------------------------------------------------------------------------------
1 | namespace Server.Inventory.Models
2 | {
3 | public class Location
4 | {
5 | public string District { get; set; }
6 | public string Thana { get; set; }
7 | public string SubOffice { get; set; }
8 | public string Postcode { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Warehouses/WarehouseProductHistoryViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Warehouses
2 | {
3 | public class WarehouseProductHistoryViewModel
4 | {
5 | public string ProductName { get; set; }
6 | public double SaleQuantity { get; set; }
7 | public double PurchaseQuantity { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/App_Start/FilterConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 |
3 | namespace Server.Inventory
4 | {
5 | public class FilterConfig
6 | {
7 | public static void RegisterGlobalFilters(GlobalFilterCollection filters)
8 | {
9 | filters.Add(new HandleErrorAttribute());
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/App_Start/FilterConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 |
3 | namespace Server.Identity
4 | {
5 | public class FilterConfig
6 | {
7 | public static void RegisterGlobalFilters(GlobalFilterCollection filters)
8 | {
9 | //filters.Add(new AiHandleErrorAttribute());
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Shops/BrandReportModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ViewModel.Shops
4 | {
5 | public class BrandReportModel
6 | {
7 | public string Name { get; set; }
8 | public string Address { get; set; }
9 | public string Phone { get; set; }
10 | public DateTime Modified { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/App_Start/RouteConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 | using System.Web.Routing;
3 |
4 | namespace Server.Inventory
5 | {
6 | public class RouteConfig
7 | {
8 | public static void RegisterRoutes(RouteCollection routes)
9 | {
10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/source/BizBook/Model/Customers/District.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CommonLibrary.Model;
3 |
4 | namespace Model.Customers
5 | {
6 | public class District : Entity
7 | {
8 | public string Name { get; set; }
9 |
10 | public string Name_Bn { get; set; }
11 |
12 | public virtual ICollection Zones { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Customers/Zone.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations.Schema;
2 | using CommonLibrary.Model;
3 |
4 | namespace Model.Customers
5 | {
6 | public class Zone : Entity
7 | {
8 | public string Name { get; set; }
9 |
10 | public string DistrictId { get; set; }
11 |
12 | [ForeignKey("DistrictId")] public virtual District District { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Purchases/PurchaseReportModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ViewModel.Purchases
4 | {
5 | public class PurchaseReportModel
6 | {
7 | public string Memo { get; set; }
8 | public string Supplier { get; set; }
9 | public DateTime Date { get; set; }
10 | public double Total { get; set; }
11 | public string ModifiedBy { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/ShopChild.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 | using CommonLibrary.Model;
4 | using Model.Shops;
5 |
6 | namespace Model
7 | {
8 | public abstract class ShopChild : Entity
9 | {
10 | [Required] public string ShopId { get; set; }
11 | [ForeignKey("ShopId")] public virtual Shop Shop { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Transactions/AccountHead.cs:
--------------------------------------------------------------------------------
1 | namespace Model.Transactions
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 | using System.ComponentModel.DataAnnotations.Schema;
5 |
6 | public class AccountHead : ShopChild
7 | {
8 | [Index] [Required] [MaxLength(50)] public string Name { get; set; }
9 |
10 | [Index] [Required] public AccountHeadType AccountHeadType { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Helpers/ConnectionModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Server.Inventory.Helpers
4 | {
5 | public class ConnectionModel
6 | {
7 | public string ConnectionId { get; set; }
8 | public string UserId { get; set; }
9 | public string UserName { get; set; }
10 | public string ShopId { get; set; }
11 | public DateTime SessionStarted { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/ShopChildViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.ViewModel;
2 | using Model;
3 |
4 | namespace ViewModel
5 | {
6 | public abstract class ShopChildViewModel : BaseViewModel where T : ShopChild
7 | {
8 | public string ShopId { get; set; }
9 |
10 | protected ShopChildViewModel(ShopChild x) : base(x)
11 | {
12 | this.ShopId = x.ShopId;
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/source/BizBook/RequestModel/Reports/SalesByProductRequestModel.cs:
--------------------------------------------------------------------------------
1 | namespace RequestModel.Reports
2 | {
3 | using System;
4 |
5 | public class SalesByProductRequestModel
6 | {
7 | public string ShopId { get; set; }
8 |
9 | public DateTime StartDate { get; set; }
10 |
11 | public DateTime EndDate { get; set; }
12 | public string Keyword { get; set; }
13 |
14 | public string WarehouseId { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Message/SmsHook.cs:
--------------------------------------------------------------------------------
1 | namespace Model.Message
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | public class SmsHook : ShopChild
6 | {
7 | [Required] public BizSmsHook BizSmsHook { get; set; }
8 |
9 | [Required] [MaxLength(100)] public string Name { get; set; }
10 |
11 | [MaxLength(100)] public string Description { get; set; }
12 |
13 | [Required] public bool IsEnabled { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Transactions/TransactionReportModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Transactions
2 | {
3 | using System;
4 |
5 | public class TransactionReportModel
6 | {
7 | public string Type { get; set; }
8 | public string Order { get; set; }
9 | public double Amount { get; set; }
10 | public DateTime Date { get; set; }
11 | public string Person { get; set; }
12 | public string Service { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Shops/Courier.cs:
--------------------------------------------------------------------------------
1 | namespace Model.Shops
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 | using System.ComponentModel.DataAnnotations.Schema;
5 |
6 | public class Courier : ShopChild
7 | {
8 | [MaxLength(50)] public string ContactPersonName { get; set; }
9 |
10 | [Required] public string CourierShopId { get; set; }
11 |
12 | [ForeignKey("CourierShopId")] public virtual Shop CourierShop { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/source/BizBook/ReportModel/Parameters/ProductReportParameter.cs:
--------------------------------------------------------------------------------
1 | namespace ReportModel.Parameters
2 | {
3 | using System;
4 |
5 | public class ProductReportParameter : ReportParameterBase
6 | {
7 | public ProductReportParameter(DateTime date, string value, string shopId) : base(date, value, shopId)
8 | {
9 | }
10 |
11 | public string ProductDetailId { get; set; }
12 |
13 | public double StartingQuantity { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Warehouses/WarehouseHistoryViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ViewModel.Warehouses
4 | {
5 | public class WarehouseHistoryViewModel
6 | {
7 | public string Id { get; set; }
8 | public string OrderNumber { get; set; }
9 |
10 | public string Type { get; set; }
11 |
12 | public string ProductName { get; set; }
13 |
14 | public double Quantity { get; set; }
15 |
16 | public DateTime Date { get; set; }
17 | }
18 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Message/SmsHistoryViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.ViewModel;
2 | using Model.Message;
3 |
4 | namespace ViewModel.Message
5 | {
6 | public class SmsHistoryViewModel : BaseViewModel
7 | {
8 | public SmsHistoryViewModel(SmsHistory x) : base(x)
9 | {
10 | Amount = x.Amount;
11 | Text = x.Text;
12 | }
13 |
14 | public double Amount { get; set; }
15 |
16 | public string Text { get; set; }
17 | }
18 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Sales/SaleState.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Model.Sales
5 | {
6 | public class SaleState : ShopChild
7 | {
8 | [Index] [Required] [MaxLength(50)] public string State { get; set; }
9 |
10 | public string Remarks { get; set; }
11 |
12 | [Required] public string SaleId { get; set; }
13 |
14 | [ForeignKey("SaleId")] public virtual Sale Sale { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Filters/MessageHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Server.Identity.Filters
6 | {
7 | public class MessageHandler : DelegatingHandler
8 | {
9 | protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
10 | {
11 | var r = request;
12 | return base.SendAsync(request, cancellationToken);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Filters/MessageHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Server.Inventory.Filters
6 | {
7 | public class MessageHandler : DelegatingHandler
8 | {
9 | protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
10 | {
11 | var r = request;
12 | return base.SendAsync(request, cancellationToken);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Models/SecurityHelperModels.cs:
--------------------------------------------------------------------------------
1 | namespace Server.Identity.Models
2 | {
3 | public class PermissionRequest
4 | {
5 | public string Name { get; set; }
6 | }
7 |
8 | public class ResourcePermissionViewModel
9 | {
10 | public string Id { get; set; }
11 | public string ApplicationResourceId { get; set; }
12 | public string RoleId { get; set; }
13 | public bool IsAllowed { get; set; }
14 | public string Name { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/source/BizBook/RequestModel/Reports/CustomerBySaleRequestModel.cs:
--------------------------------------------------------------------------------
1 | namespace RequestModel.Reports
2 | {
3 | using System;
4 |
5 | public class CustomerBySaleRequestModel
6 | {
7 | public DateTime StartDate { get; set; }
8 |
9 | public DateTime EndDate { get; set; }
10 |
11 | public string ShopId { get; set; }
12 |
13 | public double MinimumAmountSpend { get; set; }
14 |
15 | public string Keyword { get; set; }
16 |
17 | public string WarehouseId { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Migrations/Configuration.cs:
--------------------------------------------------------------------------------
1 | using System.Data.Entity.Migrations;
2 | using Server.Identity.Models;
3 |
4 | namespace Server.Identity.Migrations
5 | {
6 | internal sealed class Configuration : DbMigrationsConfiguration
7 | {
8 | public Configuration()
9 | {
10 | AutomaticMigrationsEnabled = false;
11 | }
12 |
13 | protected override void Seed(SecurityDbContext context)
14 | {
15 |
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Handlers/CustomExceptionHandler.cs:
--------------------------------------------------------------------------------
1 | namespace Server.Inventory.Handlers
2 | {
3 | using System.Web.Http.ExceptionHandling;
4 |
5 | //https://stackoverflow.com/questions/16028919/catch-all-unhandled-exceptions-in-asp-net-web-api
6 | public class CustomExceptionHandler : ExceptionLogger
7 | {
8 | public override void Log(ExceptionLoggerContext context)
9 | {
10 | Serilog.Log.Logger.Error(context.Exception, "Unhandled exception occurred");
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Products/ProductGroup.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace Model.Products
6 | {
7 | public class ProductGroup : ShopChild
8 | {
9 | [Index]
10 | [Required]
11 | [MaxLength(50)]
12 | [DataType(DataType.Text)]
13 | public string Name { get; set; }
14 |
15 | public virtual ICollection ProductCategories { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/source/BizBook/ReportModel/Parameters/SaleReportParameter.cs:
--------------------------------------------------------------------------------
1 | namespace ReportModel.Parameters
2 | {
3 | using System;
4 |
5 | public class SaleReportParameter : ReportParameterBase
6 | {
7 | public SaleReportParameter(DateTime date, string value, string shopId) : base(date, value, shopId)
8 | {
9 | }
10 |
11 | public SaleType SaleType { get; set; }
12 | }
13 |
14 | public enum SaleType
15 | {
16 | All = 0,
17 | DealerSale = 1,
18 | CustomerSale = 2
19 | }
20 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Models/IdentityRequestModels.cs:
--------------------------------------------------------------------------------
1 | namespace Server.Identity.Models
2 | {
3 | public class EmployeeRequestModel
4 | {
5 | public string OrderBy { get; set; }
6 | public string IsAscending { get; set; }
7 | public string Id { get; set; }
8 | public string Keyword { get; set; }
9 | public string ShopId { get; set; }
10 | public string RoleId { get; set; }
11 | public string Role { get; set; }
12 | public int Page { get; set; }
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Transactions/AccountHeadViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Transactions
2 | {
3 | using Model.Transactions;
4 |
5 | public class AccountHeadViewModel : ShopChildViewModel
6 | {
7 | public AccountHeadViewModel(AccountHead x) : base(x)
8 | {
9 | Name = x.Name;
10 | this.AccountHeadType = x.AccountHeadType.ToString();
11 | }
12 |
13 | public string AccountHeadType { get; set; }
14 |
15 | public string Name { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/source/BizBook/RequestModel/Reports/DailySalesOverviewRequestModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Model;
3 |
4 | namespace RequestModel.Reports
5 | {
6 | public class DailySalesOverviewRequestModel
7 | {
8 | public DateTime StartDate { get; set; }
9 |
10 | public DateTime EndDate { get; set; }
11 |
12 | public string ShopId { get; set; }
13 |
14 | public string WarehouseId { get; set; }
15 |
16 | public string Keyword { get; set; }
17 |
18 | public SaleFrom SaleFrom { get; set; }
19 | }
20 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Sales/Shipping.cs:
--------------------------------------------------------------------------------
1 | namespace Model.Sales
2 | {
3 | public class Shipping
4 | {
5 | public string FirstName { get; set; }
6 | public string LastName { get; set; }
7 | public string Company { get; set; }
8 | public string Address1 { get; set; }
9 | public string Address2 { get; set; }
10 | public string City { get; set; }
11 | public string State { get; set; }
12 | public string PostCode { get; set; }
13 | public string Country { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/source/BizBook/ReportModel/Parameters/ReportParameterBase.cs:
--------------------------------------------------------------------------------
1 | namespace ReportModel.Parameters
2 | {
3 | using System;
4 |
5 | public class ReportParameterBase
6 | {
7 | public ReportParameterBase(DateTime date, string value, string shopId)
8 | {
9 | this.Date = date;
10 | this.Value = value;
11 | this.ReportShopId = shopId;
12 | }
13 |
14 | public DateTime Date { get; }
15 | public string Value { get; }
16 | public string ReportShopId { get; }
17 | }
18 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Message/HookDetail.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Model.Message
5 | {
6 | public class HookDetail : ShopChild
7 | {
8 | [Required] [Index] public string SmsHookId { get; set; }
9 |
10 | [ForeignKey("SmsHookId")] public virtual SmsHook SmsHook { get; set; }
11 |
12 | [Index] [Required] [MaxLength(200)] public string HookName { get; set; }
13 |
14 | [Required] public bool IsEnabled { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Operations/OperationLog.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Model.Operations
4 | {
5 | public class OperationLog : ShopChild
6 | {
7 | public OperationType OperationType { get; set; }
8 | public ModelName ModelName { get; set; }
9 | public string ObjectId { get; set; }
10 | public string ObjectIdentifier { get; set; }
11 | public string Remarks { get; set; }
12 | public virtual ICollection OperationLogDetails { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Sales/SalesDuesUpdateModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Sales
2 | {
3 | using System.Collections.Generic;
4 | using Model.Transactions;
5 |
6 | public class SalesDuesUpdateModel
7 | {
8 | public string ShopId { get; set; }
9 |
10 | public Transaction Transaction { get; set; }
11 |
12 | public List Sales { get; set; }
13 | }
14 |
15 | public class SaleDue
16 | {
17 | public string Id { get; set; }
18 |
19 | public double NewlyPaid { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Products/ProductGroupViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.ViewModel;
2 | using Model.Products;
3 |
4 | namespace ViewModel.Products
5 | {
6 | public class ProductGroupViewModel : BaseViewModel
7 | {
8 | public ProductGroupViewModel(ProductGroup x) : base(x)
9 | {
10 | Id = x.Id;
11 | Name = x.Name;
12 | ShopId = x.ShopId;
13 | }
14 |
15 | public string ShopId { get; set; }
16 |
17 | [IsViewable] public string Name { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Transactions/Wallet.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Model.Transactions
5 | {
6 | public class Wallet : ShopChild
7 | {
8 | [Index] [Required] [MaxLength(50)] public string AccountTitle { get; set; }
9 |
10 |
11 | [MaxLength(100)] public string AccountNumber { get; set; }
12 |
13 | [MaxLength(50)] public string BankName { get; set; }
14 |
15 | [Index] [Required] public WalletType WalletType { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Warehouses/Damage.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations.Schema;
2 | using Model.Products;
3 |
4 | namespace Model.Warehouses
5 | {
6 | public class Damage : ShopChild
7 | {
8 | public string WarehouseId { get; set; }
9 | [ForeignKey("WarehouseId")] public virtual Warehouse Warehouse { get; set; }
10 | public string ProductDetailId { get; set; }
11 |
12 | [ForeignKey("ProductDetailId")] public virtual ProductDetail ProductDetail { get; set; }
13 | public double Quantity { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Models/ApplicationResourceViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Server.Identity.Models
2 | {
3 | public class ApplicationResourceViewModel
4 | {
5 | public string ApplicationResourceId { get; set; }
6 | public string ApplicationResourceName { get; set; }
7 |
8 | public ApplicationResourceViewModel(string applicationResourceId, string applicationResourceName)
9 | {
10 | ApplicationResourceId = applicationResourceId;
11 | ApplicationResourceName = applicationResourceName;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/source/BizBook/ServiceLibrary/Products/ProductCategoryService.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.Repository;
2 | using CommonLibrary.Service;
3 | using Model.Products;
4 | using RequestModel.Products;
5 | using ViewModel.Products;
6 |
7 | namespace ServiceLibrary.Products
8 | {
9 |
10 | public class ProductCategoryService : BaseService
11 | {
12 | public ProductCategoryService(BaseRepository repository) : base(repository)
13 | {
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Message/SmsHookViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.ViewModel;
2 | using Model.Message;
3 |
4 | namespace ViewModel.Message
5 | {
6 | public class SmsHookViewModel : BaseViewModel
7 | {
8 | public SmsHookViewModel(SmsHook x) : base(x)
9 | {
10 | Name = x.Name;
11 | IsEnabled = x.IsEnabled;
12 | ShopId = x.ShopId;
13 | }
14 |
15 | public string ShopId { get; set; }
16 | public string Name { get; set; }
17 | public bool IsEnabled { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/RequestModel/Reports/BaseReportRequestModel.cs:
--------------------------------------------------------------------------------
1 | namespace RequestModel.Reports
2 | {
3 | using CommonLibrary.Model;
4 | using CommonLibrary.RequestModel;
5 | using Model;
6 |
7 | public abstract class BaseReportRequestModel : RequestModel where T : Entity
8 | {
9 | public ReportTimeType ReportTimeType { get; set; }
10 |
11 | protected BaseReportRequestModel(string keyword, string orderBy = "Modified", string isAscending = "False") :
12 | base(keyword, orderBy, isAscending)
13 | {
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/source/BizBook/RequestModel/FilterCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Linq.Expressions;
4 |
5 | namespace RequestModel
6 | {
7 | public static class FilterCollection
8 | {
9 | public static IQueryable FilterBy(this IQueryable queryable, string id, Expression> predicate)
10 | {
11 | if (!string.IsNullOrWhiteSpace(id) && id != new Guid().ToString())
12 | {
13 | queryable = queryable.Where(predicate);
14 | }
15 | return queryable;
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/source/BizBook/LoggingService/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/App_Start/RouteConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 | using System.Web.Routing;
3 |
4 | namespace Server.Identity
5 | {
6 | public class RouteConfig
7 | {
8 | public static void RegisterRoutes(RouteCollection routes)
9 | {
10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
11 |
12 | //routes.MapRoute(
13 | // name: "Default",
14 | // url: "{controller}/{action}/{id}",
15 | // defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
16 | //);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Model/Sales/Billing.cs:
--------------------------------------------------------------------------------
1 | namespace Model.Sales
2 | {
3 | public class Billing
4 | {
5 | public string FirstName { get; set; }
6 | public string LastName { get; set; }
7 | public string Company { get; set; }
8 | public string Address1 { get; set; }
9 | public string Address2 { get; set; }
10 | public string City { get; set; }
11 | public string State { get; set; }
12 | public string PostCode { get; set; }
13 | public string Country { get; set; }
14 | public string Email { get; set; }
15 | public string Phone { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/source/BizBook/ReportModel/BaseReport.cs:
--------------------------------------------------------------------------------
1 | namespace ReportModel
2 | {
3 | using System;
4 | using System.ComponentModel.DataAnnotations;
5 | using System.ComponentModel.DataAnnotations.Schema;
6 | using CommonLibrary.Model;
7 |
8 | public class BaseReport : Entity
9 | {
10 | [Index] [Required] [MaxLength(50)] public string Value { get; set; }
11 |
12 | [Index]
13 | [Required]
14 | [DataType(DataType.DateTime)]
15 | public DateTime Date { get; set; }
16 |
17 | [Index] [Required] public int RowsCount { get; set; }
18 |
19 | [Index] [Required] [MaxLength(128)] public string ShopId { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/source/BizBook/RequestModel/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Message/SmsController.cs:
--------------------------------------------------------------------------------
1 | using Model.Message;
2 | using RequestModel.Message;
3 | using System.Web.Http;
4 | using ViewModel.Message;
5 | using CommonLibrary.Repository;
6 | using CommonLibrary.Service;
7 | using Model;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Message
10 | {
11 | [RoutePrefix("api/Sms")]
12 | public class SmsController : BaseCommandController
13 | {
14 | public SmsController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Customers/CustomerController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using Model;
4 | using Model.Customers;
5 | using RequestModel.Customers;
6 | using ServiceLibrary.Customers;
7 | using ViewModel.Customers;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Customers
10 | {
11 | [RoutePrefix("api/Customer")]
12 | public class CustomerController : BaseCommandController
13 | {
14 | public CustomerController() : base(new CustomerService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/ServiceLibrary/Sales/SaleDetailService.cs:
--------------------------------------------------------------------------------
1 |
2 | using Vm = ViewModel.Sales.SaleDetailViewModel;
3 | using Rm = RequestModel.Sales.SaleDetailRequestModel;
4 | using Repo = CommonLibrary.Repository.BaseRepository;
5 | using M = Model.Sales.SaleDetail;
6 | using CommonLibrary.Service;
7 |
8 | namespace ServiceLibrary.Sales
9 | {
10 | public class SaleDetailService : BaseService
11 | {
12 | public SaleDetailService(Repo repository) : base(repository)
13 | {
14 | //customerRepo = new BaseRepository(base.Repository.Db);
15 | //customerService = new CustomerService(customerRepo);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Model/Products/ProductImage.cs:
--------------------------------------------------------------------------------
1 | namespace Model.Products
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 | using System.ComponentModel.DataAnnotations.Schema;
5 |
6 | public class ProductImage : ShopChild
7 | {
8 | public int WcId { get; set; }
9 |
10 | [Required] [MaxLength(500)] public string Src { get; set; }
11 | [MaxLength(50)] public string Name { get; set; }
12 | [MaxLength(50)] public string Alt { get; set; }
13 | public int? Position { get; set; }
14 |
15 |
16 | [Required] public string ProductDetailId { get; set; }
17 | [ForeignKey("ProductDetailId")] public ProductDetail ProductDetail { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Products/ProductSerial.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 | using Model.Purchases;
4 |
5 | namespace Model.Products
6 | {
7 | public class ProductSerial : ShopChild
8 | {
9 | [Index] [Required] [MaxLength(50)] public string SerialNumber { get; set; }
10 |
11 | [Required] public string ProductDetailId { get; set; }
12 |
13 | [ForeignKey("ProductDetailId")] public virtual ProductDetail ProductDetail { get; set; }
14 |
15 | public string PurchaseDetailId { get; set; }
16 |
17 | [ForeignKey("PurchaseDetailId")] public virtual PurchaseDetail PurchaseDetail { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Products/DealerProductTransaction.cs:
--------------------------------------------------------------------------------
1 | namespace Model.Products
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 | using System.ComponentModel.DataAnnotations.Schema;
5 | using Model.Transactions;
6 |
7 | public class DealerProductTransaction : ShopChild
8 | {
9 | [Required] public double Amount { get; set; }
10 |
11 | [Required] public string TransactionId { get; set; }
12 |
13 | [ForeignKey("TransactionId")] public virtual Transaction Transaction { get; set; }
14 |
15 | [Required] public string DealerProductId { get; set; }
16 |
17 | [ForeignKey("DealerProductId")] public virtual DealerProduct DealerProduct { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Products/SupplierProductTransaction.cs:
--------------------------------------------------------------------------------
1 | using Model.Transactions;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace Model.Products
6 | {
7 | public class SupplierProductTransaction : ShopChild
8 | {
9 | [Required] public double Amount { get; set; }
10 |
11 | [Required] public string TransactionId { get; set; }
12 |
13 | [ForeignKey("TransactionId")] public virtual Transaction Transaction { get; set; }
14 |
15 | [Required] public string SupplierProductId { get; set; }
16 |
17 | [ForeignKey("SupplierProductId")] public virtual SupplierProduct SupplierProduct { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Shops/BrandController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Shops;
6 | using RequestModel.Shops;
7 | using ViewModel.Shops;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Shops
10 | {
11 | [RoutePrefix("api/Brand")]
12 | public class BrandController : BaseCommandController
13 | {
14 | public BrandController(): base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Shops/CourierController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Shops;
6 | using RequestModel.Shops;
7 | using ViewModel.Shops;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Shops
10 | {
11 | [RoutePrefix("api/Courier")]
12 | public class CourierController : BaseCommandController
13 | {
14 | public CourierController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Message/SmsQueryController.cs:
--------------------------------------------------------------------------------
1 | using Model.Message;
2 | using RequestModel.Message;
3 | using System.Web.Http;
4 | using ViewModel.Message;
5 | using CommonLibrary.Service;
6 | using Model;
7 | using CommonLibrary.Repository;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Message
10 | {
11 | [RoutePrefix("api/SmsQuery")]
12 | public class SmsQueryController : BaseQueryController
13 | {
14 | public SmsQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Shops/DealerController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using RequestModel.Shops;
6 | using ViewModel.Shops;
7 |
8 | namespace Server.Inventory.Controllers.CommandControllers.Shops
9 | {
10 | using Model.Dealers;
11 |
12 | [RoutePrefix("api/Dealer")]
13 | public class DealerController : BaseCommandController
14 | {
15 | public DealerController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Shops/SupplierController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using RequestModel.Shops;
6 | using ViewModel.Shops;
7 | using M = Model.Shops.Supplier;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Shops
10 | {
11 | [RoutePrefix("api/Supplier")]
12 | public class SupplierController : BaseCommandController
13 | {
14 | public SupplierController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Reports/BaseReportViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace ViewModel.Reports
2 | {
3 | using System;
4 | using CommonLibrary.ViewModel;
5 | using ReportModel;
6 |
7 | public class BaseReportViewModel : BaseViewModel where T : BaseReport
8 | {
9 | public BaseReportViewModel(BaseReport x) : base(x)
10 | {
11 | this.Value = x.Value;
12 | this.Date = x.Date;
13 | this.RowsCount = x.RowsCount;
14 | this.ShopId = x.ShopId;
15 | }
16 |
17 | public string Value { get; set; }
18 | public DateTime Date { get; set; }
19 | public int RowsCount { get; set; }
20 | public string ShopId { get; set; }
21 | }
22 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Message/SmsHookController.cs:
--------------------------------------------------------------------------------
1 | using Model.Message;
2 | using RequestModel.Message;
3 | using System.Web.Http;
4 | using ViewModel.Message;
5 | using CommonLibrary.Service;
6 | using CommonLibrary.Repository;
7 | using Model;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Message
10 | {
11 | [RoutePrefix("api/SmsHook")]
12 | public class SmsHookController : BaseCommandController
13 | {
14 | public SmsHookController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Warehouses/DamageController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Warehouses;
6 | using RequestModel.Warehouses;
7 | using ViewModel.Warehouses;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Warehouses
10 | {
11 | [RoutePrefix("api/Damage")]
12 | public class DamageController : BaseCommandController
13 | {
14 | public DamageController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Shops/CourierQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Shops;
6 | using RequestModel.Shops;
7 | using ViewModel.Shops;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Shops
10 | {
11 | [RoutePrefix("api/CourierQuery")]
12 | public class CourierQueryController : BaseQueryController
13 | {
14 | public CourierQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Model/Customers/CustomerFeedback.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Model.Customers
5 | {
6 | public class CustomerFeedback : ShopChild
7 | {
8 | [Required]
9 | public string CustomerId { get; set; }
10 |
11 | [ForeignKey("CustomerId")]
12 | public virtual Customer Customer { get; set; }
13 |
14 | public string OrderNumber { get; set; }
15 |
16 | [MaxLength(500)]
17 | public string Feedback { get; set; }
18 |
19 | public FeedbackType FeedbackType { get; set; }
20 |
21 | [MaxLength(500)]
22 | public string ManagerComment { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Shops/DealerQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using RequestModel.Shops;
6 | using ViewModel.Shops;
7 |
8 | namespace Server.Inventory.Controllers.QueryControllers.Shops
9 | {
10 | using Model.Dealers;
11 |
12 | [RoutePrefix("api/DealerQuery")]
13 | public class DealerQueryController : BaseQueryController
14 | {
15 | public DealerQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Products/ProductDetailController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using Model;
4 | using Model.Products;
5 | using RequestModel.Products;
6 | using ServiceLibrary.Products;
7 | using ViewModel.Products;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Products
10 | {
11 | [RoutePrefix("api/ProductDetail")]
12 | public class ProductDetailController : BaseCommandController
13 | {
14 | public ProductDetailController() : base(new ProductDetailService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Transactions/WalletController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Transactions;
6 | using RequestModel.Transactions;
7 | using ViewModel.Transactions;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Transactions
10 | {
11 | [RoutePrefix("api/Wallet")]
12 | public class WalletController : BaseCommandController
13 | {
14 | public WalletController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Warehouses/DamageQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Warehouses;
6 | using RequestModel.Warehouses;
7 | using ViewModel.Warehouses;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Warehouses
10 | {
11 | [RoutePrefix("api/DamageQuery")]
12 | public class DamageQueryController : BaseQueryController
13 | {
14 | public DamageQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Operation/OperationLogController.cs:
--------------------------------------------------------------------------------
1 | using Rm = RequestModel.Operation.OperationLogRequestModel;
2 | using M = Model.Operations.OperationLog;
3 | using Vm = ViewModel.Operation.OperationLogViewModel;
4 | using System.Web.Http;
5 | using Model;
6 | using CommonLibrary.Service;
7 | using CommonLibrary.Repository;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Operation
10 | {
11 | [RoutePrefix("api/OperationLog")]
12 | public class OperationLogController : BaseQueryController
13 | {
14 | public OperationLogController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Message/HookDetailController.cs:
--------------------------------------------------------------------------------
1 | using Model.Message;
2 | using RequestModel.Message;
3 | using System.Web.Http;
4 | using ViewModel.Message;
5 | using CommonLibrary.Service;
6 | using Model;
7 | using CommonLibrary.Repository;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Message
10 | {
11 | [RoutePrefix("api/HookDetail")]
12 | public class HookDetailController : BaseCommandController
13 | {
14 | public HookDetailController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Transactions/WalletQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Transactions;
6 | using RequestModel.Transactions;
7 | using ViewModel.Transactions;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Transactions
10 | {
11 | [RoutePrefix("api/WalletQuery")]
12 | public class WalletQueryController : BaseQueryController
13 | {
14 |
15 | public WalletQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Customers/CustomerAddressController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Customers;
6 | using RequestModel.Customers;
7 | using ViewModel.Customers;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Customers
10 | {
11 | [RoutePrefix("api/CustomerAddress")]
12 | public class CustomerAddressController : BaseCommandController
13 | {
14 | public CustomerAddressController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/ServiceLibrary/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/source/BizBook/Model/Products/ProductCategory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace Model.Products
6 | {
7 | public class ProductCategory : ShopChild
8 | {
9 | [Index]
10 | [Required]
11 | [MaxLength(100)]
12 | [DataType(DataType.Text)]
13 | public string Name { get; set; }
14 |
15 | [Index] public int WcId { get; set; }
16 |
17 | [Index] [Required] public string ProductGroupId { get; set; }
18 |
19 | [ForeignKey("ProductGroupId")] public virtual ProductGroup ProductGroup { get; set; }
20 |
21 | public virtual ICollection ProductDetails { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Message/SmsHistoryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Message;
6 | using RequestModel.Message;
7 | using ViewModel.Message;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Message
10 | {
11 | [RoutePrefix("api/SmsHistory")]
12 | public class SmsHistoryController : BaseCommandController
13 | {
14 | public SmsHistoryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Message/HookDetailQueryController.cs:
--------------------------------------------------------------------------------
1 | using Model.Message;
2 | using RequestModel.Message;
3 | using System.Web.Http;
4 | using ViewModel.Message;
5 | using CommonLibrary.Service;
6 | using CommonLibrary.Repository;
7 | using Model;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Message
10 | {
11 | [RoutePrefix("api/HookDetailQuery")]
12 | public class HookDetailQueryController : BaseQueryController
13 | {
14 | public HookDetailQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Message/SmsHistoryQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Message;
6 | using RequestModel.Message;
7 | using ViewModel.Message;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Message
10 | {
11 | [RoutePrefix("api/SmsHistoryQuery")]
12 | public class SmsHistoryQueryController : BaseQueryController
13 | {
14 | public SmsHistoryQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Warehouses/StockTransferQueryController.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.Repository;
2 | using Model;
3 | using Model.Warehouses;
4 | using RequestModel.Warehouses;
5 | using ViewModel.Warehouses;
6 | using System.Web.Http;
7 | using ServiceLibrary.Warehouses;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Warehouses
10 | {
11 | [RoutePrefix("api/StockTransferQuery")]
12 | public class StockTransferQueryController : BaseQueryController
13 | {
14 | public StockTransferQueryController() : base(new StockTransferService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Customers/CustomerFeedbackController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using M = Model.Customers.CustomerFeedback;
6 | using RM = RequestModel.Customers.CustomerFeedbackRequestModel;
7 | using VM = ViewModel.Customers.CustomerFeedbackViewModel;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Customers
10 | {
11 | [RoutePrefix("api/CustomerFeedback")]
12 | public class CustomerFeedbackController : BaseCommandController
13 | {
14 | public CustomerFeedbackController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Products/ProductGroupController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using RequestModel.Products;
6 | using ViewModel.Products;
7 | using M=Model.Products.ProductGroup;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Products
10 | {
11 | [RoutePrefix("api/ProductGroup")]
12 | public class ProductGroupController : BaseCommandController
13 | {
14 | public ProductGroupController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Operation/OperationLogQueryController.cs:
--------------------------------------------------------------------------------
1 | using Rm = RequestModel.Operation.OperationLogRequestModel;
2 | using M = Model.Operations.OperationLog;
3 | using Vm = ViewModel.Operation.OperationLogViewModel;
4 | using System.Web.Http;
5 | using Model;
6 | using CommonLibrary.Service;
7 | using CommonLibrary.Repository;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.operation
10 | {
11 | [RoutePrefix("api/OperationLogQuery")]
12 | public class OperationLogQueryController : BaseQueryController
13 | {
14 | public OperationLogQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Sales/InstallmentQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using Rm = RequestModel.Sales.InstallmentRequestModel;
3 | using M = Model.Sales.Installment;
4 | using Vm = ViewModel.Sales.InstallmentViewModel;
5 |
6 | namespace Server.Inventory.Controllers.QueryControllers.Sales
7 | {
8 | using CommonLibrary.Repository;
9 | using CommonLibrary.Service;
10 |
11 | using Model;
12 |
13 | [RoutePrefix("api/InstallmentQuery")]
14 | public class InstallmentQueryController : BaseQueryController
15 | {
16 | public InstallmentQueryController()
17 | : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Transactions/AccountHeadQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Rm = RequestModel.Transactions.AccountHeadRequestModel;
6 | using M = Model.Transactions.AccountHead;
7 | using Vm = ViewModel.Transactions.AccountHeadViewModel;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Transactions
10 | {
11 | [RoutePrefix("api/AccountHeadQuery")]
12 | public class AccountHeadQueryController: BaseQueryController
13 | {
14 | public AccountHeadQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 |
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Customers/CustomerFeedbackQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Rm = RequestModel.Customers.CustomerFeedbackRequestModel;
6 | using M = Model.Customers.CustomerFeedback;
7 | using Vm = ViewModel.Customers.CustomerFeedbackViewModel;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Customers
10 | {
11 | [RoutePrefix("api/CustomerFeedbackQuery")]
12 | public class CustomerFeedbackQueryController : BaseQueryController
13 | {
14 | public CustomerFeedbackQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/BizBook/Model/Operations/OperationLogDetail.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations.Schema;
2 |
3 | namespace Model.Operations
4 | {
5 | public class OperationLogDetail : ShopChild
6 | {
7 |
8 | public OperationType OperationType { get; set; }
9 | public ModelName ModelName { get; set; }
10 | public string ObjectId { get; set; }
11 | public string ObjectIdentifier { get; set; }
12 | public string PropertyName { get; set; }
13 | public string OldValue { get; set; }
14 | public string NewValue { get; set; }
15 | public string Remarks { get; set; }
16 | public string OperationLogId { get; set; }
17 | [ForeignKey("OperationLogId")] public virtual OperationLog OperationLog { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Filters/MultipleOperationsWithSameVerbFilter.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http.Description;
2 | using Swashbuckle.Swagger;
3 |
4 | namespace Server.Identity.Filters
5 | {
6 | public class MultipleOperationsWithSameVerbFilter : IOperationFilter
7 | {
8 | public void Apply(
9 | Operation operation,
10 | SchemaRegistry schemaRegistry,
11 | ApiDescription apiDescription)
12 | {
13 | if (operation.parameters != null)
14 | {
15 | operation.operationId += "_";
16 | foreach (var parm in operation.parameters)
17 | {
18 | operation.operationId += string.Format("{0}", parm.name);
19 | }
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Employees/EmployeeInfoController.cs:
--------------------------------------------------------------------------------
1 | using Model.Employees;
2 | using RequestModel.Employees;
3 | using System.Web.Http;
4 | using ViewModel.Employees;
5 | using CommonLibrary.Service;
6 | using CommonLibrary.Repository;
7 | using Model;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Employees
10 | {
11 | [RoutePrefix("api/EmployeeInfo")]
12 | public class EmployeeInfoController : BaseCommandController
13 | {
14 | public EmployeeInfoController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Model;
3 |
4 | namespace ViewModel
5 | {
6 | public abstract class BaseViewModel where T : Entity
7 | {
8 | protected BaseViewModel(Entity x)
9 | {
10 | Id = x.Id;
11 | Created = x.Created;
12 | CreatedBy = x.CreatedBy;
13 | Modified = x.Modified;
14 | ModifiedBy = x.ModifiedBy;
15 | }
16 |
17 | protected BaseViewModel()
18 | {
19 | }
20 |
21 | public string Id { get; set; }
22 |
23 | public DateTime Created { get; set; }
24 |
25 | public string CreatedBy { get; set; }
26 |
27 | public DateTime Modified { get; set; }
28 |
29 | public string ModifiedBy { get; set; }
30 | }
31 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Transactions/TransactionController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using Model;
4 | using Model.Transactions;
5 | using RequestModel.Transactions;
6 | using ViewModel.Transactions;
7 | using TransactionService = ServiceLibrary.Transactions.TransactionService;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Transactions
10 | {
11 | [RoutePrefix("api/Transaction")]
12 | public class TransactionController : BaseCommandController
13 | {
14 | public TransactionController() : base(new TransactionService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 |
19 |
20 | }
21 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Operation/OperationLogDetailQueryController.cs:
--------------------------------------------------------------------------------
1 | using Rm = RequestModel.Operation.OperationLogDetailRequestModel;
2 | using M = Model.Operations.OperationLogDetail;
3 | using Vm = ViewModel.Operation.OperationLogDetailViewModel;
4 | using System.Web.Http;
5 | using CommonLibrary.Service;
6 | using CommonLibrary.Repository;
7 | using Model;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.operation
10 | {
11 | [RoutePrefix("api/OperationLogDetailQuery")]
12 | public class OperationLogDetailQueryController : BaseQueryController
13 | {
14 | public OperationLogDetailQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/ServiceLibrary/Shops/ShopService.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.Repository;
2 | using CommonLibrary.Service;
3 | using Model.Shops;
4 | using RequestModel.Shops;
5 | using ViewModel.Shops;
6 |
7 | namespace ServiceLibrary.Shops
8 | {
9 | public class ShopService : BaseService
10 | {
11 | public ShopService(BaseRepository repository) : base(repository)
12 | {
13 | }
14 |
15 | public virtual ShopViewModel GetMyDetail(string id)
16 | {
17 | var model = Repository.GetById(id);
18 | if (model == null)
19 | {
20 | return null;
21 | }
22 | var myDetail = new ShopViewModel(model);
23 | return myDetail;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Message/HookDetailViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.ViewModel;
2 | using Model.Message;
3 |
4 | namespace ViewModel.Message
5 | {
6 | public class HookDetailViewModel : BaseViewModel
7 | {
8 | public HookDetailViewModel(HookDetail x) : base(x)
9 | {
10 | SetProperties(x);
11 | }
12 |
13 | public void SetProperties(HookDetail x)
14 | {
15 | ShopId = x.ShopId;
16 | HookName = x.HookName;
17 | IsEnabled = x.IsEnabled;
18 | SmsHookId = x.SmsHookId;
19 | }
20 |
21 | public string ShopId { get; set; }
22 | public string HookName { get; set; }
23 | public bool IsEnabled { get; set; }
24 | public string SmsHookId { get; set; }
25 | }
26 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Employees/EmployeeInfoQueryController.cs:
--------------------------------------------------------------------------------
1 | using Model.Employees;
2 | using RequestModel.Employees;
3 | using System.Web.Http;
4 | using ViewModel.Employees;
5 | using CommonLibrary.Service;
6 | using Model;
7 | using CommonLibrary.Repository;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Employees
10 | {
11 | [RoutePrefix("api/EmployeeInfoQuery")]
12 | public class EmployeeInfoQueryController : BaseQueryController
13 | {
14 | public EmployeeInfoQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Customers/CustomerProductViewModel.cs:
--------------------------------------------------------------------------------
1 | using ViewModel.Sales;
2 |
3 | namespace ViewModel.Customers
4 | {
5 | public class CustomerProductViewModel
6 | {
7 |
8 | public CustomerProductViewModel(SaleDetailViewModel x, string productName, double salePrice)
9 | {
10 |
11 | Total = x.Total;
12 | Quantity = x.Quantity;
13 | ProductName = x.ProductDetailName;
14 | InvoiceNumber = x.SaleOrderNo;
15 | Price = x.SalePricePerUnit;
16 | }
17 | public string InvoiceNumber { get; set; }
18 | public string ProductName { get; set; }
19 | public double Quantity { get; set; }
20 | public double Price { get; set; }
21 | public double Total { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Products/DealerProductQueryController.cs:
--------------------------------------------------------------------------------
1 | using Model.Products;
2 | using RequestModel.Products;
3 | using System.Web.Http;
4 | using ViewModel.Products;
5 | using CommonLibrary.Service;
6 | using CommonLibrary.Repository;
7 | using Model;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Products
10 | {
11 | [RoutePrefix("api/DealerProductQuery")]
12 | public class DealerProductQueryController : BaseQueryController
13 | {
14 | public DealerProductQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/ServiceLibrary/Reports/IReportService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace ServiceLibrary.Reports
5 | {
6 | using Model;
7 |
8 | using ReportModel;
9 | using ReportModel.Parameters;
10 |
11 | public interface IReportService where T : ShopChild where M : BaseReport
12 | {
13 | void ShopClose(string shopId, DateTime start, DateTime end, ReportTimeType reportTimeType);
14 | IEnumerable CreateReportModels(List models, ReportParameterBase p);
15 | M CreateReportModel(List models, ReportParameterBase reportParameter);
16 | void SaveReports(List reports);
17 | }
18 |
19 | public interface IReportService2
20 | {
21 | string QuickUpdate(string shopId, string itemId, DateTime date);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/source/BizBook/Utility/Extensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Utility
4 | {
5 | public static class Extensions
6 | {
7 | public static bool IdIsOk(this string id)
8 | {
9 | if (string.IsNullOrWhiteSpace(id))
10 | {
11 | return false;
12 | }
13 | Guid guid;
14 | if (!Guid.TryParse(id, out guid))
15 | {
16 | return false;
17 | }
18 | if (guid == new Guid())
19 | {
20 | return false;
21 | }
22 | return true;
23 | }
24 |
25 | public static double ToDecimal(this double input)
26 | {
27 | return Math.Round(input, 2, MidpointRounding.AwayFromZero);
28 | }
29 | }
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Products/ProductCategoryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using Model.Products;
6 | using RequestModel.Products;
7 | using ViewModel.Products;
8 |
9 | namespace Server.Inventory.Controllers.CommandControllers.Products
10 | {
11 | [RoutePrefix("api/ProductCategory")]
12 | public class ProductCategoryController : BaseCommandController
13 | {
14 | public ProductCategoryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Transactions/AccountHeadController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using CommonLibrary.Repository;
3 | using CommonLibrary.Service;
4 | using Model;
5 | using RequestModel.Transactions;
6 | using ViewModel.Transactions;
7 |
8 | namespace Server.Inventory.Controllers.CommandControllers.Transactions
9 | {
10 | using Model.Transactions;
11 |
12 |
13 | [RoutePrefix("api/AccountHead")]
14 | public class AccountHeadController : BaseCommandController
15 | {
16 | public AccountHeadController() : base(new BaseService(
17 | new BaseRepository(BusinessDbContext.Create())))
18 | {
19 |
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Products/ProductVariation.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Model.Products
5 | {
6 | public class ProductVariation
7 | {
8 | [NotMapped] public string Permalink { get; set; }
9 | [NotMapped] public int WcVariationId { get; set; }
10 | [NotMapped] public string Option { get; set; }
11 | [NotMapped] public double CostPrice { get; set; }
12 | [NotMapped] public double SalePrice { get; set; }
13 | [NotMapped] public int OnHand { get; set; }
14 | [NotMapped] public int Purchased { get; set; }
15 | [NotMapped] public int Sold { get; set; }
16 | [NotMapped] public List Images { get; set; }
17 | [NotMapped] public string Name { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/CommandControllers/Warehouses/WarehouseController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 |
3 | namespace Server.Inventory.Controllers.CommandControllers.Warehouses
4 | {
5 | using CommonLibrary.Repository;
6 | using CommonLibrary.Service;
7 |
8 | using Model;
9 | using Model.Warehouses;
10 | using RequestModel.Warehouses;
11 | using ViewModel.Warehouses;
12 |
13 | [RoutePrefix("api/Warehouse")]
14 | public class WarehouseController : BaseCommandController
15 | {
16 | public WarehouseController(): base(new BaseService(
17 | new BaseRepository(BusinessDbContext.Create())))
18 | {
19 |
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Transactions/WalletViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.ViewModel;
2 | using Model.Transactions;
3 |
4 | namespace ViewModel.Transactions
5 | {
6 | public class WalletViewModel : BaseViewModel
7 | {
8 | public WalletViewModel(Wallet x) : base(x)
9 | {
10 | AccountTitle = x.AccountTitle;
11 | AccountNumber = x.AccountNumber;
12 | BankName = x.BankName;
13 | WalletType = x.WalletType.ToString();
14 | ShopId = x.ShopId;
15 | }
16 |
17 | public string ShopId { get; set; }
18 |
19 | public string AccountTitle { get; set; }
20 |
21 | public string AccountNumber { get; set; }
22 |
23 | public string BankName { get; set; }
24 |
25 | public string WalletType { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Warehouses/Warehouse.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations.Schema;
2 | using Model.Customers;
3 |
4 | namespace Model.Warehouses
5 | {
6 | public class Warehouse : ShopChild
7 | {
8 | public string Name { get; set; }
9 |
10 | public string StreetAddress { get; set; }
11 |
12 | public string Area { get; set; }
13 |
14 | public string District { get; set; }
15 |
16 | public bool IsMain { get; set; }
17 | }
18 |
19 | public class WarehouseZone : ShopChild
20 | {
21 | public string WarehouseId { get; set; }
22 |
23 | [ForeignKey("WarehouseId")] public virtual Warehouse Warehouse { get; set; }
24 |
25 | public string ZoneId { get; set; }
26 |
27 | [ForeignKey("ZoneId")] public virtual Zone Zone { get; set; }
28 | }
29 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Products/SupplierProductQueryController.cs:
--------------------------------------------------------------------------------
1 | using Model.Products;
2 | using RequestModel.Products;
3 | using System.Web.Http;
4 | using ViewModel.Products;
5 | using CommonLibrary.Service;
6 | using CommonLibrary.Repository;
7 | using Model;
8 |
9 | namespace Server.Inventory.Controllers.QueryControllers.Products
10 | {
11 | [RoutePrefix("api/SupplierProductQuery")]
12 | public class SupplierProductQueryController : BaseQueryController
13 | {
14 | public SupplierProductQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
15 | {
16 |
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/BizBook/ReportModel/Parameters/TransactionReportParameter.cs:
--------------------------------------------------------------------------------
1 | namespace ReportModel.Parameters
2 | {
3 | using System;
4 |
5 | public class TransactionReportParameter : ReportParameterBase
6 | {
7 | public TransactionReportParameter(DateTime date, string value, string shopId) : base(date, value, shopId)
8 | {
9 | }
10 |
11 | public string AccountHeadName { get; set; }
12 |
13 | public string AccountHeadId { get; set; }
14 |
15 | public double TotalStarting { get; set; }
16 |
17 | public double CashStarting { get; set; }
18 |
19 | public double CardStarting { get; set; }
20 |
21 | public double ChequeStarting { get; set; }
22 |
23 | public double MobileStarting { get; set; }
24 |
25 | public double OtherStarting { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/source/BizBook/Model/Employees/EmployeeInfo.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 | using Model.Warehouses;
4 |
5 | namespace Model.Employees
6 | {
7 | public class EmployeeInfo : ShopChild
8 | {
9 | [Index] [Required] [MaxLength(200)] public string Name { get; set; }
10 |
11 | [Index] [MaxLength(100)] public string Phone { get; set; }
12 |
13 | [Index] [MaxLength(50)] public string Email { get; set; }
14 | public string RoleId { get; set; }
15 | public double Salary { get; set; }
16 | public double SaleTargetAmount { get; set; }
17 | public double SaleAchivedAmount { get; set; }
18 |
19 | public string WarehouseId { get; set; }
20 |
21 | [ForeignKey("WarehouseId")] public virtual Warehouse Warehouse { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/BizBook/ViewModel/Products/ProductCategoryViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommonLibrary.ViewModel;
2 | using Model.Products;
3 |
4 | namespace ViewModel.Products
5 | {
6 | public class ProductCategoryViewModel : BaseViewModel
7 | {
8 | public ProductCategoryViewModel(ProductCategory x) : base(x)
9 | {
10 | Name = x.Name;
11 | ProductGroupId = x.ProductGroupId;
12 | if (x.ProductGroup != null)
13 | {
14 | ProductGroupName = x.ProductGroup.Name;
15 | }
16 |
17 | ShopId = x.ShopId;
18 | }
19 |
20 | public string ShopId { get; set; }
21 |
22 | [IsViewable] public string ProductGroupName { get; set; }
23 |
24 | [IsViewable] public string Name { get; set; }
25 | public string ProductGroupId { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System.Data.Entity;
2 | using System.Web;
3 | using System.Web.Http;
4 | using System.Web.Mvc;
5 | using System.Web.Routing;
6 | using Model;
7 | using Server.Identity.Models;
8 |
9 | namespace Server.Identity
10 | {
11 | public class WebApiApplication : HttpApplication
12 | {
13 | protected void Application_Start()
14 | {
15 | AreaRegistration.RegisterAllAreas();
16 | GlobalConfiguration.Configure(WebApiConfig.Register);
17 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
18 | RouteConfig.RegisterRoutes(RouteTable.Routes);
19 | // BundleConfig.RegisterBundles(BundleTable.Bundles);
20 | Database.SetInitializer(null);
21 | Database.SetInitializer(null);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Inventory/Controllers/QueryControllers/Sales/InstallmentDetailQueryController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 |
3 | namespace Server.Inventory.Controllers.QueryControllers.Sales
4 | {
5 | using CommonLibrary.Repository;
6 | using CommonLibrary.Service;
7 |
8 | using Model;
9 | using Model.Sales;
10 | using RequestModel.Sales;
11 | using ViewModel.Sales;
12 |
13 | [RoutePrefix("api/InstallmentDetailQuery")]
14 | public class InstallmentDetailQueryController : BaseQueryController
15 | {
16 | public InstallmentDetailQueryController() : base(new BaseService(new BaseRepository(BusinessDbContext.Create())))
17 | {
18 | }
19 |
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/source/BizBook/ReportModel/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/source/BizBook/Server.Identity/Providers/OAuthTokenProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Microsoft.Owin.Security.OAuth;
4 |
5 | namespace Server.Identity.Providers
6 | {
7 | public class OAuthTokenProvider : OAuthBearerAuthenticationProvider
8 |
9 | {
10 | public override Task RequestToken(OAuthRequestTokenContext context)
11 | {
12 | if (context == null) throw new ArgumentNullException("context");
13 |
14 | // try to find bearer token in a cookie
15 | // (by default OAuthBearerAuthenticationHandler
16 | // only checks Authorization header)
17 | var tokenCookie = context.OwinContext.Request.Cookies["BearerToken"];
18 | if (!string.IsNullOrEmpty(tokenCookie))
19 | context.Token = tokenCookie;
20 | return Task.FromResult