Denmark Puso

Denmark Puso

  • NA
  • 232
  • 50.3k

how to get specific data and save it?

Sep 16 2019 5:21 AM
ill try to get the all ID with status of  "Picked-up" in other table. im newbie here im using c# asp.net mvc
 
this is my code any suggest on how to do. thanks in advance
 
  1. var package = _packageService.GetAll().Where(x => x.Status == "Picked-up");  
  2.   
  3.                         var shipmentItem = new ShipmentItems  
  4.                         {  
  5.                             ShipmentId = model.ShipmentId  
  6.                         };  
  7.                           
  8.                         if (package != null)  
  9.                         {  
  10.                             shipmentItem.PackageId = package.Id;  
  11.                         }  
  12.   
  13.                         _shipmentItemService.Add(shipmentItem);  
  14.                         return RedirectToAction("addshipmentitem");  

Answers (4)