SVN r514
SVN-Revision: r514
This commit is contained in:
@@ -219,7 +219,7 @@ namespace Lskj.PubBomImport
|
|||||||
//MessageUtil.Show("表格中数据内容重复,保存失败!");
|
//MessageUtil.Show("表格中数据内容重复,保存失败!");
|
||||||
return saveResult;
|
return saveResult;
|
||||||
}
|
}
|
||||||
string billNo = this.lblOrderNo.Text.Trim();
|
string billNo = billModel.SaveState ? this.lblOrderNo.Text.Trim() : Guid.NewGuid() + "";
|
||||||
string detailGuid = Guid.NewGuid().ToString();
|
string detailGuid = Guid.NewGuid().ToString();
|
||||||
string masterSql = billModel.SaveState ? GetUpdateRecord(billNo) : GetAddRecord(ref billNo);
|
string masterSql = billModel.SaveState ? GetUpdateRecord(billNo) : GetAddRecord(ref billNo);
|
||||||
string detailSql = GetDetailRecord(detailGuid, billNo).ToString();
|
string detailSql = GetDetailRecord(detailGuid, billNo).ToString();
|
||||||
@@ -341,6 +341,7 @@ namespace Lskj.PubBomImport
|
|||||||
if (!string.IsNullOrWhiteSpace(errorMessage)) SaveErrorMessage = "表头错误:" + errorMessage;
|
if (!string.IsNullOrWhiteSpace(errorMessage)) SaveErrorMessage = "表头错误:" + errorMessage;
|
||||||
// 增加主键
|
// 增加主键
|
||||||
fieldBuilder.Append(billModel.PrimaryKey);
|
fieldBuilder.Append(billModel.PrimaryKey);
|
||||||
|
//valueBuilder.Append("N'" + parmaryValue + "'");
|
||||||
valueBuilder.Append("N'" + parmaryValue + "'");
|
valueBuilder.Append("N'" + parmaryValue + "'");
|
||||||
// 增加红蓝字单标记
|
// 增加红蓝字单标记
|
||||||
fieldBuilder.Append("," + billModel.RtagidKey);
|
fieldBuilder.Append("," + billModel.RtagidKey);
|
||||||
|
|||||||
@@ -939,6 +939,8 @@ namespace Lskj.PubBomImport
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
int.TryParse(Model.FirstRowIndex, out int index);
|
||||||
|
frmMain.FirstRowIndex = index;
|
||||||
bool isUpload = false;
|
bool isUpload = false;
|
||||||
string msg = "";
|
string msg = "";
|
||||||
DataRow parentProductRow = BaseImpl.GetDataRowResult($"select top 1 billdocument_id from bom_BillTab where productid='{productId}'");
|
DataRow parentProductRow = BaseImpl.GetDataRowResult($"select top 1 billdocument_id from bom_BillTab where productid='{productId}'");
|
||||||
@@ -972,13 +974,46 @@ namespace Lskj.PubBomImport
|
|||||||
}
|
}
|
||||||
if (childInfo != null)
|
if (childInfo != null)
|
||||||
{
|
{
|
||||||
DataRow childRow = childTable.NewRow();
|
if (code.StartsWith("ZZQD"))
|
||||||
childRow["ProductId"] = parentRow["图号"] + "";
|
{
|
||||||
childRow["appellation"] = parentRow["名称"] + "";
|
DataTable zzqdTable = ExcelToDatatable(childInfo.FullName, Model, "", index);
|
||||||
childRow["bak"] = parentRow["备注"] + "";
|
//frmMain.Invoke(new Action(() =>
|
||||||
childRow["tamount"] = parentRow["套数"] + "";
|
//{
|
||||||
childRow["amount"] = parentRow["套数"] + "";
|
// zzqdTable = frmMain.ToExcelDataTable(childInfo.FullName, out int count, out int errorCount, true);
|
||||||
childTable.Rows.Add(childRow);
|
//}));
|
||||||
|
DataView filterDataView = new DataView(zzqdTable);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(Model.ReadTableCond))
|
||||||
|
{
|
||||||
|
filterDataView.RowFilter = Model.ReadTableCond;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
zzqdTable = filterDataView.ToTable();
|
||||||
|
foreach (DataRow zzqdItem in zzqdTable.Rows)
|
||||||
|
{
|
||||||
|
DataRow childRow = childTable.NewRow();
|
||||||
|
childRow["ProductId"] = zzqdItem["物料编码"] + "";
|
||||||
|
childRow["appellation"] = zzqdItem["名称"] + "";
|
||||||
|
childRow["bak"] = code;
|
||||||
|
childRow["tamount"] = parentRow["套数"] + "";
|
||||||
|
childRow["amount"] = zzqdItem["数量"] + "";
|
||||||
|
childTable.Rows.Add(childRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DataRow childRow = childTable.NewRow();
|
||||||
|
childRow["ProductId"] = parentRow["图号"] + "";
|
||||||
|
childRow["appellation"] = parentRow["名称"] + "";
|
||||||
|
childRow["bak"] = parentRow["备注"] + "";
|
||||||
|
childRow["tamount"] = parentRow["套数"] + "";
|
||||||
|
childRow["amount"] = parentRow["套数"] + "";
|
||||||
|
childTable.Rows.Add(childRow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1036,8 +1071,6 @@ namespace Lskj.PubBomImport
|
|||||||
}
|
}
|
||||||
SetProcessBar(100, (1 / (parentTable.Rows.Count + 1)) * 100);
|
SetProcessBar(100, (1 / (parentTable.Rows.Count + 1)) * 100);
|
||||||
SetProcessLabelAllMsg($"总进度:{1}/{parentTable.Rows.Count + 1}");
|
SetProcessLabelAllMsg($"总进度:{1}/{parentTable.Rows.Count + 1}");
|
||||||
int.TryParse(Model.FirstRowIndex, out int index);
|
|
||||||
frmMain.FirstRowIndex = index;
|
|
||||||
foreach (DataRow dataRow in parentTable.Rows)
|
foreach (DataRow dataRow in parentTable.Rows)
|
||||||
{
|
{
|
||||||
int childIndex = parentTable.Rows.IndexOf(dataRow);
|
int childIndex = parentTable.Rows.IndexOf(dataRow);
|
||||||
@@ -1259,7 +1292,7 @@ namespace Lskj.PubBomImport
|
|||||||
int.TryParse(execRow["comfirm"] + "", out int comfirm);
|
int.TryParse(execRow["comfirm"] + "", out int comfirm);
|
||||||
int.TryParse(execRow["auditFlag"] + "", out int auditFlag);
|
int.TryParse(execRow["auditFlag"] + "", out int auditFlag);
|
||||||
int.TryParse(execRow["newVer"] + "", out int newVer);
|
int.TryParse(execRow["newVer"] + "", out int newVer);
|
||||||
string billNo = billWay == 1 ? BillImpl.GetBillNo(billSeq) : execRow["billNo"] + "";
|
string billNo = execRow["billNo"] + "";
|
||||||
int result = BillImpl.BillSave(masterSql, detailSql, detailTable, ref billNo, detailGuid, billSeq, billWay, comfirm, out string tipMsg, auditFlag, newVer);
|
int result = BillImpl.BillSave(masterSql, detailSql, detailTable, ref billNo, detailGuid, billSeq, billWay, comfirm, out string tipMsg, auditFlag, newVer);
|
||||||
if (result == 1)
|
if (result == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user