471 lines
26 KiB
C#
471 lines
26 KiB
C#
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
|||
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
|||
|
|
using Kingdee.BOS.Core.List;
|
|||
|
|
using Kingdee.BOS.Util;
|
|||
|
|
using Kingdee.K3.BD.BarCode.Business.PlugIn;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using Kingdee.BOS.Core.Bill;
|
|||
|
|
using Kingdee.BOS.Core.Metadata;
|
|||
|
|
using Kingdee.BOS.Orm.DataEntity;
|
|||
|
|
using Kingdee.BOS.Core.DynamicForm;
|
|||
|
|
using Kingdee.BOS.Core.Bill.PlugIn;
|
|||
|
|
using Kingdee.BOS.Core.NotePrint;
|
|||
|
|
using Kingdee.BOS.Resource;
|
|||
|
|
using Kingdee.K3.BD.BarCode.App.Core;
|
|||
|
|
using Kingdee.K3.BD.BarCode.Core.DataModel.Service;
|
|||
|
|
using Kingdee.K3.BD.BarCode.ServiceHelper;
|
|||
|
|
using Kingdee.BOS.Core;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using Kingdee.BOS.Core.Metadata.FieldElement;
|
|||
|
|
using Kingdee.BOS;
|
|||
|
|
|
|||
|
|
namespace GZ.LJY000.Biori.UHIK_BAR_BarCodePrint
|
|||
|
|
{
|
|||
|
|
[Description("条码打印重写2"), HotUpdate]
|
|||
|
|
public class BarCodePrintEditEx : BarCodePrintEditRewrite
|
|||
|
|
{
|
|||
|
|
private List<DynamicObject> printDatas2 = new List<DynamicObject>();
|
|||
|
|
|
|||
|
|
private List<DynamicObject> newPrintDatas2 = new List<DynamicObject>();
|
|||
|
|
|
|||
|
|
public override void OnInitialize(InitializeEventArgs e)
|
|||
|
|
{
|
|||
|
|
base.OnInitialize(e);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void OnLoad(EventArgs e)
|
|||
|
|
{
|
|||
|
|
base.OnLoad(e);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void EntryBarItemClick(BarItemClickEventArgs e)
|
|||
|
|
{
|
|||
|
|
base.EntryBarItemClick(e);
|
|||
|
|
if (e.BarItemKey.ToUpperInvariant().Equals("TBPRINTBARCODE2"))
|
|||
|
|
{
|
|||
|
|
PrintBarCode("print");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void PrintBarCode(string printType)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var printDatas = new List<DynamicObject>();
|
|||
|
|
var newPrintDatas = new List<DynamicObject>();
|
|||
|
|
string defaultBarCodeModel = Convert.ToString(base.View.Model.GetValue("FBarCodeModel"));
|
|||
|
|
BarCodePrintOperation printOperation = new BarCodePrintOperation();
|
|||
|
|
|
|||
|
|
string printAddress = Convert.ToString(base.View.Model.GetValue("FPrintAddress")).Trim().ToLowerInvariant();
|
|||
|
|
if (string.IsNullOrWhiteSpace(printAddress))
|
|||
|
|
{
|
|||
|
|
base.View.ShowNotificationMessage(ResManager.LoadKDString("请填写打印机名称!", "0011019000003156", SubSystemType.BASE));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (!CheckPrintData(printDatas) || printDatas == null || printDatas.Count <= 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
List<string> list = new List<string>();
|
|||
|
|
List<string> list2 = new List<string>();
|
|||
|
|
List<string> list3 = new List<string>();
|
|||
|
|
int num = 0;
|
|||
|
|
foreach (DynamicObject printData2 in printDatas)
|
|||
|
|
{
|
|||
|
|
if (printData2 != null)
|
|||
|
|
{
|
|||
|
|
int num2 = Convert.ToInt32(printData2["PrintNumber"]);
|
|||
|
|
for (int i = 0; i < num2; i++)
|
|||
|
|
{
|
|||
|
|
newPrintDatas.Add(printData2);
|
|||
|
|
string item = Convert.ToString(printData2["BarCode"]);
|
|||
|
|
string text = Convert.ToString(printData2["BARCODEMODEL"]);
|
|||
|
|
text = (string.IsNullOrWhiteSpace(text) ? defaultBarCodeModel : text);
|
|||
|
|
text = text.Replace(" ", "");
|
|||
|
|
list2.Add(text);
|
|||
|
|
list3.Add(item);
|
|||
|
|
list.Add(num.ToString());
|
|||
|
|
num++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
UNWLogger.Info(base.Context, "PrintBarCode:", "printDataId=" + string.Join(",", list));
|
|||
|
|
UNWLogger.Info(base.Context, "PrintBarCode:", ResManager.LoadKDString("总数量:", "14512b12f13e4f85", "APP_ISVPAAC2016062210550") + list3.Count() + "," + printType + ",BarCode=" + string.Join(",", list3));
|
|||
|
|
printOperation.BarCodePrintDoAction(this, null, list, list2, printType, printAddress);
|
|||
|
|
//printOperationType = printType;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
ex.StackTrace.ToString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void OnPrepareNotePrintData(PreparePrintDataEventArgs e)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (e.DataSourceId.Equals("FEntityToBar", StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
List<DynamicObject> list = new List<DynamicObject>();
|
|||
|
|
string value = e.BillIds.FirstOrDefault();
|
|||
|
|
if (newPrintDatas2 != null && newPrintDatas2.Count > 0)
|
|||
|
|
{
|
|||
|
|
DynamicObject dynamicObject = newPrintDatas2[Convert.ToInt32(value)];
|
|||
|
|
if (dynamicObject != null)
|
|||
|
|
{
|
|||
|
|
DynamicObject dynamicObject2 = new DynamicObject(e.DynamicObjectType);
|
|||
|
|
foreach (object field2 in e.Fields)
|
|||
|
|
{
|
|||
|
|
string text = field2.ToString();
|
|||
|
|
if (text == "FExpPeriod")
|
|||
|
|
{
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
object obj = "";
|
|||
|
|
string text2 = "";
|
|||
|
|
bool flag = false;
|
|||
|
|
bool flag2 = false;
|
|||
|
|
string text3 = string.Empty;
|
|||
|
|
if (text.Contains("."))
|
|||
|
|
{
|
|||
|
|
string[] array = text.Split('.');
|
|||
|
|
string text4 = array[0];
|
|||
|
|
string text5 = array[1];
|
|||
|
|
if (array.Count() > 2)
|
|||
|
|
{
|
|||
|
|
text3 = array[2];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (base.View.BusinessInfo.GetField(text4) == null)
|
|||
|
|
{
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
text2 = base.View.BusinessInfo.GetField(text4).PropertyName;
|
|||
|
|
if (!(dynamicObject[text2] is DynamicObject dynamicObject3))
|
|||
|
|
{
|
|||
|
|
if (text2.EqualsIgnoreCase("LotToBar") || text4.EqualsIgnoreCase("FLotToBar"))
|
|||
|
|
{
|
|||
|
|
obj = dynamicObject[text2 + "_Text"];
|
|||
|
|
text = $"{text4}_{text5}";
|
|||
|
|
dynamicObject2[text] = obj;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject3.DynamicObjectType.Properties.Contains("Image") && dynamicObject3["Image"] == null)
|
|||
|
|
{
|
|||
|
|
RepackData(dynamicObject3);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject3.DynamicObjectType.Name.ToUpperInvariant() == "BD_FLEXSITEMDETAILV")
|
|||
|
|
{
|
|||
|
|
flag = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject3.DynamicObjectType.Name.ToUpperInvariant() == "BD_FLEXVALUESDETAIL")
|
|||
|
|
{
|
|||
|
|
flag2 = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
text = string.Format("{0}_{1}{2}", text4, text5, text3.IsNullOrEmptyOrWhiteSpace() ? "" : ("_" + text3));
|
|||
|
|
if (dynamicObject3.DynamicObjectType.Properties.Contains(text5.Remove(0, 1)))
|
|||
|
|
{
|
|||
|
|
obj = dynamicObject3[text5.Remove(0, 1)];
|
|||
|
|
}
|
|||
|
|
else if (dynamicObject3.DynamicObjectType.Properties.Contains(text5))
|
|||
|
|
{
|
|||
|
|
obj = dynamicObject3[text5];
|
|||
|
|
}
|
|||
|
|
else if (field2.Equals("FMaterialIdToBar.FStockPlaceId") && dynamicObject3.DynamicObjectType.Properties.Contains("MaterialStock") && dynamicObject3["MaterialStock"] is DynamicObjectCollection)
|
|||
|
|
{
|
|||
|
|
obj = (dynamicObject3["MaterialStock"] as DynamicObjectCollection)[0];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (obj.IsNullOrEmptyOrWhiteSpace() && base.View.BusinessInfo.GetField(text4) is BaseDataField)
|
|||
|
|
{
|
|||
|
|
string formId = ((BaseDataField)base.View.BusinessInfo.GetField(text4)).LookUpObject.FormId;
|
|||
|
|
obj = GetBaseDataPropByBaseData(formId, text5, dynamicObject3);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (base.View.BusinessInfo.GetField(text) is BasePropertyField)
|
|||
|
|
{
|
|||
|
|
string controlFieldKey = base.View.BusinessInfo.GetField(text).ControlFieldKey;
|
|||
|
|
text2 = base.View.BusinessInfo.GetField(text).PropertyName;
|
|||
|
|
string name = base.View.BusinessInfo.GetField(text).ControlField.DynamicProperty.Name;
|
|||
|
|
if (dynamicObject[name] is DynamicObject dynamicObject4)
|
|||
|
|
{
|
|||
|
|
obj = Convert.ToString(dynamicObject4[text2]);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (base.View.BusinessInfo.GetField(text) != null)
|
|||
|
|
{
|
|||
|
|
text2 = base.View.BusinessInfo.GetField(text).PropertyName;
|
|||
|
|
obj = dynamicObject[text2];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (obj is DynamicObject)
|
|||
|
|
{
|
|||
|
|
if (flag)
|
|||
|
|
{
|
|||
|
|
text3 = (text3.IsNullOrEmptyOrWhiteSpace() ? "FDataValue" : text3);
|
|||
|
|
if ((obj as DynamicObject).DynamicObjectType.Properties.Contains(text3))
|
|||
|
|
{
|
|||
|
|
dynamicObject2[text] = (obj as DynamicObject)[text3].ToString();
|
|||
|
|
string text6 = text.Split('_')[0];
|
|||
|
|
if (dynamicObject2.DynamicObjectType.Properties.Contains(text6))
|
|||
|
|
{
|
|||
|
|
string propertyName = base.View.BusinessInfo.GetField(text6).PropertyName;
|
|||
|
|
if (dynamicObject.DynamicObjectType.Properties.Contains(propertyName + "_Id"))
|
|||
|
|
{
|
|||
|
|
dynamicObject2[text6] = dynamicObject[propertyName + "_Id"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject2.DynamicObjectType.Properties.Contains("FMaterialIdToBar_Ref"))
|
|||
|
|
{
|
|||
|
|
string propertyName2 = base.View.BusinessInfo.GetField("FMaterialIdToBar").PropertyName;
|
|||
|
|
if (dynamicObject.DynamicObjectType.Properties.Contains(propertyName2) && dynamicObject.DynamicObjectType.Properties.Contains(propertyName2 + "_Id"))
|
|||
|
|
{
|
|||
|
|
dynamicObject2["FMaterialIdToBar_Ref"] = dynamicObject[propertyName2];
|
|||
|
|
dynamicObject2["FMaterialIdToBar_Id"] = dynamicObject[propertyName2 + "_Id"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
text3 = ((text3.IsNullOrEmptyOrWhiteSpace() || !text3.Contains("Number")) ? "Name" : "Number");
|
|||
|
|
if ((obj as DynamicObject).DynamicObjectType.Properties.Contains(text3))
|
|||
|
|
{
|
|||
|
|
dynamicObject2[text] = (obj as DynamicObject)[text3].ToString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (flag2)
|
|||
|
|
{
|
|||
|
|
text3 = (text3.IsNullOrEmptyOrWhiteSpace() ? "Name" : text3);
|
|||
|
|
if (text.StartsWith("FSTOCKLOCIDToBar_FF") && text.EndsWith("_FNumber"))
|
|||
|
|
{
|
|||
|
|
text3 = text3.Remove(0, 1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ((obj as DynamicObject).DynamicObjectType.Properties.Contains(text3))
|
|||
|
|
{
|
|||
|
|
dynamicObject2[text] = (obj as DynamicObject)[text3].ToString();
|
|||
|
|
string text7 = text.Split('_')[0];
|
|||
|
|
if (dynamicObject2.DynamicObjectType.Properties.Contains(text7))
|
|||
|
|
{
|
|||
|
|
string propertyName3 = base.View.BusinessInfo.GetField(text7).PropertyName;
|
|||
|
|
if (dynamicObject.DynamicObjectType.Properties.Contains(propertyName3 + "_Id"))
|
|||
|
|
{
|
|||
|
|
dynamicObject2[text7] = dynamicObject[propertyName3 + "_Id"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject2.DynamicObjectType.Properties.Contains("FStockIdToBar_Ref"))
|
|||
|
|
{
|
|||
|
|
string propertyName4 = base.View.BusinessInfo.GetField("FStockIdToBar").PropertyName;
|
|||
|
|
if (dynamicObject.DynamicObjectType.Properties.Contains(propertyName4) && dynamicObject.DynamicObjectType.Properties.Contains(propertyName4 + "_Id"))
|
|||
|
|
{
|
|||
|
|
dynamicObject2["FStockIdToBar_Ref"] = dynamicObject[propertyName4];
|
|||
|
|
dynamicObject2["FStockIdToBar_Id"] = dynamicObject[propertyName4 + "_Id"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject2.DynamicObjectType.Properties.Contains("FINSTOCKIDToBar_Ref"))
|
|||
|
|
{
|
|||
|
|
string propertyName5 = base.View.BusinessInfo.GetField("FINSTOCKIDToBar").PropertyName;
|
|||
|
|
if (dynamicObject.DynamicObjectType.Properties.Contains(propertyName5) && dynamicObject.DynamicObjectType.Properties.Contains(propertyName5 + "_Id"))
|
|||
|
|
{
|
|||
|
|
dynamicObject2["FINSTOCKIDToBar_Ref"] = dynamicObject[propertyName5];
|
|||
|
|
dynamicObject2["FINSTOCKIDToBar_Id"] = dynamicObject[propertyName5 + "_Id"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (field2.ToString() == "FSTOCKLOCIDToBar" || field2.ToString().Equals("FAuxPropIdToBar"))
|
|||
|
|
{
|
|||
|
|
string value2 = (obj as DynamicObject)["Id"].ToString();
|
|||
|
|
dynamicObject2[text] = value2;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
text3 = (text3.IsNullOrEmptyOrWhiteSpace() ? "Name" : text3);
|
|||
|
|
if ((obj as DynamicObject).DynamicObjectType.Properties.Contains(text3))
|
|||
|
|
{
|
|||
|
|
dynamicObject2[text] = (obj as DynamicObject)[text3].ToString();
|
|||
|
|
}
|
|||
|
|
else if (field2.Equals("FMaterialIdToBar.FStockPlaceId") && dynamicObject2.DynamicObjectType.Properties.Contains("FMaterialIdToBar_Ref"))
|
|||
|
|
{
|
|||
|
|
string propertyName6 = base.View.BusinessInfo.GetField("FMaterialIdToBar").PropertyName;
|
|||
|
|
if (dynamicObject.DynamicObjectType.Properties.Contains(propertyName6) && dynamicObject.DynamicObjectType.Properties.Contains(propertyName6 + "_Id"))
|
|||
|
|
{
|
|||
|
|
dynamicObject2["FMaterialIdToBar_Ref"] = dynamicObject[propertyName6];
|
|||
|
|
dynamicObject2["FMaterialIdToBar_Id"] = dynamicObject[propertyName6 + "_Id"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (dynamicObject2.DynamicObjectType.Properties.Contains(text))
|
|||
|
|
{
|
|||
|
|
if (obj.IsNullOrEmptyOrWhiteSpace() && text.Contains("_"))
|
|||
|
|
{
|
|||
|
|
string[] array2 = text.Split('_');
|
|||
|
|
string text8 = "";
|
|||
|
|
text8 = array2[1].Remove(0, 1);
|
|||
|
|
if (!text8.Equals("") && dynamicObject.DynamicObjectType.Properties.Contains(text8))
|
|||
|
|
{
|
|||
|
|
obj = dynamicObject[text8];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
dynamicObject2[text] = obj;
|
|||
|
|
if (flag)
|
|||
|
|
{
|
|||
|
|
dynamicObject2[text] = obj;
|
|||
|
|
string text9 = text.Split('_')[0];
|
|||
|
|
Field field = base.View.BusinessInfo.GetField(text9);
|
|||
|
|
if (field is RelatedFlexGroupField && obj != null)
|
|||
|
|
{
|
|||
|
|
RelatedFlexGroupField element = (RelatedFlexGroupField)field;
|
|||
|
|
dynamicObject2[text] = GetElementValue(element, obj);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject2.DynamicObjectType.Properties.Contains(text9))
|
|||
|
|
{
|
|||
|
|
string propertyName7 = base.View.BusinessInfo.GetField(text9).PropertyName;
|
|||
|
|
if (dynamicObject.DynamicObjectType.Properties.Contains(propertyName7 + "_Id"))
|
|||
|
|
{
|
|||
|
|
dynamicObject2[text9] = dynamicObject[propertyName7 + "_Id"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject2.DynamicObjectType.Properties.Contains("FMaterialIdToBar_Ref"))
|
|||
|
|
{
|
|||
|
|
string propertyName8 = base.View.BusinessInfo.GetField("FMaterialIdToBar").PropertyName;
|
|||
|
|
if (dynamicObject.DynamicObjectType.Properties.Contains(propertyName8) && dynamicObject.DynamicObjectType.Properties.Contains(propertyName8 + "_Id"))
|
|||
|
|
{
|
|||
|
|
dynamicObject2["FMaterialIdToBar_Ref"] = dynamicObject[propertyName8];
|
|||
|
|
dynamicObject2["FMaterialIdToBar_Id"] = dynamicObject[propertyName8 + "_Id"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject2[text] is LocaleValue && !dynamicObject2[text].IsNullOrEmptyOrWhiteSpace())
|
|||
|
|
{
|
|||
|
|
List<LocaleValue> list2 = new List<LocaleValue>();
|
|||
|
|
list2.Add(dynamicObject2[text] as LocaleValue);
|
|||
|
|
List<LocaleValue> value3 = list2;
|
|||
|
|
dynamicObject2[text] = value3;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dynamicObject2.Contains("FMaterialIdToBar_FImageFileServer"))
|
|||
|
|
{
|
|||
|
|
object ret = new object();
|
|||
|
|
GetImageByte(dynamicObject2["FMaterialIdToBar_FImageFileServer"], ref ret);
|
|||
|
|
dynamicObject2["FMaterialIdToBar_FImageFileServer"] = ret;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
list.Add(dynamicObject2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
e.DataObjects = list.ToArray();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
base.OnPrepareNotePrintData(e);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
UNWLogger.Error(base.Context, "BarCodePrintEdit", "OnPrepareNotePrintData error:" + ex.Message + ex.StackTrace, ex);
|
|||
|
|
}
|
|||
|
|
return;
|
|||
|
|
base.OnPrepareNotePrintData(e);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private bool CheckPrintData(List<DynamicObject> printDatas)
|
|||
|
|
{
|
|||
|
|
bool flag = true;
|
|||
|
|
ExtendedDataEntitySet extendedDataEntitySet = new ExtendedDataEntitySet();
|
|||
|
|
extendedDataEntitySet.Parse(new DynamicObject[1] { base.View.Model.DataObject }, base.View.Model.BusinessInfo);
|
|||
|
|
ExtendedDataEntity[] array = (from p in extendedDataEntitySet.FindByEntityKey("FEntityToBar")
|
|||
|
|
where p.DataEntity["BarCodeCheck"].ToString().EqualsIgnoreCase("True")
|
|||
|
|
select p).ToArray();
|
|||
|
|
if (array.Count() < 1)
|
|||
|
|
{
|
|||
|
|
base.View.ShowWarnningMessage(ResManager.LoadKDString("请先选择打印数据行!", "0011019000003158", SubSystemType.BASE));
|
|||
|
|
flag = false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
string text = Convert.ToString(base.View.Model.GetValue("FBarCodeModel"));
|
|||
|
|
List<int> list = new List<int>();
|
|||
|
|
List<int> list2 = new List<int>();
|
|||
|
|
for (int i = 0; i < array.Count(); i++)
|
|||
|
|
{
|
|||
|
|
DynamicObject dataEntity = array[i].DataEntity;
|
|||
|
|
printDatas.Add(dataEntity);
|
|||
|
|
string text2 = Convert.ToString(dataEntity["BARCODEMODEL"]);
|
|||
|
|
text2 = (string.IsNullOrWhiteSpace(text2) ? text : text2);
|
|||
|
|
text2 = text2.Replace(" ", "");
|
|||
|
|
string value = Convert.ToString(dataEntity["BarCode"]);
|
|||
|
|
int item = Convert.ToInt32(dataEntity["Seq"]);
|
|||
|
|
if (string.IsNullOrWhiteSpace(value))
|
|||
|
|
{
|
|||
|
|
list.Add(item);
|
|||
|
|
flag = false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.IsNullOrWhiteSpace(text2))
|
|||
|
|
{
|
|||
|
|
list2.Add(item);
|
|||
|
|
flag = false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
string text3 = "";
|
|||
|
|
if (list.Count > 0)
|
|||
|
|
{
|
|||
|
|
for (int j = 0; j < list.Count; j++)
|
|||
|
|
{
|
|||
|
|
text3 = ((j < list.Count - 1) ? (list[j] + "、") : list[j].ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
text3 = (string.IsNullOrWhiteSpace(text3) ? "" : string.Format(ResManager.LoadKDString(ResManager.LoadKDString("第", "5e2976b208924f20", "APP_ISVPAAC2016062210550"), "0011019000003159", SubSystemType.BASE) + text3 + ResManager.LoadKDString("行条形码尚未生成!", "0011019000003160", SubSystemType.BASE)));
|
|||
|
|
string text4 = "";
|
|||
|
|
if (list2.Count > 0)
|
|||
|
|
{
|
|||
|
|
for (int k = 0; k < list2.Count; k++)
|
|||
|
|
{
|
|||
|
|
text4 = ((k < list2.Count - 1) ? (list2[k] + "、") : list2[k].ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
text4 = (string.IsNullOrWhiteSpace(text4) ? "" : string.Format(ResManager.LoadKDString(ResManager.LoadKDString("第", "5e2976b208924f20", "APP_ISVPAAC2016062210550"), "0011019000003159", SubSystemType.BASE) + text4 + ResManager.LoadKDString("行条形码未设置条码模板!", "0011019000003161", SubSystemType.BASE)));
|
|||
|
|
if (!string.IsNullOrWhiteSpace(text3 + text4))
|
|||
|
|
{
|
|||
|
|
base.View.ShowNotificationMessage(text3 + text4);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (!flag)
|
|||
|
|
{
|
|||
|
|
printDatas = new List<DynamicObject>();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return flag;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|