public Vessel VAbbrevation(Vessel vessel, IVesselService _vesselService) { if (String.IsNullOrEmpty(vessel.Abbrevation) || vessel.Abbrevation.Trim() == "") { vessel.Errors.Add("Abbrevation", "Tidak boleh kosong"); } return(vessel); }
public VesselScheduleController(IVesselScheduleService vesselScheduleService, IVesselService vesselService, IBuyerService buyerService, ISelectService selectService) { _vesselScheduleService = vesselScheduleService; _vesselService = vesselService; _buyerService = buyerService; _selectService = selectService; }
public Vessel VName(Vessel vessel, IVesselService _vesselService) { if (String.IsNullOrEmpty(vessel.Name) || vessel.Name.Trim() == "") { vessel.Errors.Add("Name", "Tidak boleh kosong"); } else if (_vesselService.IsNameDuplicated(vessel)) { vessel.Errors.Add("Name", "Tidak boleh diduplikasi"); } return(vessel); }
public Vessel VObject(Vessel vessel, IVesselService _vesselService) { Vessel oldvessel = _vesselService.GetObjectById(vessel.Id); if (oldvessel == null) { vessel.Errors.Add("Generic", "Invalid Data For Update"); } else if (!VOffice(vessel.OfficeId, oldvessel.OfficeId)) { vessel.Errors.Add("Generic", "Invalid Data For Update"); } return(vessel); }
public Vessel VCreateObject(Vessel vessel, IVesselService _vesselService) { VName(vessel, _vesselService); if (!isValid(vessel)) { return(vessel); } VAbbrevation(vessel, _vesselService); if (!isValid(vessel)) { return(vessel); } return(vessel); }
public async Task <ActionResult> InsertVessel([FromBody] Vessel body, [FromServices] IVesselService vesselService) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var vessel = await vesselService.Insert(body); if (vessel.status == "Error") { return(BadRequest(vessel)); } return(Ok(vessel)); }
public DerLoadingScheduleController(IVesselScheduleService vesselScheduleService, IVesselService vesselService, IBuyerService buyerService, ISelectService selectService, IMeasurementService measurementService, INLSService nlsService, IHighlightOrderService highlightOrderService, IDerLoadingScheduleService derLoadingScheduleService) { _vesselScheduleService = vesselScheduleService; _vesselService = vesselService; _buyerService = buyerService; _selectService = selectService; _measurementService = measurementService; _nlsService = nlsService; _highlightOrderService = highlightOrderService; _derLoadingScheduleService = derLoadingScheduleService; }
public VesselController(IVesselService vesselService, IMeasurementService measurementService) { _vesselService = vesselService; _measurementService = measurementService; }
public VesselsController(IVesselService vesselService) { _vesselService = vesselService; }
public VesselController(IVesselService vesselService, ICommonService commonService) { this._vesselService = vesselService; _commonService = commonService; }