材料入库导入增加序号

This commit is contained in:
2024-11-12 17:56:01 +08:00
parent 2cdb47a854
commit 57a4adcd9e
17 changed files with 115 additions and 28 deletions
+7 -1
View File
@@ -37,6 +37,7 @@ namespace BLL
(string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId.Contains(table.InOutPlanMasterId)) &&
(string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) &&
(string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode))
orderby x.SortIndex
select new Model.Tw_InOutDetailOutput
{
Id = x.Id,
@@ -49,7 +50,7 @@ namespace BLL
MaterialName = mat.MaterialName,
MaterialDef= mat.MaterialDef,
StockNum = stock.StockNum ?? 0,
}
}
;
return q;
@@ -94,6 +95,7 @@ namespace BLL
MaterialCode = newtable.MaterialCode,
PlanNum = newtable.PlanNum,
ActNum = newtable.ActNum,
SortIndex = newtable.SortIndex
};
Funs.DB.Tw_InOutPlanDetail.InsertOnSubmit(table);
Funs.DB.SubmitChanges();
@@ -106,11 +108,14 @@ namespace BLL
/// <param name="inoutPlanMasterId"></param>
public static void AddList(IEnumerable<Model.Tw_InOutPlanDetail> list, string inoutPlanMasterId)
{
int sortIndex = 1;
foreach (var item in list)
{
item.Id= SQLHelper.GetNewID();
item.SortIndex= sortIndex;
item.InOutPlanMasterId = inoutPlanMasterId;
Add(item);
sortIndex++;
}
}
public static void Update(Model.Tw_InOutPlanDetail newtable)
@@ -125,6 +130,7 @@ namespace BLL
table.MaterialCode = newtable.MaterialCode;
table.PlanNum = newtable.PlanNum;
table.ActNum = newtable.ActNum;
table.SortIndex= newtable.SortIndex;
Funs.DB.SubmitChanges();
}