public Guid SavePalletDetailInfo(List <cstPalletDetails> lsPalletDetailinfo) { Guid _palletDetailID = Guid.Empty; try { foreach (var _palletdetailitem in lsPalletDetailinfo) { PalletDetail _pallet = new PalletDetail(); _pallet.PalletDetailID = Guid.NewGuid(); _pallet.PalletID = _palletdetailitem.PalletID; _pallet.ShipmentNumber = _palletdetailitem.ShipmentNumber; _pallet.BoxNumber = _palletdetailitem.BoxNumber; _pallet.CartonNumber = _palletdetailitem.CartonNumber; _pallet.PrintStatus = _palletdetailitem.PrintStatus; //if (_palletitem.BoxMeasurementTime.Date != Convert.ToDateTime("01/01/001").Date) //{ // _boxPackage.BoxMeasurementTime = _palletitem.BoxMeasurementTime; //} entx3v6.AddToPalletDetails(_pallet); _palletDetailID = _pallet.PalletDetailID; } entx3v6.SaveChanges(); } catch (Exception) { } return(_palletDetailID); }