public void Delete(ShipmentDTO client) { IWindowManager manager = new WindowManager(); ShipmentService.Delete(client); Reload(); }
public async Task <IActionResult> Delete([FromRoute] string id) { if (string.IsNullOrEmpty(id)) { return(BadRequest()); } var objDB = shipService.ShipmentExistById(id, _context); if (objDB == null) { throw new Exception(Contants.NOTFOUND); } await shipService.Delete(objDB, _context); return(Ok()); }
public void Throws_When_ShipmentNotFound() { var options = Utils.GetOptions(nameof(Throws_When_ShipmentNotFound)); using (var arrangeContext = new DeliverItContext(options)) { arrangeContext.Warehouses.AddRange(Utils.SeedWarehouses()); arrangeContext.Statuses.AddRange(Utils.SeedStatuses()); arrangeContext.Addresses.AddRange(Utils.SeedAddresses()); arrangeContext.SaveChanges(); } using (var actContext = new DeliverItContext(options)) { var sut = new ShipmentService(actContext); Assert.ThrowsException <ArgumentNullException>(() => sut.Delete(1)); } }
public void Delete_Selected_Shipment() { var options = Utils.GetOptions(nameof(Delete_Selected_Shipment)); using (var arrangeContext = new DeliverItContext(options)) { arrangeContext.Shipments.AddRange(Utils.SeedShipments()); arrangeContext.Warehouses.AddRange(Utils.SeedWarehouses()); arrangeContext.Statuses.AddRange(Utils.SeedStatuses()); arrangeContext.Addresses.AddRange(Utils.SeedAddresses()); arrangeContext.SaveChanges(); } using (var actContext = new DeliverItContext(options)) { var sut = new ShipmentService(actContext); var result = sut.Delete(1); Assert.IsTrue(result); } }
public BaseResult Delete(int id) { return(_shipmentService.Delete(id)); }
public void DeleteAllShipments() { var all = ((ShipmentService)ShipmentService).GetAll(); ShipmentService.Delete(all); }