In brief
A technical deep-dive into building reliable point-of-sale software with C#, WPF and SQL Server, from database design to receipt printing.

A point-of-sale system looks simple: scan items, take payment, print a receipt. But underneath, a reliable POS handles inventory sync, offline resilience, receipt formatting, tax calculation and payment gateway integration, all while responding in under 200 milliseconds.
Architecture overview
A well-architected POS uses a layered design:
- Data layer: SQL Server (LocalDB for offline, syncs to central). Entity Framework Core for data access, raw SQL for hot-path queries like price lookups.
- Business logic: services for inventory, pricing (tiered, promotional, tax-inclusive/exclusive), payments and reporting. Every operation wrapped in transactions.
- Presentation: WPF with MVVM for a responsive, keyboard-friendly interface cashiers can operate without a mouse.
Database design essentials
Your Products table needs SKU, barcode, name, unit price, cost price, tax category, stock quantity, reorder level and category. The real complexity is in SalesHeaders and SalesDetails:
SalesHeaders: Id, InvoiceNumber, CustomerId, SubTotal, TaxAmount,
DiscountAmount, GrandTotal, PaymentMethod, PaymentStatus,
CashierId, TerminalId, CreatedAt
SalesDetails: Id, SaleId, ProductId, Quantity, UnitPrice, TaxRate,
Discount, LineTotal
Always store UnitPrice and TaxRate at sale time, never rely on a live product lookup. Yesterday's receipts must remain accurate forever.
Offline-first design
Internet down? The POS must keep selling. Use a local database (SQL Server LocalDB or SQLite) on each terminal that syncs every 60 seconds. Queue unsent transactions and push when connectivity returns. This is non-negotiable.
Payment integration
A modern POS accepts cash, mobile money (MTN, Airtel, M-Pesa), cards (Visa, MasterCard) and even USDT crypto. Abstract each behind a common IPaymentProcessor interface so adding new methods never breaks existing code.
Receipt printing
Thermal printers use ESC/POS commands. In C#, use System.IO.Ports.SerialPort for direct printer communication or generate a PDF and send it to a Windows print queue. Always include: business name, TIN, invoice number, date, line items with prices, tax breakdown, total, payment method.
TFast Digital Agency builds custom POS systems that match exactly how your business operates: your product categories, your pricing rules, your reporting needs. You own the software and the data. No monthly subscriptions, no vendor lock-in.
<!-- SEO keyword optimization: pos system csharp dotnet -->Focusing on pos system csharp dotnet is essential for modern business success.



