Commit fadb622a 刘韬

1

1 个父辈 2b094478
...@@ -321,6 +321,7 @@ namespace BLL ...@@ -321,6 +321,7 @@ namespace BLL
public static MyConfig<string> DataSource_DataKey; public static MyConfig<string> DataSource_DataKey;
[MyConfigComment("数据源列标题")] [MyConfigComment("数据源列标题")]
public static MyConfig<string> DataSource_DataTitle; public static MyConfig<string> DataSource_DataTitle;
public static MyConfig<bool> DataSource_ShowBox = false;
[MyConfigComment("遍历数据源目录")] [MyConfigComment("遍历数据源目录")]
public static MyConfig<bool> DataSource_Recursive; public static MyConfig<bool> DataSource_Recursive;
[MyConfigComment("是否启用OCR")] [MyConfigComment("是否启用OCR")]
......
...@@ -28,6 +28,8 @@ namespace BLL ...@@ -28,6 +28,8 @@ namespace BLL
text = s; text = s;
width = Convert.ToInt32(size.Width); width = Convert.ToInt32(size.Width);
height = Convert.ToInt32(size.Height); height = Convert.ToInt32(size.Height);
if (string.IsNullOrEmpty(text))
return null;
return code[type].Invoke(); return code[type].Invoke();
} }
......
...@@ -126,12 +126,11 @@ namespace BLL ...@@ -126,12 +126,11 @@ namespace BLL
}, },
}; };
Dictionary<string, object> R; Dictionary<string, object> R;
bool isdis = ConfigHelper.Config.Get<bool>("DataSource_ShowBox",false);
string type = "TextBox"; string type = "TextBox";
if (key==Config.DataSource_DataTitle&&isdis) if (key == Config.DataSource_DataTitle && Config.DataSource_ShowBox)
{ {
type = "ComboBox"; type = "ComboBox";
} }
R = new() { R = new() {
{ "Type", type }, { "Type", type },
{ "Key", key }, { "Key", key },
......
...@@ -104,7 +104,7 @@ namespace BLL ...@@ -104,7 +104,7 @@ namespace BLL
foreach (var item in arr) foreach (var item in arr)
{ {
key.TryGetValue(item, out string value); key.TryGetValue(item, out string value);
if (string.IsNullOrEmpty(value)) if (string.IsNullOrWhiteSpace(value))
{ {
isdisplay = false; isdisplay = false;
break; break;
...@@ -161,6 +161,7 @@ namespace BLL ...@@ -161,6 +161,7 @@ namespace BLL
if (extensions[i].Type == "ComboBox") if (extensions[i].Type == "ComboBox")
{ {
var s = extensions[i].Control as Asa.FaceControl.FaceComboBox; var s = extensions[i].Control as Asa.FaceControl.FaceComboBox;
s.Items.Clear();
s.Items.AddRange(ExtraFileData.DataTitle.OrderBy(tit=>tit).ToArray()); s.Items.AddRange(ExtraFileData.DataTitle.OrderBy(tit=>tit).ToArray());
s.Text = ""; s.Text = "";
s.SelectedIndex = -1; s.SelectedIndex = -1;
...@@ -339,7 +340,7 @@ namespace BLL ...@@ -339,7 +340,7 @@ namespace BLL
} }
private void PrintLabel(object sender, EventArgs e) private void PrintLabel(object sender, EventArgs e)
{ {
LogNet.log.Debug("Enter PrintLabel Method"); LogNet.log.Info("Enter PrintLabel Method");
if (lastkey == null) return; if (lastkey == null) return;
...@@ -352,6 +353,7 @@ namespace BLL ...@@ -352,6 +353,7 @@ namespace BLL
else else
lastkey.Add(extensions[i].Key, extensions[i].Control.Text); lastkey.Add(extensions[i].Key, extensions[i].Control.Text);
} }
LogNet.log.Info("lastkey:" + JsonConvert.SerializeObject(lastkey));
#region 判断指定关键字是否存在内容 #region 判断指定关键字是否存在内容
List<string> strings = new List<string>(); List<string> strings = new List<string>();
string str = ConfigHelper.Config.Get("DataSource_ForceMatching", ""); string str = ConfigHelper.Config.Get("DataSource_ForceMatching", "");
...@@ -361,12 +363,14 @@ namespace BLL ...@@ -361,12 +363,14 @@ namespace BLL
foreach (var item in arr) foreach (var item in arr)
{ {
lastkey.TryGetValue(item, out string value); lastkey.TryGetValue(item, out string value);
if (string.IsNullOrEmpty(value)) if (string.IsNullOrWhiteSpace(value))
{ {
strings.Add(item); strings.Add(item);
} }
} }
} }
LogNet.log.Info("DataSource_ForceMatching:"+string.Join(",", strings));
#endregion #endregion
for (int i = 0; i < extensions.Count; i++) for (int i = 0; i < extensions.Count; i++)
{ {
...@@ -522,13 +526,13 @@ namespace BLL ...@@ -522,13 +526,13 @@ namespace BLL
try try
{ {
string datakey = Config.DataSource_DataKey; string datakey = Config.DataSource_DataKey;
foreach (var items in extensions.Where(a => a.Type == "TextBox" && a.Key == datakey)) foreach (var items in extensions.Where(a => (a.Type == "TextBox" || a.Type == "ComboBox") && a.Key == datakey))
{ {
string value = items.Control.Text; string value = items.Control.Text;
var data = ExtraFileData.AllData[value]; var data = ExtraFileData.AllData[value];
foreach (var item in data) foreach (var item in data)
{ {
var ext = extensions.Where(a => a.Type == "TextBox" && a.Key == item.Key).ToList(); var ext = extensions.Where(a =>( a.Type == "TextBox" || a.Type == "ComboBox" )&& a.Key == item.Key).ToList();
foreach (var Control in ext) foreach (var Control in ext)
{ {
Control.Control.Text = item.Value; Control.Control.Text = item.Value;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="ConfigHelper"> <Reference Include="ConfigHelper">
<HintPath>..\..\..\..\类库\ConfigHelper.dll</HintPath> <HintPath>..\..\NEWSISO\DLL\ConfigHelper.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
......
...@@ -89,10 +89,6 @@ ...@@ -89,10 +89,6 @@
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="MaterialSkin, Version=2.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\Desktop\项目\ns100\NS100\SharedDll\MaterialSkin.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!