UsrWorkMode.cs
3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Asa.FaceControl;
using BLL;
using Model;
namespace SmartScan
{
public partial class UsrWorkMode : UserControl, ISetMenu
{
public UsrWorkMode()
{
InitializeComponent();
//打印机
LstPrinter.Items.AddRange(Printer.AllName);
LstPrinter.Text = BLLCommon.config.PrinterName;
if (BLLCommon.config.PrintLandscape)
RdoLandscape.Checked = true;
else
RdoVertical.Checked = true;
//图像保存
((FaceRadioBox)facePanel1.Controls["Rdo" + BLLCommon.config.HistoryImage.ToString()]).Checked = true;
//6个复选框
ChkSelectPN.Checked = BLLCommon.config.SelectHttpPN;
ChkLabelEmptyCheck.Checked = BLLCommon.config.LabelEmptyCheck;
ChkOpenEnterWork.Checked = BLLCommon.config.OpenStartWork;
ChkPrintCompletedClear.Checked = BLLCommon.config.PrintCompletedClear;
ChkOpenMaximize.Checked = BLLCommon.config.OpenMaximize;
ChkTriggerOpenLight.Checked = BLLCommon.config.TriggerOpenLight;
ChkPromptAfterPrinting.Checked = BLLCommon.config.PromptAfterPrinting;
ChkAutoPrint.Checked = BLLCommon.config.AutoPrint;
ChkAllowModifyPrint.Checked = Config.AllowModifyPrintInfo;
//默认标签
LstLabel.Items.AddRange(BLLCommon.labelEdit.Name);
LstLabel.Text = BLLCommon.config.DefaultPrintLabel;
//优先模板
LstMate.Items.AddRange(BLLCommon.mateEdit.Name);
LstMate.Text = BLLCommon.config.DefaultMaterialName;
Language.SetLanguage(this);
}
public FacePanel GetPanel()
{
return facePanel1;
}
public void Save()
{
//保存打印机
BLLCommon.config.PrintLandscape = RdoLandscape.Checked;
if (LstPrinter.SelectedIndex == -1)
{
if (LstPrinter.Items.Count == 1)
BLLCommon.config.PrinterName = LstPrinter.Items[0];
}
else
{
BLLCommon.config.PrinterName = LstPrinter.Text;
}
//追溯图像保存
if (RdoOriginal.Checked)
BLLCommon.config.HistoryImage = HistoryImage.Original;
else if (RdoCondense.Checked)
BLLCommon.config.HistoryImage = HistoryImage.Condense;
else if (RdoNoImage.Checked)
BLLCommon.config.HistoryImage = HistoryImage.NoImage;
//默认打印标签
if (LstLabel.SelectedIndex == -1)
{
if (LstLabel.Items.Count == 1)
BLLCommon.config.DefaultPrintLabel = LstLabel.Items[0];
}
else
{
BLLCommon.config.DefaultPrintLabel = LstLabel.Text;
}
//优先匹配模板
if (LstMate.SelectedIndex == -1)
{
if (LstMate.Items.Count == 1)
BLLCommon.config.DefaultMaterialName = LstMate.Items[0];
}
else
{
BLLCommon.config.DefaultMaterialName = LstMate.Text;
}
//6个复选框
BLLCommon.config.SelectHttpPN = ChkSelectPN.Checked;
BLLCommon.config.LabelEmptyCheck = ChkLabelEmptyCheck.Checked;
BLLCommon.config.OpenStartWork = ChkOpenEnterWork.Checked;
BLLCommon.config.OpenMaximize = ChkOpenMaximize.Checked;
BLLCommon.config.PrintCompletedClear = ChkPrintCompletedClear.Checked;
BLLCommon.config.TriggerOpenLight = ChkTriggerOpenLight.Checked;
BLLCommon.config.PromptAfterPrinting = ChkPromptAfterPrinting.Checked;
BLLCommon.config.AutoPrint = ChkAutoPrint.Checked;
BLLCommon.config.Save();
}
}
}