Commit fadb622a 刘韬

1

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