public Vessel VAbbrevation(Vessel vessel, IVesselService _vesselService)
 {
     if (String.IsNullOrEmpty(vessel.Abbrevation) || vessel.Abbrevation.Trim() == "")
     {
         vessel.Errors.Add("Abbrevation", "Tidak boleh kosong");
     }
     return(vessel);
 }
Example #2
0
 public VesselScheduleController(IVesselScheduleService vesselScheduleService,
                                 IVesselService vesselService,
                                 IBuyerService buyerService,
                                 ISelectService selectService)
 {
     _vesselScheduleService = vesselScheduleService;
     _vesselService         = vesselService;
     _buyerService          = buyerService;
     _selectService         = selectService;
 }
Example #3
0
 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);
 }
Example #7
0
        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));
        }
Example #8
0
 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 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;
 }
Example #10
0
 public VesselController(IVesselService vesselService, IMeasurementService measurementService)
 {
     _vesselService = vesselService;
     _measurementService = measurementService;
 }
Example #11
0
 public VesselsController(IVesselService vesselService)
 {
     _vesselService = vesselService;
 }
Example #12
0
 public VesselController(IVesselService vesselService, IMeasurementService measurementService)
 {
     _vesselService      = vesselService;
     _measurementService = measurementService;
 }
Example #13
0
 public VesselController(IVesselService vesselService, ICommonService commonService)
 {
     this._vesselService = vesselService;
     _commonService      = commonService;
 }