DS7_JinGang
dengyu 1 year ago
parent dd091b440d
commit 49f1ef84b1

@ -1930,52 +1930,53 @@ SELECT @ps_BillNo as N'billno'";
#region 箱信息 #region 箱信息
var Currctnlist = DS6Data.t_op_ctn.Where(x => x. == headid).ToList(); var Currctnlist = DS6Data.t_op_ctn.Where(x => x. == headid).ToList();
var ctn_addlist = new List<t_op_ctn_md>(); var ctn_addlist = new List<t_op_ctn_md>();
var ctn_updlist = new List<t_op_ctn_md>(); //var ctn_updlist = new List<t_op_ctn_md>();
var ctn_dellist = new List<t_op_ctn_md>(); var ctn_dellist = new List<t_op_ctn_md>();
var newctnList = head.GetCtnList(newhead.); var newctnList = head.GetCtnList(newhead.);
foreach (var ctn in newctnList) foreach (var ctn in newctnList)
{ {
if (Currctnlist.Exists(x => x.DJYCTNID == ctn.DJYCTNID)) //if (Currctnlist.Exists(x => x.DJYCTNID == ctn.DJYCTNID))
{ //{
var currctn = Currctnlist.First(x => x.DJYCTNID == ctn.DJYCTNID); // var currctn = Currctnlist.First(x => x.DJYCTNID == ctn.DJYCTNID);
DingCangHead.GetCtn(ref currctn, ctn); // DingCangHead.GetCtn(ref currctn, ctn);
ctn_updlist.Add(currctn); // ctn_updlist.Add(currctn);
} //}
else //else
{ //{
ctn_addlist.Add(ctn); ctn_addlist.Add(ctn);
} //}
} }
foreach (var oldctn in Currctnlist) foreach (var oldctn in Currctnlist)
{ {
if (newctnList.Exists(x => x.DJYCTNID == oldctn.DJYCTNID)) //if (newctnList.Exists(x => x.DJYCTNID == oldctn.DJYCTNID))
{ //{
} //}
else //else
{ //{
ctn_dellist.Add(oldctn); ctn_dellist.Add(oldctn);
//}
} }
if (ctn_dellist.Count > 0)
{
DS6Data.t_op_ctn.RemoveRange(ctn_dellist);
} }
if (ctn_addlist.Count > 0) if (ctn_addlist.Count > 0)
{ {
DS6Data.t_op_ctn.AddRange(ctn_addlist); DS6Data.t_op_ctn.AddRange(ctn_addlist);
} }
if (ctn_updlist.Count > 0) //if (ctn_updlist.Count > 0)
{ //{
foreach (var updctn in ctn_updlist) // foreach (var updctn in ctn_updlist)
{ // {
DS6Data.t_op_ctn.AddOrUpdate(updctn); // DS6Data.t_op_ctn.AddOrUpdate(updctn);
} // }
} //}
if (ctn_dellist.Count > 0)
{
DS6Data.t_op_ctn.RemoveRange(ctn_dellist);
}
#endregion #endregion
#region 提单信息 #region 提单信息

Loading…
Cancel
Save