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