C# 简易POS零售系统架构设计源码(2)
PosDevices.cs
C# Code:
using System;
using System.Collections.Generic;
using System.Text;
using Tech2007.Common;
using System.Windows.Forms;
namespace CSFramework.Tech2011.PosTerminal
{
#region ICashier Interface and Class
/// <summary>
/// 钱箱接口
/// </summary>
public interface ICashier
{
//ITraceLog事件跟踪
void Init(Label currentReceive, Label totalReceive, ITraceLog log);//初始化钱箱
void Reset();
void OpenDoor();
void CloseDoor();
void AcceptMoney(decimal amount); //客户结账收钱
}
/// <summary>
/// 普通收银钱箱
/// </summary>
public class StandardCashier : ICashier
{
private ITraceLog _Log;
private Label _currentReceive;
private Label _totalReceive;
private decimal _Total = 0;
public void Init(Label currentReceive, Label totalReceive, ITraceLog log)
{
_currentReceive = currentReceive;
_totalReceive = totalReceive;
_Log = log;
}
public void OpenDoor()
{
_currentReceive.Text = "Open Door";
_Log.ShowMessage("The cashier door opened!");
}
public void CloseDoor()
{
_currentReceive.Text = "Close Door";
_Log.ShowMessage("The cashier door closed!");
}
public void AcceptMoney(decimal amount)
{
_Total = _Total amount;
_currentReceive.Text = "Receive:" amount.ToString();
_totalReceive.Text = "Total:" _Total.ToString();
_Log.ShowMessage("Total received money:" amount.ToString());
}
public void Reset()
{
_currentReceive.Text = "Receive:0.00";
_totalReceive.Text = "Total:0.00";
this.CloseDoor();
_Log.ShowMessage("钱箱初始化成功!");
}
}
#endregion
#region IMonitor interface and Classes
/// <summary>
/// 显示器接口
/// </summary>
public interface IMonitor
{
void Reset();
void Init(Label lbCurStock, Label lbReceivable, ITraceLog log);
void ShowMessage(string line1, string line2); //一般的小显示器只支持显示2行消息.
}
/// <summary>
/// BENQ50显示器
/// </summary>
public class Monitor_BENQ500 : IMonitor
{
private ITraceLog _Log;
private Label _label;
private Label _lbReceivable;
public void Init(Label lbCurStock, Label lbReceivable, ITraceLog log)
{
_label = lbCurStock;
_lbReceivable = lbReceivable;
_Log = log;
}
public void ShowMessage(string line1, string line2)
{
if (line1 != "") _label.Text = line1;
if (line2 != "") _lbReceivable.Text = line2;
_Log.ShowMessage("BENQ500:" line1);
}
public void Reset()
{
_label.Text = "Welcome!";
_lbReceivable.Text = "应收:0.00";
_Log.ShowMessage("BENQ500初始化成功!");
}
}
/// <summary>
/// 三星Samsung200显示器
/// </summary>
public class Monitor_Samsung200 : IMonitor
{
private ITraceLog _Log;
private Label _label;
private Label _lbReceivable;
public void Init(Label lbCurStock, Label lbReceivable, ITraceLog log)
{
_label = lbCurStock;
_lbReceivable = lbReceivable;
_Log = log;
}
public void ShowMessage(string line1, string line2)
{
_label.Text = line1;
_lbReceivable.Text = line2;
_Log.ShowMessage("Samsung200:" line1);
}
public void Reset()
{
_label.Text = "Welcome!";
_lbReceivable.Text = "应收:0.00";
_Log.ShowMessage("Samsung200初始化成功!");
}
}
#endregion
#region IPrinter interface and classes
/// <summary>
/// 打印机接口
/// </summary>
public interface IPrinter
{
void Reset();
void Init(ListBox listbox, ITraceLog log);
void Print(string msg);
}
/// <summary>
/// 打印机:HP5000型号
/// </summary>
public class Printer_HP5000 : IPrinter
{
private ITraceLog _Log;
private ListBox _listbox;
public void Init(ListBox listbox, ITraceLog log)
{
_listbox = listbox;
_Log = log;
}
public void Print(string msg)
{
_listbox.Items.Add(msg);
_Log.ShowMessage("HP5000:" msg);
}
public void Reset()
{
_listbox.Items.Clear();
_listbox.Items.Add("Printer OK!");
_Log.ShowMessage("HP5000初始化成功!");
}
}
/// <summary>
/// 打印机:Epson600型号
/// </summary>
public class Printer_Epson600 : IPrinter
{
private ITraceLog _Log;
private ListBox _listbox;
public void Init(ListBox listbox, ITraceLog log)
{
_listbox = listbox;
_Log = log;
}
public void Print(string msg)
{
_listbox.Items.Add(msg);
_Log.ShowMessage("Epson600:" msg);
}
public void Reset()
{
_listbox.Items.Clear();
_listbox.Items.Add("Printer OK!");
}
}
#endregion
}
//来源:C/S框架网(www.csframework.com) QQ:1980854898
using System;
using System.Collections.Generic;
using System.Text;
using Tech2007.Common;
using System.Windows.Forms;
namespace CSFramework.Tech2011.PosTerminal
{
#region ICashier Interface and Class
/// <summary>
/// 钱箱接口
/// </summary>
public interface ICashier
{
//ITraceLog事件跟踪
void Init(Label currentReceive, Label totalReceive, ITraceLog log);//初始化钱箱
void Reset();
void OpenDoor();
void CloseDoor();
void AcceptMoney(decimal amount); //客户结账收钱
}
/// <summary>
/// 普通收银钱箱
/// </summary>
public class StandardCashier : ICashier
{
private ITraceLog _Log;
private Label _currentReceive;
private Label _totalReceive;
private decimal _Total = 0;
public void Init(Label currentReceive, Label totalReceive, ITraceLog log)
{
_currentReceive = currentReceive;
_totalReceive = totalReceive;
_Log = log;
}
public void OpenDoor()
{
_currentReceive.Text = "Open Door";
_Log.ShowMessage("The cashier door opened!");
}
public void CloseDoor()
{
_currentReceive.Text = "Close Door";
_Log.ShowMessage("The cashier door closed!");
}
public void AcceptMoney(decimal amount)
{
_Total = _Total amount;
_currentReceive.Text = "Receive:" amount.ToString();
_totalReceive.Text = "Total:" _Total.ToString();
_Log.ShowMessage("Total received money:" amount.ToString());
}
public void Reset()
{
_currentReceive.Text = "Receive:0.00";
_totalReceive.Text = "Total:0.00";
this.CloseDoor();
_Log.ShowMessage("钱箱初始化成功!");
}
}
#endregion
#region IMonitor interface and Classes
/// <summary>
/// 显示器接口
/// </summary>
public interface IMonitor
{
void Reset();
void Init(Label lbCurStock, Label lbReceivable, ITraceLog log);
void ShowMessage(string line1, string line2); //一般的小显示器只支持显示2行消息.
}
/// <summary>
/// BENQ50显示器
/// </summary>
public class Monitor_BENQ500 : IMonitor
{
private ITraceLog _Log;
private Label _label;
private Label _lbReceivable;
public void Init(Label lbCurStock, Label lbReceivable, ITraceLog log)
{
_label = lbCurStock;
_lbReceivable = lbReceivable;
_Log = log;
}
public void ShowMessage(string line1, string line2)
{
if (line1 != "") _label.Text = line1;
if (line2 != "") _lbReceivable.Text = line2;
_Log.ShowMessage("BENQ500:" line1);
}
public void Reset()
{
_label.Text = "Welcome!";
_lbReceivable.Text = "应收:0.00";
_Log.ShowMessage("BENQ500初始化成功!");
}
}
/// <summary>
/// 三星Samsung200显示器
/// </summary>
public class Monitor_Samsung200 : IMonitor
{
private ITraceLog _Log;
private Label _label;
private Label _lbReceivable;
public void Init(Label lbCurStock, Label lbReceivable, ITraceLog log)
{
_label = lbCurStock;
_lbReceivable = lbReceivable;
_Log = log;
}
public void ShowMessage(string line1, string line2)
{
_label.Text = line1;
_lbReceivable.Text = line2;
_Log.ShowMessage("Samsung200:" line1);
}
public void Reset()
{
_label.Text = "Welcome!";
_lbReceivable.Text = "应收:0.00";
_Log.ShowMessage("Samsung200初始化成功!");
}
}
#endregion
#region IPrinter interface and classes
/// <summary>
/// 打印机接口
/// </summary>
public interface IPrinter
{
void Reset();
void Init(ListBox listbox, ITraceLog log);
void Print(string msg);
}
/// <summary>
/// 打印机:HP5000型号
/// </summary>
public class Printer_HP5000 : IPrinter
{
private ITraceLog _Log;
private ListBox _listbox;
public void Init(ListBox listbox, ITraceLog log)
{
_listbox = listbox;
_Log = log;
}
public void Print(string msg)
{
_listbox.Items.Add(msg);
_Log.ShowMessage("HP5000:" msg);
}
public void Reset()
{
_listbox.Items.Clear();
_listbox.Items.Add("Printer OK!");
_Log.ShowMessage("HP5000初始化成功!");
}
}
/// <summary>
/// 打印机:Epson600型号
/// </summary>
public class Printer_Epson600 : IPrinter
{
private ITraceLog _Log;
private ListBox _listbox;
public void Init(ListBox listbox, ITraceLog log)
{
_listbox = listbox;
_Log = log;
}
public void Print(string msg)
{
_listbox.Items.Add(msg);
_Log.ShowMessage("Epson600:" msg);
}
public void Reset()
{
_listbox.Items.Clear();
_listbox.Items.Add("Printer OK!");
}
}
#endregion
}
//来源:C/S框架网(www.csframework.com) QQ:1980854898
参考文档:
C# 简易POS零售系统架构设计源码(5)
C# 简易POS零售系统架构设计源码(4)
C# 简易POS零售系统架构设计源码(3)
C# 简易POS零售系统架构设计源码(1)
CSFramework.EF.PostgreSql数据库组件 PostgreSql数据库测试报告|C/S开发框架
CSFrameworkV6快速开发框架 | 使用PostgreSql 数据库测试报告|C/S开发框架
CSFramework WebApi开发框架集成PostgreSql数据库及测试报告|C/S开发框架
Postman工具设置Bearer Token与调试WebApi接口|C/S开发框架
DevExpressV22:RepositoryItemComboBox的QueryPopUp事件无法动态加载数据项
DevExpress开发技巧高级篇:双击RepositoryItemPictureEdit组件自动弹出菜单
GIT报错:Could not get HEAD hash. libgit2 returned:repository path "xx" is not owned by current user
DevExpress 实时打印表格内容(PrintableComponentLink/CompositeLink组件使用)
使用RepositoryItemMemoExEdit显示大文本内容
饰品店面销售管理系统POS系统详细设计说明书doc文档下载|软件文档
HTTP|POST提交数据:ContentType=application/x|www|form|urlencoded 内容格式|C#源码
HTTP|POST提交数据:ContentType=application/json 内容格式|C#源码
C# 简易POS零售系统架构设计源码(5)
C# 简易POS零售系统架构设计源码(4)
C# 简易POS零售系统架构设计源码(3)
C# 简易POS零售系统架构设计源码(1)
CSFramework.EF.PostgreSql数据库组件 PostgreSql数据库测试报告|C/S开发框架
CSFrameworkV6快速开发框架 | 使用PostgreSql 数据库测试报告|C/S开发框架
CSFramework WebApi开发框架集成PostgreSql数据库及测试报告|C/S开发框架
Postman工具设置Bearer Token与调试WebApi接口|C/S开发框架
DevExpressV22:RepositoryItemComboBox的QueryPopUp事件无法动态加载数据项
DevExpress开发技巧高级篇:双击RepositoryItemPictureEdit组件自动弹出菜单
GIT报错:Could not get HEAD hash. libgit2 returned:repository path "xx" is not owned by current user
DevExpress 实时打印表格内容(PrintableComponentLink/CompositeLink组件使用)
使用RepositoryItemMemoExEdit显示大文本内容
饰品店面销售管理系统POS系统详细设计说明书doc文档下载|软件文档
HTTP|POST提交数据:ContentType=application/x|www|form|urlencoded 内容格式|C#源码
HTTP|POST提交数据:ContentType=application/json 内容格式|C#源码
其它资料:
什么是C/S结构? | C/S框架核心组成部分 | C/S框架-WebService部署图 | C/S框架-权限管理 | C/S结构系统框架 - 5.1旗舰版介绍 | C/S结构系统框架 - 功能介绍 | C/S结构系统框架 - 产品列表 | C/S结构系统框架 - 应用展示(图) | 三层体系架构详解 | C/S架构轻量级快速开发框架 | C/S框架网客户案例 | WebApi快速开发框架 | C/S框架代码生成器 | 用户授权注册软件系统 | 版本自动升级软件 | 数据库底层应用框架 | CSFramework.CMS内容管理系统 |
什么是C/S结构? | C/S框架核心组成部分 | C/S框架-WebService部署图 | C/S框架-权限管理 | C/S结构系统框架 - 5.1旗舰版介绍 | C/S结构系统框架 - 功能介绍 | C/S结构系统框架 - 产品列表 | C/S结构系统框架 - 应用展示(图) | 三层体系架构详解 | C/S架构轻量级快速开发框架 | C/S框架网客户案例 | WebApi快速开发框架 | C/S框架代码生成器 | 用户授权注册软件系统 | 版本自动升级软件 | 数据库底层应用框架 | CSFramework.CMS内容管理系统 |
在线客服
