Commit a006fa15 authored by liugd's avatar liugd

半自动

parent 60130e2f
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
bin/
obj/
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Visual Studio 2015 cache/options directory
.vs/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
#*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
......@@ -16,7 +16,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
AutoEncashToolStrip autoEncashToolStrip;
public AutoEncashTabPage()
{
this.Text = "打印兑奖票";
this.Text = "打印兑奖票";
this.Dock = DockStyle.Fill;
ToolStripContainer toolStripContainer = new ToolStripContainer();
......@@ -85,13 +85,13 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
// }
// catch (Exception exception)
// {
// MessageService.ShowMessage(string.Concat("兑奖配置异常。错误信息:", exception.Message));
// MessageService.ShowMessage(string.Concat("兑奖配置异常。错误信息:", exception.Message));
// }
//}
//void toolStripComboBoxLotType_SelectedIndexChanged(object sender, EventArgs e)
//{
// //加载彩种期号列表
// //加载彩种期号列表
// try
// {
// M_LotTypeEntity lotTypeEntity = autoEncashToolStrip.toolStripComboBoxLotType.SelectedItem as M_LotTypeEntity;
......@@ -133,7 +133,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
// }
// catch (Exception exception)
// {
// MessageService.ShowError(string.Concat("加载自动兑奖期号列表异常。错误信息:",exception.Message));
// MessageService.ShowError(string.Concat("加载自动兑奖期号列表异常。错误信息:",exception.Message));
// }
//}
void view_CheckedChanged(object sender, EventArgs e)
......@@ -164,7 +164,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
if (selectedMachineNum == 0)
{
MessageService.ShowMessage("请选择机器号", "操作提示");
MessageService.ShowMessage("请选择机器号", "操作提示");
}
}
......@@ -188,13 +188,13 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
if (selectedMachineNum == 0)
{
MessageService.ShowMessage("请选择机器号", "操作提示");
MessageService.ShowMessage("请选择机器号", "操作提示");
}
}
void toolStripButtonLoadBig_Click(object sender, EventArgs e)
{
////用户验证
////用户验证
//if (DialogResult.OK != new UserLogin(true).ShowDialog())
//{
// return;
......@@ -244,7 +244,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
// if (expectEntityFrom.E_Expect.CompareTo(expectEntityTo.E_Expect) > 0)
// {
// MessageService.ShowMessage("期号查询条件前者不能大于后者!", "操作提示");
// MessageService.ShowMessage("期号查询条件前者不能大于后者!", "操作提示");
// this.autoEncashToolStrip.toolStripButtonLoad.Enabled = true;
// return;
// }
......@@ -262,7 +262,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
//}
if (selectedMachineNum == 0)
{
MessageService.ShowMessage("请选择机器号", "操作提示");
MessageService.ShowMessage("请选择机器号", "操作提示");
this.autoEncashToolStrip.toolStripButtonLoad.Enabled = true;
this.autoEncashToolStrip.toolStripButtonLoadBig.Enabled = true;
}
......@@ -271,7 +271,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception ex)
{
MessageService.ShowError(string.Concat("加载票异常。错误信息:", ex));
MessageService.ShowError(string.Concat("加载票异常。错误信息:", ex));
this.autoEncashToolStrip.toolStripButtonLoad.Enabled = true;
this.autoEncashToolStrip.toolStripButtonLoadBig.Enabled = true;
}
......
......@@ -35,31 +35,31 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
//private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
public AutoEncashToolStrip()
{
this.toolStripButtonSelect = new ToolStripButton("反选");
this.toolStripButtonSelect = new ToolStripButton("反选");
this.toolStripSeparator2 = new ToolStripSeparator();
this.toolStripLabelBoxLotType=new ToolStripLabel("彩种");
this.toolStripLabelBoxLotType=new ToolStripLabel("彩种");
this.toolStripComboBoxLotType = new ToolStripComboBox();
this.toolStripComboBoxLotType.DropDownStyle = ComboBoxStyle.DropDownList;
this.toolStripLabelAbbdate = new ToolStripLabel("日期/期号");
this.toolStripLabelAbbdate = new ToolStripLabel("日期/期号");
this.toolStripTextBoxAbbdate = new ToolStripTextBox();
this.toolStripLabelExpect=new ToolStripLabel("期号");
this.toolStripLabelExpect=new ToolStripLabel("期号");
this.toolStripComboBoxExpectFrom = new ToolStripComboBox();
this.toolStripComboBoxExpectFrom.DropDownStyle = ComboBoxStyle.DropDownList;
this.toolStripLabelTo = new ToolStripLabel("-");
this.toolStripComboBoxExpectTo = new ToolStripComboBox();
this.toolStripComboBoxExpectTo.DropDownStyle = ComboBoxStyle.DropDownList;
this.toolStripLabelType = new ToolStripLabel("加载方式");
this.toolStripLabelType = new ToolStripLabel("加载方式");
this.toolStripComboBoxType = new ToolStripComboBox();
this.toolStripComboBoxType.DropDownStyle = ComboBoxStyle.DropDownList;
this.toolStripLabelOption = new ToolStripLabel("兑奖选项");
this.toolStripLabelOption = new ToolStripLabel("兑奖选项");
this.toolStripComboBoxOption = new ToolStripComboBox();
this.toolStripComboBoxOption.DropDownStyle = ComboBoxStyle.DropDownList;
this.toolStripSeparator3=new ToolStripSeparator();
this.toolStripButtonLoad = new ToolStripButton("加载机器兑奖票");
this.toolStripButtonLoadBig = new ToolStripButton("加载中心兑奖票");
this.toolStripButtonStart = new ToolStripButton("开始打印");
this.toolStripButtonStop = new ToolStripButton("停止打印");
//this.toolStripButtonEncashConfig = new ToolStripButton("兑奖配置");
this.toolStripButtonLoad = new ToolStripButton("加载机器兑奖票");
this.toolStripButtonLoadBig = new ToolStripButton("加载中心兑奖票");
this.toolStripButtonStart = new ToolStripButton("开始打印");
this.toolStripButtonStop = new ToolStripButton("停止打印");
//this.toolStripButtonEncashConfig = new ToolStripButton("兑奖配置");
this.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
......@@ -139,7 +139,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
void toolStripComboBoxLotType_SelectedIndexChanged(object sender, EventArgs e)
{
//加载彩种期号列表
//加载彩种期号列表
try
{
M_LotTypeEntity lotTypeEntity = toolStripComboBoxLotType.SelectedItem as M_LotTypeEntity;
......@@ -187,7 +187,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
MessageService.ShowError(string.Concat("加载自动兑奖期号列表异常。错误信息:", exception.Message));
MessageService.ShowError(string.Concat("加载自动兑奖期号列表异常。错误信息:", exception.Message));
}
}
......
......@@ -58,7 +58,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("更新机器信息界面异常。错误信息:", exception.Message));
LoggingService.Info(string.Concat("更新机器信息界面异常。错误信息:", exception.Message));
}
}
void _service_EncashTicketLoaded(object sender, EventArgs e)
......@@ -71,7 +71,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("加载兑奖票完成更新界面异常。错误信息:", exception.Message));
LoggingService.Info(string.Concat("加载兑奖票完成更新界面异常。错误信息:", exception.Message));
}
}
void LotMachine_StatusChanged(object sender, MachineStatusArgs e)
......@@ -83,7 +83,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("机器状态变化更新界面异常。错误信息:", exception.Message));
LoggingService.Info(string.Concat("机器状态变化更新界面异常。错误信息:", exception.Message));
}
}
......@@ -97,7 +97,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("更新兑奖完成界面异常。错误信息:", exception.Message));
LoggingService.Info(string.Concat("更新兑奖完成界面异常。错误信息:", exception.Message));
}
}
......@@ -111,7 +111,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("更新兑奖中界面异常。错误信息:", exception.Message));
LoggingService.Info(string.Concat("更新兑奖中界面异常。错误信息:", exception.Message));
}
}
void ShowEncashTicket()
......@@ -162,7 +162,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
foreach (ListViewItem item in this.lvwTicket.CheckedItems)
{
//item.UseItemStyleForSubItems = false;
item.SubItems[item.SubItems.Count - 1].Text = "未打印";
item.SubItems[item.SubItems.Count - 1].Text = "未打印";
item.ForeColor = Color.Red;
L_LotTicketEntity entity = item.Tag as L_LotTicketEntity;
Service.WaitEncashTickets.Enqueue(entity);
......@@ -187,7 +187,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
{
if (IsSelected)
{
//this.lblPlayType.Text = "服务已停止";
//this.lblPlayType.Text = "服务已停止";
this.lblStatus.Image = Resources.Stop;
Service.Stop();
_service.LotMachine.MachineInfo.M_Status = (int)MachineStatusEnum.Stopped;
......@@ -208,7 +208,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
if(lineIndex>=0)
{
this.lvwTicket.Items[lineIndex].SubItems[2].Text = "打印中……";
this.lvwTicket.Items[lineIndex].SubItems[2].Text = "打印中……";
this.lvwTicket.Items[lineIndex].ForeColor = Color.Blue;
}
}
......@@ -226,9 +226,9 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
if (lineIndex >= 0)
{
//已兑奖移至尾行
//已兑奖移至尾行
this.lvwTicket.Items[lineIndex].Checked = false;
this.lvwTicket.Items[lineIndex].SubItems[2].Text = "打印完成"; ;
this.lvwTicket.Items[lineIndex].SubItems[2].Text = "打印完成"; ;
this.lvwTicket.Items[lineIndex].ForeColor = Color.Green;
this.lvwTicket.EnsureVisible(lineIndex);
//ListViewItem item = this.lvwTicket.Items[lineIndex];
......@@ -263,7 +263,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
{
ListViewItem listViewItem =
new ListViewItem(new string[]
{i.ToString(), ticket.L_TicketCode, "未打印"});
{i.ToString(), ticket.L_TicketCode, "未打印"});
listViewItem.ForeColor = Color.Red;
listViewItem.Checked = true;
listViewItem.Tag = ticket;
......@@ -282,7 +282,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
MessageService.ShowMessage(string.Concat("查看兑奖配置异常。错误信息:", exception.Message));
MessageService.ShowMessage(string.Concat("查看兑奖配置异常。错误信息:", exception.Message));
}
}
......@@ -293,7 +293,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
{
lvwTicket.Items[i].Checked = !lvwTicket.Items[i].Checked;
}
LoggingService.Info("反选成功!");
LoggingService.Info("反选成功!");
}
......@@ -303,13 +303,13 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
int to = 0;
if (!Int32.TryParse(this.textBox1.Text.Trim(), out from) || !Int32.TryParse(this.textBox2.Text.Trim(), out to))
{
MessageBox.Show("序号请填数字!");
MessageBox.Show("序号请填数字!");
return;
}
if (from >= to)
{
MessageBox.Show("前面的序号要小于后面的序号,请重填!");
MessageBox.Show("前面的序号要小于后面的序号,请重填!");
return;
}
......@@ -326,27 +326,27 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
}
LoggingService.Info("序号选择成功!");
LoggingService.Info("序号选择成功!");
}
private void lvwTicket_MouseDown(object sender, MouseEventArgs e)
{
//鼠标右键
//鼠标右键
if (e.Button == MouseButtons.Right)
{
//获取鼠标在listview1的坐标
//获取鼠标在listview1的坐标
System.Drawing.Point p = lvwTicket.PointToClient(Control.MousePosition);
ListViewItem item = lvwTicket.GetItemAt(p.X, p.Y);
if (item!=null)
{
L_LotTicketEntity entity = item.Tag as L_LotTicketEntity;
string text = entity.L_PrnText.Replace("\\", "");
//将内容添加到粘贴板中
//将内容添加到粘贴板中
try
{
Clipboard.SetDataObject(text);
MessageBox.Show(this, "复制成功");
MessageBox.Show(this, "复制成功");
}
catch (Exception ee)
{
......@@ -360,12 +360,12 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
{
if (this.lvwTicket.CheckedItems.Count == 0)
{
MessageBox.Show("请选择要导出的记录!");
MessageBox.Show("请选择要导出的记录!");
return;
}
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.Description = "请选择导出文件到哪个目录";
dialog.Description = "请选择导出文件到哪个目录";
//dialog.RootFolder = Environment.SpecialFolder.Programs;
if (dialog.ShowDialog() == DialogResult.OK)
{
......@@ -384,11 +384,11 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
try
{
File.WriteAllText(ticketFilePath, entity.L_PrnText);
LoggingService.Info(string.Concat("导出电子票文件:", ticketFilePath));
LoggingService.Info(string.Concat("导出电子票文件:", ticketFilePath));
}
catch (Exception exception)
{
LoggingService.Warn(string.Concat(ticketFilePath, "导出电子票文件异常。错误信息:", exception.ToString()));
LoggingService.Warn(string.Concat(ticketFilePath, "导出电子票文件异常。错误信息:", exception.ToString()));
}
}
}
......
......@@ -26,7 +26,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
{
try
{
this.Text = "兑奖参数配置";
this.Text = "兑奖参数配置";
M_MachineConfigTemplateService machineConfigTemplateService = new M_MachineConfigTemplateService();
EnumDescription[] machineTypes = EnumDescription.GetFieldTexts(typeof(MachineType));
......@@ -45,7 +45,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("兑奖配置对话框初始化失败。错误信息:", exception.Message));
LoggingService.Info(string.Concat("兑奖配置对话框初始化失败。错误信息:", exception.Message));
}
}
......@@ -68,23 +68,23 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
string beforeEncashKeys = this.txtBeforeEncashKeys.Text.Trim();
if(string.IsNullOrEmpty(beforeEncashKeys))
{
MessageService.ShowMessage("进入兑奖界面键码不得为空","操作提示");
MessageService.ShowMessage("进入兑奖界面键码不得为空","操作提示");
return;
}
string afterEncashKeys = this.txtAfterEncashKeys.Text.Trim();
if(string.IsNullOrEmpty(afterEncashKeys))
{
MessageService.ShowMessage("兑奖确认键码不得为空","操作提示");
MessageService.ShowMessage("兑奖确认键码不得为空","操作提示");
return;
}
if (string.IsNullOrEmpty(this.txtEncashKeyInterval.Text))
{
MessageService.ShowMessage("兑奖键码间隔不得为空", "操作提示");
MessageService.ShowMessage("兑奖键码间隔不得为空", "操作提示");
return;
}
if (string.IsNullOrEmpty(this.txtEncashInterval.Text))
{
MessageService.ShowMessage("两张票的间隔不得为空", "操作提示");
MessageService.ShowMessage("两张票的间隔不得为空", "操作提示");
return;
}
int encashKeyInterval = 300;
......@@ -93,13 +93,13 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
result = int.TryParse(this.txtEncashKeyInterval.Text, out encashKeyInterval);
if(!result)
{
MessageService.ShowMessage("兑奖键码间隔必须为整数", "操作提示");
MessageService.ShowMessage("兑奖键码间隔必须为整数", "操作提示");
return;
}
result = int.TryParse(this.txtEncashInterval.Text, out encashInterval);
if (!result)
{
MessageService.ShowMessage("两张票的间隔必须为整数", "操作提示");
MessageService.ShowMessage("两张票的间隔必须为整数", "操作提示");
return;
}
......@@ -113,7 +113,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
if(result)
{
ReloadEncashConfig();
MessageService.ShowMessage("兑奖配置保存成功", "操作提示");
MessageService.ShowMessage("兑奖配置保存成功", "操作提示");
}
}
}
......@@ -122,7 +122,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
}
catch (Exception exception)
{
MessageService.ShowMessage(string.Concat("兑奖配置保存失败。错误信息:", exception.Message));
MessageService.ShowMessage(string.Concat("兑奖配置保存失败。错误信息:", exception.Message));
this.DialogResult = DialogResult.Cancel;
}
}
......@@ -146,14 +146,14 @@ namespace ChuPiao.AutoPrint.Desktop.AutoEncash
// machineConfigTemplateService.GetBasicMachineModeConfigs(machineType.FieldName);
lotMachine.MachineInfo.MachineConfigEntity = machineConfig;
LoggingService.Info(string.Concat(lotMachine.MachineInfo.M_Number, "重新加载兑奖配置完成"));
LoggingService.Info(string.Concat(lotMachine.MachineInfo.M_Number, "重新加载兑奖配置完成"));
}
}
}
}
catch (Exception exception)
{
LoggingService.Warn(string.Concat("重新加载兑奖配置异常", exception.Message));
LoggingService.Warn(string.Concat("重新加载兑奖配置异常", exception.Message));
}
}
}
......
......@@ -32,27 +32,27 @@ namespace ChuPiao.AutoPrint.Desktop.ZxEncashTicket
if (string.IsNullOrEmpty(username))
{
errorProvider1.SetErrorAndLabel2(textBox_name, "不能为空!");
errorProvider1.SetErrorAndLabel2(textBox_name, "不能为空!");
return;
}
if (string.IsNullOrEmpty(pwd))
{
errorProvider1.SetErrorAndLabel2(textBox_pwd, "不能为空!");
errorProvider1.SetErrorAndLabel2(textBox_pwd, "不能为空!");
return;
}
if (username == "semaoji" && pwd == "lijia2012")
{
Logger.Log.Info("用户验证通过:" + username);
Logger.Log.Info("用户验证通过:" + username);
this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
else
{
MessageBox.Show("帐号或密码错误!");
MessageBox.Show("帐号或密码错误!");
return;
//MessageBox.Show("帐号或密码错误!");
//MessageBox.Show("帐号或密码错误!");
//this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
}
......@@ -67,7 +67,7 @@ namespace ChuPiao.AutoPrint.Desktop.ZxEncashTicket
{
if (_ismustadmin)
{
this.Text = "当前操作需要验证管理员身份!";
this.Text = "当前操作需要验证管理员身份!";
}
}
}
......
......@@ -60,7 +60,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
private void LastTicket_Load(object sender, EventArgs e)
{
this.Text = string.Concat(MacNumber,"最近出票记录【按出票时间由近到远排序】");
this.Text = string.Concat(MacNumber,"最近出票记录【按出票时间由近到远排序】");
this.dateTimePicker1.Value = DateTime.Now;
......@@ -69,7 +69,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
// TicketFilePath = Path.Combine(LogPath + DateTime.Now.ToString("yyyy-MM-dd"), "last");
// if(!Directory.Exists(TicketFilePath))
// {
// MessageService.ShowMessage(string.Concat("路径",TicketFilePath,"不存在!"));
// MessageService.ShowMessage(string.Concat("路径",TicketFilePath,"不存在!"));
// return;
// }
// DirectoryInfo directoryInfo=new DirectoryInfo(TicketFilePath);
......@@ -99,7 +99,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
//}
//catch (Exception exception)
//{
// MessageService.ShowMessage(string.Concat("查看最近出票记录初始化异常。错误信息:",exception.Message));
// MessageService.ShowMessage(string.Concat("查看最近出票记录初始化异常。错误信息:",exception.Message));
//}
}
......@@ -119,7 +119,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
byte[] arr = TicketTextUtil.DecryptAndDecompress(content);
string tmpStr = HexString.ByteToString(arr);
tmpStr = Regex.Replace(tmpStr, @"EE DD [\s\S]{2} [\s\S]{2} ", ""); //去掉干扰字符 EEDD开头的4位16进制
tmpStr = Regex.Replace(tmpStr, @"EE DD [\s\S]{2} [\s\S]{2} ", ""); //去掉干扰字符 EEDD开头的4位16进制
arr = HexString.StringToByte(tmpStr);
using (MemoryStream ms = new MemoryStream())
......@@ -129,7 +129,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
this.richTextBoxTicket.LoadFile(ms, RichTextBoxStreamType.PlainText);
}
if (this.richTextBoxTicket.Text.Contains("报表"))
if (this.richTextBoxTicket.Text.Contains("报表"))
{
this.btnPrint.Visible = true;
}
......@@ -142,7 +142,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
}
catch (Exception exception)
{
MessageService.ShowMessage(string.Concat("查看电子票内容异常。错误信息:", exception.Message));
MessageService.ShowMessage(string.Concat("查看电子票内容异常。错误信息:", exception.Message));
}
}
......@@ -163,23 +163,23 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
//ChuPiao.Common.Communication.CpdJson.PackRetBase packRetBase = ChuPiao.Common.Communication.CpdJson.PackManager.Instance.Transaction(MacNumber, reqPack);
//if (packRetBase == null)
//{
// throw new Exception(string.Concat("执行命令失败。机器号:", MacNumber));
// throw new Exception(string.Concat("执行命令失败。机器号:", MacNumber));
//}
//if (packRetBase.ReturnCode != 0)
//{
// throw new Exception(string.Concat("彩票机返回错误编码:", packRetBase.ReturnCode, " 错误信息:", packRetBase.ReturnMessage));
// throw new Exception(string.Concat("彩票机返回错误编码:", packRetBase.ReturnCode, " 错误信息:", packRetBase.ReturnMessage));
//}
}
}
catch (Exception exception)
{
MessageService.ShowError(string.Concat("打印电子票异常。错误信息:", exception.Message));
MessageService.ShowError(string.Concat("打印电子票异常。错误信息:", exception.Message));
}
}
private void splitContainer1_Panel2_DoubleClick(object sender, EventArgs e)
{
//用户验证
//用户验证
if (DialogResult.OK != new UserLogin(true).ShowDialog())
{
return;
......@@ -200,17 +200,17 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
//ChuPiao.Common.Communication.CpdJson.PackRetBase packRetBase = ChuPiao.Common.Communication.CpdJson.PackManager.Instance.Transaction(MacNumber, reqPack);
//if (packRetBase == null)
//{
// throw new Exception(string.Concat("执行命令失败。机器号:", MacNumber));
// throw new Exception(string.Concat("执行命令失败。机器号:", MacNumber));
//}
//if (packRetBase.ReturnCode != 0)
//{
// throw new Exception(string.Concat("彩票机返回错误编码:", packRetBase.ReturnCode, " 错误信息:", packRetBase.ReturnMessage));
// throw new Exception(string.Concat("彩票机返回错误编码:", packRetBase.ReturnCode, " 错误信息:", packRetBase.ReturnMessage));
//}
}
}
catch (Exception exception)
{
MessageService.ShowError(string.Concat("打印电子票异常。错误信息:", exception.Message));
MessageService.ShowError(string.Concat("打印电子票异常。错误信息:", exception.Message));
}
}
......@@ -223,8 +223,8 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
TicketFilePath = Path.Combine(LogPath + this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), "last");
if (!Directory.Exists(TicketFilePath))
{
//MessageService.ShowMessage(string.Concat("路径", TicketFilePath, "不存在!"));
this.labelMsg.Text= string.Concat(this.dateTimePicker1.Value.ToString("yyyy-MM-dd")+" 没有电子票!");
//MessageService.ShowMessage(string.Concat("路径", TicketFilePath, "不存在!"));
this.labelMsg.Text= string.Concat(this.dateTimePicker1.Value.ToString("yyyy-MM-dd")+" 没有电子票!");
return;
}
DirectoryInfo directoryInfo = new DirectoryInfo(TicketFilePath);
......@@ -232,7 +232,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
if (fileInfoList.Length == 0)
{
this.labelMsg.Text = string.Concat(this.dateTimePicker1.Value.ToString("yyyy-MM-dd") + " 没有电子票!");
this.labelMsg.Text = string.Concat(this.dateTimePicker1.Value.ToString("yyyy-MM-dd") + " 没有电子票!");
return;
}
......@@ -260,27 +260,27 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
}
catch (Exception exception)
{
MessageService.ShowMessage(string.Concat("查看最近出票记录初始化异常。错误信息:", exception.Message));
MessageService.ShowMessage(string.Concat("查看最近出票记录初始化异常。错误信息:", exception.Message));
}
}
private void lvwTicket_MouseDown(object sender, MouseEventArgs e)
{
//鼠标右键
//鼠标右键
if (e.Button == MouseButtons.Right)
{
//获取鼠标在listview1的坐标
//获取鼠标在listview1的坐标
Point p = lvwTicket.PointToClient(Control.MousePosition);
ListViewItem item = lvwTicket.GetItemAt(p.X, p.Y);
if (item!=null)
{
FileInfo fileInfo = item.Tag as FileInfo;
string text = File.ReadAllText(fileInfo.FullName);
//将内容添加到粘贴板中
//将内容添加到粘贴板中
try
{
Clipboard.SetDataObject(text);
MessageBox.Show(this, "复制成功");
MessageBox.Show(this, "复制成功");
}
catch (Exception ee)
{
......@@ -294,7 +294,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Multiselect = true;
dialog.Title = "请选择文件";
dialog.Title = "请选择文件";
dialog.Filter = "(*.prn)|*.prn";
if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
{
......@@ -309,7 +309,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
}
catch (Exception ex)
{
MessageBox.Show(string.Concat("文件:", filename, ",打印票异常"));
MessageBox.Show(string.Concat("文件:", filename, ",打印票异常"));
}
}
......
......@@ -15,8 +15,8 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
public LogTabControl()
{
this.Controls.Clear();
tabPageSystemLogs = new TabPage("ϵͳ־");
tabPageAlertLogs = new TabPage("־");
tabPageSystemLogs = new TabPage("系统日志");
tabPageAlertLogs = new TabPage("警告日志");
tabPageSystemLogs.Controls.Add(richTextBoxSystemLogs);
tabPageAlertLogs.Controls.Add(richTextBoxAlertLogs);
richTextBoxAlertLogs.Dock = DockStyle.Fill;
......
......@@ -39,14 +39,14 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
{
try
{
this.Text = string.Concat(MacNumber, "等待出票任务列表【排序优先级:截止时间>彩种>期号>玩法>金额>下载时间】");
this.Text = string.Concat(MacNumber, "等待出票任务列表【排序优先级:截止时间>彩种>期号>玩法>金额>下载时间】");
if(_tickets!=null)
{
this.lvwTicket.Items.Clear();
int index = 1;
foreach (L_LotTicketEntity ticket in Tickets)
{
//序号 彩种 玩法 用户订单号 生产流水号 金额 倍数 下载时间 截止时间 投注号码
//序号 彩种 玩法 用户订单号 生产流水号 金额 倍数 下载时间 截止时间 投注号码
lvwTicket.Items.Add(new ListViewItem(new string[] { index.ToString(), ticket.L_LotName, ticket.L_PlayName, ticket.L_OrderSn, ticket.L_TicketSn, ticket.L_Money.ToString("0"), ticket.L_Mutiple.ToString(), ticket.L_AddTime.ToString("yyyy-MM-dd HH:mm:ss"), ticket.L_EndTime.ToString("yyyy-MM-dd HH:mm:ss"), ticket.L_Code }));
index++;
}
......@@ -54,7 +54,7 @@ namespace ChuPiao.AutoPrint.Desktop.AutoPrint
}
catch (Exception exception)
{
MessageService.ShowMessage(string.Concat("查看等待出票队列异常。错误信息:",exception.Message));
MessageService.ShowMessage(string.Concat("查看等待出票队列异常。错误信息:",exception.Message));
}
}
......
......@@ -12,9 +12,17 @@ namespace ChuPiao.AutoPrint.Desktop
[STAThread()]
public static void Main(string[] args)
{
if (ChuPiao.Common.HD.GConfig.IsTest) {
RunApplication();
return;
}
#if DEBUG
if (Debugger.IsAttached)
{
RunApplication();
return;
}
......@@ -22,7 +30,7 @@ namespace ChuPiao.AutoPrint.Desktop
int runNum = IsMainAppRun("ChuPiao.AutoPrint.Desktop.exe");
if (runNum > 1)
{
MessageBox.Show("程序已经运行,请不要重复开启");
MessageBox.Show("程序已经运行,请不要重复开启");
return;
}
......@@ -88,7 +96,7 @@ namespace ChuPiao.AutoPrint.Desktop
pro.StartInfo.UseShellExecute = false;
pro.StartInfo.CreateNoWindow = true;
pro.Start();
//主程序一直等待更新程序,要么不需要更新(更新程序会退出),要么被更新程序关掉主程序
//主程序一直等待更新程序,要么不需要更新(更新程序会退出),要么被更新程序关掉主程序
while (!pro.HasExited)
{
pro.WaitForExit(1000);
......@@ -100,7 +108,7 @@ namespace ChuPiao.AutoPrint.Desktop
}
catch (Exception exception)
{
MessageBox.Show("自动升级异常。错误信息:" + exception.Message, "错误提示", MessageBoxButtons.OK,MessageBoxIcon.Error);
MessageBox.Show("自动升级异常。错误信息:" + exception.Message, "错误提示", MessageBoxButtons.OK,MessageBoxIcon.Error);
return false;
}
}
......@@ -108,10 +116,10 @@ namespace ChuPiao.AutoPrint.Desktop
}
/// <summary>
/// 判断是否程序正在运行,是的话则关闭程序
/// 判断是否程序正在运行,是的话则关闭程序
/// </summary>
/// <param name="mainapp">程序名</param>
/// <returns>是否程序正在运行</returns>
/// <param name="mainapp">程序名</param>
/// <returns>是否程序正在运行</returns>
static int IsMainAppRun(string mainapp)
{
int num = 0;
......
......@@ -19,7 +19,7 @@ namespace ChuPiao.AutoPrint.Desktop
protected void SetControlEnable(Control contro, bool state)
{
if (contro.InvokeRequired) //ڸ߳
if (contro.InvokeRequired) //在辅助线程内
{
ControlEnableInvoker d = new ControlEnableInvoker(SetControlEnable);
this.Invoke(d, new object[] { contro, state });
......
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -8,10 +9,16 @@
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ChuPiao.AutoPrint.Desktop</RootNamespace>
<AssemblyName>ChuPiao.AutoPrint.Desktop</AssemblyName>
<AssemblyName>ChuPiao.AutoPrint.Desktop1</AssemblyName>
<ApplicationIcon>Computer.ico</ApplicationIcon>
<TargetZone>LocalIntranet</TargetZone>
<GenerateManifests>false</GenerateManifests>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......
......@@ -25,7 +25,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
}
catch (Exception exception)
{
MessageService.ShowMessage(string.Concat("保存计算机信息异常。错误信息:",exception.Message));
MessageService.ShowMessage(string.Concat("保存计算机信息异常。错误信息:",exception.Message));
this.DialogResult = DialogResult.Cancel;
}
}
......@@ -45,7 +45,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
//读取 电脑是否接了打印机 的设置
//读取 电脑是否接了打印机 的设置
bool result = true;
string strtmp = LocalConfigUtil.GetConfig("hasComputerPrinter");
if (!string.IsNullOrEmpty(strtmp))
......@@ -55,21 +55,21 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
chkHasComputerPrinter.CheckedChanged-=new EventHandler(chkHasComputerPrinter_CheckedChanged);
chkHasComputerPrinter.Checked = result;
chkHasComputerPrinter.CheckedChanged += new EventHandler(chkHasComputerPrinter_CheckedChanged);
LoggingService.Info(string.Format("出票电脑是否接了打印机:{0}", result ? "是" : "否"));
LoggingService.Info(string.Format("出票电脑是否接了打印机:{0}", result ? "是" : "否"));
checkBox1.CheckedChanged -= new EventHandler(checkBox1_CheckedChanged);
checkBox1.Checked = BeepUtil.notUseBeep;
checkBox1.CheckedChanged += new EventHandler(checkBox1_CheckedChanged);
LoggingService.Info(string.Format("出票电脑蜂鸣器不发声:{0}", result ? "是" : "否"));
LoggingService.Info(string.Format("出票电脑蜂鸣器不发声:{0}", result ? "是" : "否"));
textBox1.Text = BeepUtil.fileToPlay;
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("控制电脑注册信息对话框初始化失败。错误信息:",exception.Message));
LoggingService.Info(string.Concat("控制电脑注册信息对话框初始化失败。错误信息:",exception.Message));
}
}
......@@ -89,7 +89,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
// break;
// case PrinterPortType.ComPort:
// string address = System.Configuration.ConfigurationManager.AppSettings.Get("Address");
// if (address.Trim() == "天津竞彩")
// if (address.Trim() == "天津竞彩")
// {
// this.txtPrinterPortBps.Text = "19200";
// }
......@@ -109,7 +109,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
//}
//catch (Exception exception)
//{
// LoggingService.Info(string.Concat("设置端口默认波特率失败。错误信息:", exception.Message));
// LoggingService.Info(string.Concat("设置端口默认波特率失败。错误信息:", exception.Message));
//}
}
......@@ -118,14 +118,14 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
LocalConfigUtil.SaveConfig("hasComputerPrinter", chkHasComputerPrinter.Checked.ToString());
LoggingService.Info(string.Format("把【出票电脑是否接了打印机】设置成了:{0}", chkHasComputerPrinter.Checked ? "是" : "否"));
LoggingService.Info(string.Format("把【出票电脑是否接了打印机】设置成了:{0}", chkHasComputerPrinter.Checked ? "是" : "否"));
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
LocalConfigUtil.SaveConfig("notUseBeep", checkBox1.Checked.ToString());
BeepUtil.notUseBeep = checkBox1.Checked;
LoggingService.Info(string.Format("把【蜂鸣器不发声】设置成了:{0}", checkBox1.Checked ? "是" : "否"));
LoggingService.Info(string.Format("把【蜂鸣器不发声】设置成了:{0}", checkBox1.Checked ? "是" : "否"));
}
private void button1_Click(object sender, EventArgs e)
......@@ -135,7 +135,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
textBox1.Text = openFileDialog1.FileName;
LocalConfigUtil.SaveConfig("fileToPlay", openFileDialog1.FileName);
BeepUtil.fileToPlay = openFileDialog1.FileName;
LoggingService.Info(string.Format("把【蜂鸣器不发声】设置成了:{0}", checkBox1.Checked ? "是" : "否"));
LoggingService.Info(string.Format("把【蜂鸣器不发声】设置成了:{0}", checkBox1.Checked ? "是" : "否"));
}
......
......@@ -66,7 +66,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
}
this.dataGridView1.DataSource = list;
this.label1.Text = string.Format("ϼƣ{0} {1:0} Ԫ", ticket, money);
this.label1.Text = string.Format("合计:{0} 张 {1:0} 元", ticket, money);
}
......
......@@ -90,11 +90,11 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(242, 106);
this.label11.Location = new System.Drawing.Point(266, 106);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(113, 12);
this.label11.Size = new System.Drawing.Size(89, 12);
this.label11.TabIndex = 72;
this.label11.Text = "模拟打印机波特率:";
this.label11.Text = "打印机波特率:";
//
// txtPrinterBps
//
......@@ -102,16 +102,16 @@
this.txtPrinterBps.Name = "txtPrinterBps";
this.txtPrinterBps.Size = new System.Drawing.Size(100, 21);
this.txtPrinterBps.TabIndex = 13;
this.txtPrinterBps.Text = "57600";
this.txtPrinterBps.Text = "115200";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(11, 106);
this.label12.Location = new System.Drawing.Point(36, 106);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(113, 12);
this.label12.Size = new System.Drawing.Size(89, 12);
this.label12.TabIndex = 70;
this.label12.Text = "模拟打印机端口号:";
this.label12.Text = "打印机端口号:";
//
// txtPrinterPort
//
......
......@@ -37,38 +37,38 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
machine.M_ZxPassword = this.txtZxPassword.Text.Trim();
machine.M_Salt = this.textBoxSalt.Text.Trim();
//输入验证
//输入验证
if(string.IsNullOrEmpty(machine.M_Number))
{
MessageService.ShowMessage("站点编号不得为空!");
MessageService.ShowMessage("站点编号不得为空!");
return;
}
if (string.IsNullOrEmpty(machine.M_Salt))
{
MessageService.ShowMessage("Salt不得为空!");
MessageService.ShowMessage("Salt不得为空!");
return;
}
if (string.IsNullOrEmpty(machine.M_ZxPassword))
{
MessageService.ShowMessage("彩票机密码不得为空!");
MessageService.ShowMessage("彩票机密码不得为空!");
return;
}
if (AutoPrintServiceManager.MachineXmlEntityDic.ContainsKey(machine.M_Number))
{
MessageService.ShowMessage("站点编号已存在!");
MessageService.ShowMessage("站点编号已存在!");
return;
}
AutoPrintServiceManager.MachineXmlEntityDic.Add(machine.M_Number,machine);
MachineXmlConfig.SaveMachineList(new List<MachineXmlEntity>(AutoPrintServiceManager.MachineXmlEntityDic.Values));
MessageService.ShowMessage("添加彩票机信息成功,重启软件后生效。");
MessageService.ShowMessage("添加彩票机信息成功,重启软件后生效。");
this.DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
MessageService.ShowMessage(string.Concat("添加彩票机信息异常。错误信息:", exception.Message));
MessageService.ShowMessage(string.Concat("添加彩票机信息异常。错误信息:", exception.Message));
//this.DialogResult = DialogResult.Cancel;
}
}
......@@ -86,7 +86,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("彩票机注册对话框初始化失败。错误信息:", exception.Message));
LoggingService.Info(string.Concat("彩票机注册对话框初始化失败。错误信息:", exception.Message));
}
}
......
......@@ -135,11 +135,11 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(243, 110);
this.label11.Location = new System.Drawing.Point(267, 110);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(113, 12);
this.label11.Size = new System.Drawing.Size(89, 12);
this.label11.TabIndex = 72;
this.label11.Text = "模拟打印机波特率:";
this.label11.Text = "打印机波特率:";
//
// txtPrinterBps
//
......@@ -151,11 +151,11 @@
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(10, 110);
this.label12.Location = new System.Drawing.Point(36, 110);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(113, 12);
this.label12.Size = new System.Drawing.Size(89, 12);
this.label12.TabIndex = 70;
this.label12.Text = "模拟打印机端口号:";
this.label12.Text = "打印机端口号:";
//
// txtPrinterPort
//
......@@ -183,7 +183,7 @@
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(23, 82);
this.label9.Location = new System.Drawing.Point(24, 82);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(101, 12);
this.label9.TabIndex = 66;
......@@ -215,7 +215,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(59, 22);
this.label1.Location = new System.Drawing.Point(60, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 42;
......
......@@ -28,13 +28,13 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
{
if (string.IsNullOrEmpty(this.textBoxSalt.Text.Trim()))
{
MessageService.ShowMessage("Salt不得为空!");
MessageService.ShowMessage("Salt不得为空!");
return;
}
if (string.IsNullOrEmpty(this.txtZxPassword.Text.Trim()))
{
MessageService.ShowMessage("彩票机密码不得为空!");
MessageService.ShowMessage("彩票机密码不得为空!");
return;
}
......@@ -53,12 +53,12 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
MachineXmlConfig.SaveMachineList(new List<MachineXmlEntity>(AutoPrintServiceManager.MachineXmlEntityDic.Values));
MessageService.ShowMessage("修改彩票机信息成功,重启软件后生效。");
MessageService.ShowMessage("修改彩票机信息成功,重启软件后生效。");
this.DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
MessageService.ShowMessage(string.Concat("保存彩票机信息异常。错误信息:", exception.Message));
MessageService.ShowMessage(string.Concat("保存彩票机信息异常。错误信息:", exception.Message));
//this.DialogResult = DialogResult.Cancel;
}
}
......@@ -88,7 +88,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
}
catch (Exception exception)
{
LoggingService.Info(string.Concat("彩票机信息对话框初始化失败。错误信息:", exception.Message));
LoggingService.Info(string.Concat("彩票机信息对话框初始化失败。错误信息:", exception.Message));
}
}
......
......@@ -90,7 +90,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
MachineXmlConfig.SaveMachineList(new List<MachineXmlEntity>(AutoPrintServiceManager.MachineXmlEntityDic.Values));
MessageService.ShowMessage("修改可出票彩种为["+lotstr+"]成功,立即生效!");
MessageService.ShowMessage("修改可出票彩种为["+lotstr+"]成功,立即生效!");
this.DialogResult = DialogResult.OK;
}
}
......
......@@ -49,7 +49,7 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
{
if (!Int32.TryParse(textBoxInput.Text.Trim(), out keyInterval))
{
MessageService.ShowMessage("键码间隔请设置成整数值!");
MessageService.ShowMessage("键码间隔请设置成整数值!");
return;
}
......@@ -61,14 +61,14 @@ namespace ChuPiao.AutoPrint.Desktop.Dialogs
int ticketInterval;
if (!Int32.TryParse(textBoxInput2.Text.Trim(), out ticketInterval))
{
MessageService.ShowMessage("票间隔请设置成整数值!");
MessageService.ShowMessage("票间隔请设置成整数值!");
return;
}
LocalConfigUtil.TicketInterval = ticketInterval;
LocalConfigUtil.SaveConfig("TicketInterval", ticketInterval.ToString());
MessageService.ShowMessage("键码间隔【" + keyInterval.ToString() + "】,票间隔【" + ticketInterval.ToString() + "】,立即生效!");
MessageService.ShowMessage("键码间隔【" + keyInterval.ToString() + "】,票间隔【" + ticketInterval.ToString() + "】,立即生效!");
this.DialogResult = DialogResult.OK;
}
......
......@@ -224,7 +224,7 @@ namespace ChuPiao.AutoPrint.Desktop
void CloseButtonClick(object sender, EventArgs e)
{
if (MessageBox.Show("您真的要退出吗? 所有未保存的修改都将丢失!", MessageService.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly)
if (MessageBox.Show("您真的要退出吗? 所有未保存的修改都将丢失!", MessageService.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly)
== DialogResult.Yes)
{
Application.Exit();
......@@ -252,7 +252,7 @@ namespace ChuPiao.AutoPrint.Desktop
this.closeButton.Name = "closeButton";
this.closeButton.Size = new System.Drawing.Size(141, 23);
this.closeButton.TabIndex = 5;
this.closeButton.Text = "退出";
this.closeButton.Text = "退出";
this.closeButton.Click += new System.EventHandler(this.CloseButtonClick);
//
// label3
......@@ -261,7 +261,7 @@ namespace ChuPiao.AutoPrint.Desktop
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(448, 23);
this.label3.TabIndex = 9;
this.label3.Text = "非常感谢您为使AutoPrint成为更出色的工具而做出贡献!";
this.label3.Text = "非常感谢您为使AutoPrint成为更出色的工具而做出贡献!";
//
// label2
//
......@@ -269,7 +269,7 @@ namespace ChuPiao.AutoPrint.Desktop
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(448, 95);
this.label2.TabIndex = 8;
this.label2.Text = "有效地报告错误的方法: 我们已经为AutoPrint用户建立了报告和跟踪错误的网站. 为了尽可能减少大家重复的问题, 最简单的办法是直接将系统报告的错误复制到剪贴板上再复制到网页上, 此外我们还希望您详细描述您在产生错误前的每一步操作.";
this.label2.Text = "有效地报告错误的方法: 我们已经为AutoPrint用户建立了报告和跟踪错误的网站. 为了尽可能减少大家重复的问题, 最简单的办法是直接将系统报告的错误复制到剪贴板上再复制到网页上, 此外我们还希望您详细描述您在产生错误前的每一步操作.";
//
// label
//
......@@ -277,7 +277,7 @@ namespace ChuPiao.AutoPrint.Desktop
this.label.Name = "label";
this.label.Size = new System.Drawing.Size(448, 48);
this.label.TabIndex = 6;
this.label.Text = "AutoPrint出现了未处理的异常. 此异常未经处理, 我们希望您报告此异常给AutoPrint开发小组以改进AutoPrint.";
this.label.Text = "AutoPrint出现了未处理的异常. 此异常未经处理, 我们希望您报告此异常给AutoPrint开发小组以改进AutoPrint.";
//
// continueButton
//
......@@ -285,7 +285,7 @@ namespace ChuPiao.AutoPrint.Desktop
this.continueButton.Name = "continueButton";
this.continueButton.Size = new System.Drawing.Size(88, 23);
this.continueButton.TabIndex = 6;
this.continueButton.Text = "继续";
this.continueButton.Text = "继续";
this.continueButton.Click += new System.EventHandler(this.continueButtonClick);
//
// reportButton
......@@ -294,7 +294,7 @@ namespace ChuPiao.AutoPrint.Desktop
this.reportButton.Name = "reportButton";
this.reportButton.Size = new System.Drawing.Size(209, 23);
this.reportButton.TabIndex = 4;
this.reportButton.Text = "向AutoPrint开发小组报告错误";
this.reportButton.Text = "向AutoPrint开发小组报告错误";
this.reportButton.Click += new System.EventHandler(this.buttonClick);
//
// copyErrorCheckBox
......@@ -305,7 +305,7 @@ namespace ChuPiao.AutoPrint.Desktop
this.copyErrorCheckBox.Name = "copyErrorCheckBox";
this.copyErrorCheckBox.Size = new System.Drawing.Size(440, 24);
this.copyErrorCheckBox.TabIndex = 2;
this.copyErrorCheckBox.Text = "把错误信息复制到剪贴板";
this.copyErrorCheckBox.Text = "把错误信息复制到剪贴板";
//
// exceptionTextBox
//
......@@ -342,7 +342,7 @@ namespace ChuPiao.AutoPrint.Desktop
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ExceptionBox";
this.Text = "发生了未处理的异常";
this.Text = "发生了未处理的异常";
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
......
......@@ -17,51 +17,51 @@ namespace ChuPiao.AutoPrint.Desktop.Machine
private void ConfigListView_Load(object sender, EventArgs e)
{
//更改属性
this.listView1.GridLines = true;//显示表格线
this.listView1.View = View.Details;//显示表格细节
this.listView1.LabelEdit = true; //是否可编辑,ListView只可编辑第一列。
this.listView1.Scrollable = true;//有滚动条
//更改属性
this.listView1.GridLines = true;//显示表格线
this.listView1.View = View.Details;//显示表格细节
this.listView1.LabelEdit = true; //是否可编辑,ListView只可编辑第一列。
this.listView1.Scrollable = true;//有滚动条
this.listView1.HeaderStyle = ColumnHeaderStyle.Clickable;
this.listView1.FullRowSelect = true;//对当行选择,对于子项全部突出设置
this.listView1.FullRowSelect = true;//对当行选择,对于子项全部突出设置
this.listView1.HotTracking = true;;//当鼠标悬停在项上时,允许项显示为超链接
this.listView1.HotTracking = true;;//当鼠标悬停在项上时,允许项显示为超链接
// 当选择此属性时则HoverSelection自动为true和Activation属性为oneClick
// 当选择此属性时则HoverSelection自动为true和Activation属性为oneClick
//this.listView1.HoverSelection = true;
//this.listView1.Activation = ItemActivation.Standard;
//添加表头
//添加表头
this.listView1.Columns.Add("", 0);
this.listView1.Columns.Add("列1", 80);
this.listView1.Columns.Add("列2", 160);
this.listView1.Columns.Add("1", 80);
this.listView1.Columns.Add("2", 160);
//表头居中
//表头居中
//listView1.Columns[0].TextAlign = HorizontalAlignment.Center;
foreach (ColumnHeader i in listView1.Columns)
{
i.TextAlign = HorizontalAlignment.Center;
}
//添加各项
//添加各项
ListViewItem[] p = new ListViewItem[2];
p[0] = new ListViewItem(new string[] { "aaaa", "bbbb" });
p[1] = new ListViewItem(new string[] { "cccc", "ggggg" });
p[0].SubItems[0].BackColor = Color.Red;//用于设置某行的背景颜色
p[0].SubItems[0].BackColor = Color.Red;//用于设置某行的背景颜色
this.listView1.Items.AddRange(p);
//也可以用this.listView1.Items.Add();不过需要在使用的前后添加Begin... 和End...防止界面自动刷新
// 添加分组
//也可以用this.listView1.Items.Add();不过需要在使用的前后添加Begin... 和End...防止界面自动刷新
// 添加分组
this.listView1.Groups.Add(new ListViewGroup("tou"));
this.listView1.Groups.Add(new ListViewGroup("wei"));
this.listView1.Items[0].Group = this.listView1.Groups[0];
this.listView1.Items[1].Group = this.listView1.Groups[1];
//编辑,行(aaaa,bbbb)中"bbbb"->"111"
//编辑,行(aaaa,bbbb)中"bbbb"->"111"
listView1.Items[0].SubItems[1].Text = "111";
}
......
......@@ -11,7 +11,7 @@ namespace ChuPiao.AutoPrint.Desktop.Machine
public MachineConfigTabPage()
{
this.Text = "ϵͳ";
this.Text = "系统配置";
this.Dock = DockStyle.Fill;
_configListView=new ConfigListView();
this.Controls.Add(_configListView);
......
......@@ -10,7 +10,7 @@ namespace ChuPiao.AutoPrint.Desktop.Machine
public System.Windows.Forms.ToolStripButton ToolStripButtonAdd;
public MachineConfigToolStrip()
{
this.ToolStripButtonAdd = new System.Windows.Forms.ToolStripButton("ӻ");
this.ToolStripButtonAdd = new System.Windows.Forms.ToolStripButton("添加机器");
this.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripButtonAdd});
this.ToolStripButtonAdd.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
......
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:2.0.50727.5466
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
......@@ -13,13 +13,13 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
......@@ -33,7 +33,7 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
......@@ -47,7 +47,7 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
/// <summary>
/// 为使用此强类型资源类的所有资源查找
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
......@@ -60,6 +60,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Bell {
get {
object obj = ResourceManager.GetObject("Bell", resourceCulture);
......@@ -67,6 +70,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap ClearWarn {
get {
object obj = ResourceManager.GetObject("ClearWarn", resourceCulture);
......@@ -74,6 +80,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找类似于 (Icon) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
internal static System.Drawing.Icon Computer {
get {
object obj = ResourceManager.GetObject("Computer", resourceCulture);
......@@ -81,6 +90,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Continue {
get {
object obj = ResourceManager.GetObject("Continue", resourceCulture);
......@@ -88,6 +100,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Copy {
get {
object obj = ResourceManager.GetObject("Copy", resourceCulture);
......@@ -95,6 +110,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Cut {
get {
object obj = ResourceManager.GetObject("Cut", resourceCulture);
......@@ -102,6 +120,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Pause {
get {
object obj = ResourceManager.GetObject("Pause", resourceCulture);
......@@ -109,6 +130,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap PrintTest {
get {
object obj = ResourceManager.GetObject("PrintTest", resourceCulture);
......@@ -116,6 +140,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Refresh1 {
get {
object obj = ResourceManager.GetObject("Refresh1", resourceCulture);
......@@ -123,6 +150,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Run {
get {
object obj = ResourceManager.GetObject("Run", resourceCulture);
......@@ -130,6 +160,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Search {
get {
object obj = ResourceManager.GetObject("Search", resourceCulture);
......@@ -137,6 +170,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Stop {
get {
object obj = ResourceManager.GetObject("Stop", resourceCulture);
......@@ -144,6 +180,9 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Warning {
get {
object obj = ResourceManager.GetObject("Warning", resourceCulture);
......
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:2.0.50727.3625
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
......@@ -12,7 +12,7 @@ namespace ChuPiao.AutoPrint.Desktop.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
......@@ -56,7 +56,7 @@ namespace ChuPiao.AutoPrint.Desktop.StatusBar
stopWarnButton.Image = Resources.Warning;
stopWarnButton.ForeColor = Color.Red;
stopWarnButton.Text = "ֹͣ";
stopWarnButton.Text = "停止报警";
stopWarnButton.Visible = false;
stopWarnButton.Click += new EventHandler(toolStripSplitButton_Click);
......
......@@ -32,17 +32,17 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
try
{
this.Dock = DockStyle.Fill;
this.Text = "日志输出";
this.Text = "日志输出";
this.flowLayoutPanel1.Controls.Clear();
//配置MemoryAppender
//配置MemoryAppender
_memoryAppender = new MemoryAppender();
BasicConfigurator.Configure(_memoryAppender);
RadioButton radioButton = new RadioButton();
radioButton.Checked = true;
radioButton.CheckedChanged += new EventHandler(radioButton_CheckedChanged);
radioButton.Text = "全部日志";
radioButton.Text = "全部日志";
radioButton.Tag = "all";
radioButton.Name = "radioButton_all";
radioButton.AutoSize = true;
......@@ -50,7 +50,7 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
radioButton = new RadioButton();
radioButton.Checked = false;
radioButton.CheckedChanged += new EventHandler(radioButton_CheckedChanged);
radioButton.Text = "系统日志";
radioButton.Text = "系统日志";
radioButton.Tag = "default";
radioButton.Name = "radioButton_default";
radioButton.AutoSize = true;
......@@ -62,7 +62,7 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
radioButton = new RadioButton();
radioButton.Checked = false;
radioButton.CheckedChanged += new EventHandler(radioButton_CheckedChanged);
radioButton.Text = entity.M_Number + "日志";
radioButton.Text = entity.M_Number + "日志";
radioButton.Tag = log.Logger.Name;
radioButton.Name = "radioButton_" + entity.M_Number;
radioButton.AutoSize = true;
......@@ -74,11 +74,11 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
}
catch (Exception exception)
{
MessageBox.Show(string.Concat("日志输出窗口加载异常:", exception));
MessageBox.Show(string.Concat("日志输出窗口加载异常:", exception));
}
}
/// <summary>
/// 切换日志类别
/// 切换日志类别
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
......@@ -101,15 +101,15 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
}
catch (Exception exception)
{
MessageBox.Show(string.Concat("切换日志类别异常:", exception));
MessageBox.Show(string.Concat("切换日志类别异常:", exception));
}
}
//日志显示最大行数
//日志显示最大行数
private const int MAXLOGLINE = 500;
//日志显示最小行数
//日志显示最小行数
private const int MINLOGLINE = 100;
/// <summary>
/// 日志定时刷新事件
/// 日志定时刷新事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
......@@ -129,11 +129,11 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
if (loggingEvent.Level.Value >= 60000)
{
//warn以上级别日志
//warn以上级别日志
//if (txtWarnLog.Lines.Length > MAXLOGLINE)
//{
// //仅保留最近的n行(n=MINLOGLINE)
// //仅保留最近的n行(n=MINLOGLINE)
// string[] tmpArr = new string[MINLOGLINE];
// Array.Copy(txtWarnLog.Lines, txtWarnLog.Lines.Length - MINLOGLINE, tmpArr, 0, MINLOGLINE);
// this.txtWarnLog.Lines = tmpArr;
......@@ -161,30 +161,30 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
StatusBarService.ShowWarnButton();
}
//有报这个错,就不允许开始出票
if (loggingEvent.RenderedMessage.Contains("函数不正确"))
//有报这个错,就不允许开始出票
if (loggingEvent.RenderedMessage.Contains("函数不正确"))
{
AutoPrintService.isCOMOK = false;
MessageService.ShowMessage("COM口异常,不能开启出票!!!请尝试重启软件、电脑", "操作提示");
MessageService.ShowMessage("COM口异常,不能开启出票!!!请尝试重启软件、电脑", "操作提示");
}
}
else
{
if (logname != "default" && loggingEvent.Level.Value <= 30000)
{
//debug日志
//debug日志
continue;
}
//info日志
//info日志
if (logname != "all" && loggingEvent.LoggerName != logname)
{
//仅显示当前指定类别的日志
//仅显示当前指定类别的日志
continue;
}
//if (txtLog.Lines.Length > MAXLOGLINE)
//{
// //仅保留最近的n行(n=MINLOGLINE)
// //仅保留最近的n行(n=MINLOGLINE)
// string[] tmpArr = new string[MINLOGLINE];
// Array.Copy(txtLog.Lines, txtLog.Lines.Length - MINLOGLINE, tmpArr, 0, MINLOGLINE);
// this.txtLog.Lines = tmpArr;
......@@ -200,14 +200,14 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
}
if (txtWarnLog.Lines.Length > MAXLOGLINE)
{
//仅保留最近的n行(n=MINLOGLINE)
//仅保留最近的n行(n=MINLOGLINE)
string[] tmpArr = new string[MINLOGLINE];
Array.Copy(txtWarnLog.Lines, txtWarnLog.Lines.Length - MINLOGLINE, tmpArr, 0, MINLOGLINE);
this.txtWarnLog.Lines = tmpArr;
}
if (txtLog.Lines.Length > MAXLOGLINE)
{
//仅保留最近的n行(n=MINLOGLINE)
//仅保留最近的n行(n=MINLOGLINE)
string[] tmpArr = new string[MINLOGLINE];
Array.Copy(txtLog.Lines, txtLog.Lines.Length - MINLOGLINE, tmpArr, 0, MINLOGLINE);
this.txtLog.Lines = tmpArr;
......@@ -216,12 +216,12 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
}
catch (Exception exception)
{
LoggingService.Debug(string.Concat("刷新日志异常:",exception));
LoggingService.Debug(string.Concat("刷新日志异常:",exception));
}
}
/// <summary>
/// 双击文本框查看日志
/// 双击文本框查看日志
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
......@@ -238,11 +238,11 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
}
catch (Exception exception)
{
MessageBox.Show(string.Concat("查看日志信息异常:",exception));
MessageBox.Show(string.Concat("查看日志信息异常:",exception));
}
}
/// <summary>
/// 复制到剪切板
/// 复制到剪切板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
......@@ -251,7 +251,7 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
ClipboardUtil.SetText(this.txtWarnLog.Text);
}
/// <summary>
/// 剪切到剪切板
/// 剪切到剪切板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
......@@ -261,7 +261,7 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
this.txtWarnLog.Text = "";
}
/// <summary>
/// 清空
/// 清空
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
......@@ -270,7 +270,7 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
this.txtWarnLog.Text = "";
}
/// <summary>
/// 停止报警
/// 停止报警
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
......
......@@ -4,7 +4,7 @@ using System.Windows.Forms;
namespace ChuPiao.AutoPrint.Desktop.Workbench
{
/// <summary>
/// 鿴־
/// 查看日志窗口
/// </summary>
public partial class ShowLogForm : Form
{
......@@ -16,7 +16,7 @@ namespace ChuPiao.AutoPrint.Desktop.Workbench
private void ShowLogForm_Load(object sender, EventArgs e)
{
this.Text = "鿴־";
this.Text = "查看日志";
}
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ using ChuPiao.AutoPrint.Services.AutoPrint;
using ChuPiao.Common.Models;
using ChuPiao.Common.Utils;
using ChuPiao.AutoPrint.Services.OpenCode;
using ChuPiao.Common.HD;
namespace ChuPiao.AutoPrint.Desktop
{
......@@ -28,9 +29,10 @@ namespace ChuPiao.AutoPrint.Desktop
public static void InitializeWorkbench()
{
LogUtil.Setup();
LogUtil.LogInfo("程序开始启动……");
LogUtil.LogInfo("程序开始启动……");
//从本地配置中读取出票速度,默认200毫秒
Control.CheckForIllegalCrossThreadCalls = false;
//从本地配置中读取出票速度,默认200毫秒
string str = LocalConfigUtil.GetConfig("KeyInterval");
int keyInterval = 200;
if (!string.IsNullOrEmpty(str))
......@@ -47,7 +49,7 @@ namespace ChuPiao.AutoPrint.Desktop
}
LocalConfigUtil.TicketInterval = ticketInterval;
//从配置文件读取彩票机设置
//从配置文件读取彩票机设置
LotMachineService.InitializeLotMachine();
......@@ -66,12 +68,12 @@ namespace ChuPiao.AutoPrint.Desktop
f.Focus();
LotMachineService.StartDriver();
LoggingService.Info("彩票机启动完成");
LoggingService.Info("彩票机启动完成");
workbench.Text = GConfig.MainTitle;
//ExpectTaskService.initExpect();
Application.Run(f);
BeepUtil.Instance().Dispose();
}
......
This diff is collapsed.
......@@ -35,7 +35,7 @@ namespace ChuPiao.AutoPrint.Machine
private Queue<KeycodeInfo> _waitSendKeycodeQueue;
/// <summary>
/// 键盘状态
/// 键盘状态
/// </summary>
public VirtualKeyboardStatus Status
{
......@@ -44,7 +44,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 日志记录器
/// 日志记录器
/// </summary>
public ILog Log
{
......@@ -53,7 +53,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
///
/// 端口
/// </summary>
public SerialPort KeyboardPort
{
......@@ -62,7 +62,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 键盘类型
/// 键盘类型
/// </summary>
public KeyboardType KeyboardType
{
......@@ -71,7 +71,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 码词典
/// 键码词典
/// </summary>
public SortedDictionary<string, M_KeycodeConfigEntity> KeycodeDictionary
{
......@@ -80,7 +80,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 屏保清除键
/// 屏保清除键
/// </summary>
public KeycodeInfo ClearScreenSaverKeycode
{
......@@ -89,7 +89,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 等待发送的键码队列
/// 等待发送的键码队列
/// </summary>
public Queue<KeycodeInfo> WaitSendKeycodeQueue
{
......@@ -98,7 +98,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 彩票机相关信息
/// 彩票机相关信息
/// </summary>
public M_MachineEntity MachineInfo
{
......@@ -107,7 +107,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 端口
/// 端口号
/// </summary>
public string Port
{
......@@ -116,7 +116,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 端口波特率
/// 端口波特率
/// </summary>
public int PortBps
{
......@@ -124,7 +124,7 @@ namespace ChuPiao.AutoPrint.Machine
set { _portBps = value; }
}
/// <summary>
/// 否发送
/// 是否发送
/// </summary>
public bool IsSend
{
......@@ -133,28 +133,28 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 始化
/// 初始化
/// </summary>
public abstract void Initialize();
/// <summary>
/// 启动
/// 启动
/// </summary>
public abstract void Start();
/// <summary>
/// 停止
/// 停止
/// </summary>
public abstract void Stop();
/// <summary>
/// 输入键码
/// 输入键码
/// </summary>
public abstract void Input(List<KeycodeInfo> keycodeInfo);
#endregion
#region 属性
#region 属性
#endregion
}
}
......@@ -44,7 +44,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 打印机状态
/// 打印机状态
/// </summary>
public VirtualPrinterStatus Status
{
......@@ -53,7 +53,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 日志记录器
/// 日志记录器
/// </summary>
public ILog Log
{
......@@ -62,7 +62,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 日志路径,不单单是日志,还有彩票机的电子票文件等都在这个路径下面,格式如:C:\example\
/// 日志路径,不单单是日志,还有彩票机的电子票文件等都在这个路径下面,格式如:C:\example\
/// </summary>
public string LogPath
{
......@@ -71,7 +71,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 端口
/// 端口
/// </summary>
public SerialPort PrinterPort
{
......@@ -80,7 +80,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 端口号
/// 端口号
/// </summary>
public string Port
{
......@@ -89,7 +89,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 端口波特率
/// 端口波特率
/// </summary>
public int PortBps
{
......@@ -98,7 +98,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 彩票机相关信息
/// 彩票机相关信息
/// </summary>
public M_MachineEntity MachineInfo
{
......@@ -107,7 +107,7 @@ namespace ChuPiao.AutoPrint.Machine
}
private IPrinterClient _printerClient;
/// <summary>
/// 彩票打印机
/// 彩票打印机
/// </summary>
public IPrinterClient PrinterClient
{
......@@ -116,44 +116,44 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 初始化
/// 初始化
/// </summary>
public abstract void Initialize();
/// <summary>
/// 启动
/// 启动
/// </summary>
public abstract void Start();
/// <summary>
/// 停止
/// 停止
/// </summary>
public abstract void Stop();
/// <summary>
/// 输出电子票数据
/// 输出电子票数据
/// </summary>
/// <returns></returns>
public abstract CaptureDataInfo Output();
/// <summary>
/// 输出电子票数据
/// 输出电子票数据
/// </summary>
/// <returns></returns>
public abstract CaptureDataInfo ReOutput();
/// <summary>
/// 强行停止当前票
/// 强行停止当前票
/// </summary>
public abstract void ForceStop();
/// <summary>
/// 清空接收缓存
/// 清空接收缓存
/// </summary>
public abstract void ClearBuffer();
/// <summary>
/// 打印计数器
/// 打印计数器
/// </summary>
public int LastPrintCounter
{
......@@ -162,7 +162,7 @@ namespace ChuPiao.AutoPrint.Machine
}
/// <summary>
/// 最近的打印文件路径
/// 最近的打印文件路径
/// </summary>
public string LastPrintFilePath
{
......@@ -203,11 +203,11 @@ namespace ChuPiao.AutoPrint.Machine
// ticketFilePath = Path.Combine(ticketFilePath, LastPrintCounter + ".prn");
// LastPrintFilePath = ticketFilePath;
// File.WriteAllText(ticketFilePath, TicketTextUtil.CompressAndEncrypt(captureDataInfo.CaptureDataBytes));
// Log.Info(string.Concat("保存Last文件:", ticketFilePath));
// Log.Info(string.Concat("保存Last文件:", ticketFilePath));
//}
//catch (Exception exception)
//{
// Log.Warn(string.Concat("保存Last文件异常。错误信息:", exception.ToString()));
// Log.Warn(string.Concat("保存Last文件异常。错误信息:", exception.ToString()));
//}
}
public void SaveLastFile(byte[] captureDataBytes)
......@@ -227,12 +227,24 @@ namespace ChuPiao.AutoPrint.Machine
ticketFilePath = Path.Combine(ticketFilePath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".prn");
LastPrintFilePath = ticketFilePath;
File.WriteAllText(ticketFilePath, TicketTextUtil.CompressAndEncrypt(captureDataBytes));
//Log.Debug(string.Concat("保存Last文件:", ticketFilePath));
Log.Debug("保存Last文件");
if (Common.HD.GConfig.IsTest) {
File.WriteAllText("d:\\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".prn", TicketTextUtil.CompressAndEncrypt(captureDataBytes));
File.WriteAllText("d:\\"+DateTime.Now.ToString("yyyyMMddHHmmss") + ".prn" + "1.txt", HexString.ByteToString(captureDataBytes) + " ");
}
//Log.Debug(string.Concat("保存Last文件:", ticketFilePath));
Log.Debug("保存Last文件");
}
catch (Exception exception)
{
Log.Warn(string.Concat("保存Last文件异常。错误信息:", exception.ToString()));
Log.Warn(string.Concat("保存Last文件异常。错误信息:", exception.ToString()));
}
}
......@@ -254,13 +266,13 @@ namespace ChuPiao.AutoPrint.Machine
FileInfo file = fileInfoList[0];
file.Delete();
//Log.Debug(string.Concat("删除Last文件:", file.FullName));
Log.Debug("删除Last文件");
//Log.Debug(string.Concat("删除Last文件:", file.FullName));
Log.Debug("删除Last文件");
}
}
catch (Exception exception)
{
Log.Debug(string.Concat("删除Last文件异常。错误信息:", exception.ToString()));
Log.Debug(string.Concat("删除Last文件异常。错误信息:", exception.ToString()));
}
}
......
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -9,6 +10,12 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ChuPiao.AutoPrint.Machine</RootNamespace>
<AssemblyName>ChuPiao.AutoPrint.Machine</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......
......@@ -12,7 +12,7 @@ namespace ChuPiao.AutoPrint.Machine
switch (type)
{
case 1001:
codetype = "";
codetype = "单场";
break;
case 2001:
codetype = "2x1";
......@@ -137,7 +137,7 @@ namespace ChuPiao.AutoPrint.Machine
codetype = "8x247";
break;
default:
throw new Exception(type + "δ");
throw new Exception(type + "号码类型未定义");
}
return codetype;
}
......
......@@ -32,7 +32,7 @@ namespace ChuPiao.AutoPrint.Machine
}
}
/// <summary>
/// ĶҽƱ
/// 中心兑奖电子票
/// </summary>
public class ZxEncashTicketEventArgs : EventArgs
{
......
This diff is collapsed.
......@@ -15,84 +15,84 @@ namespace ChuPiao.AutoPrint.Machine
Exception
}
/// <summary>
/// 模拟键盘(键盘线)接口
/// 模拟键盘(键盘线)接口
/// </summary>
public interface IVirtualKeyboard
{
#region 属性
#region 属性
/// <summary>
/// 键盘状态
/// 键盘状态
/// </summary>
VirtualKeyboardStatus Status { get; set; }
/// <summary>
/// 日志记录器
/// 日志记录器
/// </summary>
ILog Log { get; set; }
/// <summary>
///
/// 端口
/// </summary>
SerialPort KeyboardPort { get; set; }
/// <summary>
/// 键盘类型
/// 键盘类型
/// </summary>
KeyboardType KeyboardType { get; set; }
/// <summary>
/// 码词典
/// 键码词典
/// </summary>
SortedDictionary<string, M_KeycodeConfigEntity> KeycodeDictionary { get; set; }
/// <summary>
/// 屏保清除键
/// 屏保清除键
/// </summary>
KeycodeInfo ClearScreenSaverKeycode { get; set; }
/// <summary>
/// 等待发送的键码队列
/// 等待发送的键码队列
/// </summary>
Queue<KeycodeInfo> WaitSendKeycodeQueue { get; set; }
/// <summary>
/// 彩票机相关信息
/// 彩票机相关信息
/// </summary>
M_MachineEntity MachineInfo { get; set; }
/// <summary>
/// 端口
/// 端口号
/// </summary>
string Port { get; set; }
/// <summary>
/// 端口波特率
/// 端口波特率
/// </summary>
int PortBps { get; set; }
/// <summary>
/// 否发送
/// 是否发送
/// </summary>
bool IsSend { get; set; }
#endregion
#region 方法
#region 方法
/// <summary>
/// 始化
/// 初始化
/// </summary>
void Initialize();
/// <summary>
/// 启动
/// 启动
/// </summary>
void Start();
/// <summary>
/// 停止
/// 停止
/// </summary>
void Stop();
/// <summary>
/// 输入键码
/// 输入键码
/// </summary>
void Input(List<KeycodeInfo> keycodeInfo);
......
......@@ -15,34 +15,34 @@ namespace ChuPiao.AutoPrint.Machine
}
public interface IVirtualPrinter
{
#region 属性
#region 属性
/// <summary>
/// 打印机状态
/// 打印机状态
/// </summary>
VirtualPrinterStatus Status { get; set; }
/// <summary>
/// 日志记录器
/// 日志记录器
/// </summary>
ILog Log { get; set; }
/// <summary>
/// 日志路径,不单单是日志,还有彩票机的电子票文件等都在这个路径下面,格式如:C:\example\
/// 日志路径,不单单是日志,还有彩票机的电子票文件等都在这个路径下面,格式如:C:\example\
/// </summary>
string LogPath { get;set;}
/// <summary>
/// 端口
/// 端口
/// </summary>
SerialPort PrinterPort { get; set; }
/// <summary>
/// 端口号
/// 端口号
/// </summary>
string Port { get; set; }
/// <summary>
/// 端口波特率
/// 端口波特率
/// </summary>
int PortBps { get; set; }
/// <summary>
/// 彩票机相关信息
/// 彩票机相关信息
/// </summary>
M_MachineEntity MachineInfo { get; set; }
/// <summary>
......@@ -50,36 +50,36 @@ namespace ChuPiao.AutoPrint.Machine
/// </summary>
ILotMachine LotMachine { get;set;}
/// <summary>
/// 彩票打印机
/// 彩票打印机
/// </summary>
IPrinterClient PrinterClient { get; set; }
#endregion
#region 方法
#region 方法
/// <summary>
/// 初始化
/// 初始化
/// </summary>
void Initialize();
/// <summary>
/// 启动
/// 启动
/// </summary>
void Start();
/// <summary>
/// 停止
/// 停止
/// </summary>
void Stop();
/// <summary>
/// 输出电子票数据
/// 输出电子票数据
/// </summary>
/// <returns></returns>
CaptureDataInfo Output();
/// <summary>
/// 输出电子票数据
/// 输出电子票数据
/// </summary>
/// <returns></returns>
CaptureDataInfo ReOutput();
......@@ -87,22 +87,22 @@ namespace ChuPiao.AutoPrint.Machine
/// <summary>
/// 强行停止当前票
/// 强行停止当前票
/// </summary>
void ForceStop();
/// <summary>
/// 清空接收缓存
/// 清空接收缓存
/// </summary>
void ClearBuffer();
/// <summary>
/// 打印计数器
/// 打印计数器
/// </summary>
int LastPrintCounter { get; set; }
/// <summary>
/// 最近的打印文件路径
/// 最近的打印文件路径
/// </summary>
string LastPrintFilePath { get; set; }
......
......@@ -6,7 +6,7 @@ using ChuPiao.Common.Enums;
namespace ChuPiao.AutoPrint.Machine
{
/// <summary>
/// 票机工厂
/// 彩票机工厂
/// </summary>
public class LotMachineFactory
{
......@@ -20,7 +20,7 @@ namespace ChuPiao.AutoPrint.Machine
lotMachine = new TjJingCaiMachineV1();
break;
default:
throw new Exception(string.Concat("彩票机类型未定义:", machineType));
throw new Exception(string.Concat("彩票机类型未定义:", machineType));
}
return lotMachine;
}
......
......@@ -4,13 +4,13 @@ namespace ChuPiao.AutoPrint.Machine.Models
{
/// <summary>
/// 电子票解析结果实体类
/// 电子票解析结果实体类
/// </summary>
public class DecodePrintData
{
private L_PrintTicketEntity _l_printTicketEntity = new L_PrintTicketEntity();
/// <summary>
/// 电子票解析结果
/// 电子票解析结果
/// </summary>
public L_PrintTicketEntity L_PrintTicketEntity
{
......@@ -20,7 +20,7 @@ namespace ChuPiao.AutoPrint.Machine.Models
private CaptureDataInfo _inputData=new CaptureDataInfo(new byte[]{});
/// <summary>
/// 抓取的原始数据
/// 抓取的原始数据
/// </summary>
public CaptureDataInfo InputData
{
......@@ -30,7 +30,7 @@ namespace ChuPiao.AutoPrint.Machine.Models
private bool _decodeSuccess = false;
/// <summary>
/// 解析是否成功
/// 解析是否成功
/// </summary>
public bool DecodeSuccess
{
......@@ -38,7 +38,7 @@ namespace ChuPiao.AutoPrint.Machine.Models
set { _decodeSuccess = value; }
}
/// <summary>
/// 解析错误信息
/// 解析错误信息
/// </summary>
public string ErrorMessage
{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment