Exemplo n.º 1
0
 public Continent VAbbrevation(Continent continent, IContinentService _continentService)
 {
     if (String.IsNullOrEmpty(continent.Abbrevation) || continent.Abbrevation.Trim() == "")
     {
         continent.Errors.Add("Abbrevation", "Tidak boleh kosong");
     }
     return(continent);
 }
 public CountryLocation UpdateObject(CountryLocation countrylocation, IContinentService _continentService)
 {
     if (!isValid(_validator.VUpdateObject(countrylocation, this, _continentService)))
     {
         countrylocation = _repository.UpdateObject(countrylocation);
     }
     return(countrylocation);
 }
 public CountryLocation CreateObject(CountryLocation countrylocation, IContinentService _continentService)
 {
     countrylocation.Errors = new Dictionary <String, String>();
     if (!isValid(_validator.VCreateObject(countrylocation, this, _continentService)))
     {
         countrylocation.MasterCode = _repository.GetLastMasterCode(countrylocation.OfficeId) + 1;
         countrylocation            = _repository.CreateObject(countrylocation);
     }
     return(countrylocation);
 }
        public CountryLocation VContinent(CountryLocation countrylocation, IContinentService _continentService)
        {
            Continent continent = _continentService.GetObjectById(countrylocation.ContinentId);

            if (continent == null)
            {
                countrylocation.Errors.Add("ContinentId", "Tidak boleh kosong");
            }

            return(countrylocation);
        }
Exemplo n.º 5
0
 public Continent VName(Continent continent, IContinentService _continentService)
 {
     if (String.IsNullOrEmpty(continent.Name) || continent.Name.Trim() == "")
     {
         continent.Errors.Add("Name", "Tidak boleh kosong");
     }
     else if (_continentService.IsNameDuplicated(continent))
     {
         continent.Errors.Add("Name", "Tidak boleh diduplikasi");
     }
     return(continent);
 }
Exemplo n.º 6
0
        public Continent VObject(Continent continent, IContinentService _continentService)
        {
            Continent oldcontinent = _continentService.GetObjectById(continent.Id);

            if (oldcontinent == null)
            {
                continent.Errors.Add("Generic", "Invalid Data For Update");
            }
            else if (!VOffice(continent.OfficeId, oldcontinent.OfficeId))
            {
                continent.Errors.Add("Generic", "Invalid Data For Update");
            }
            return(continent);
        }
Exemplo n.º 7
0
 public Continent VCreateObject(Continent continent, IContinentService _continentService)
 {
     VName(continent, _continentService);
     if (!isValid(continent))
     {
         return(continent);
     }
     VAbbrevation(continent, _continentService);
     if (!isValid(continent))
     {
         return(continent);
     }
     return(continent);
 }
Exemplo n.º 8
0
 public TicketController(
     IContinentService continentService,
     ICountryRegionService countryRegionService,
     IStateProvinceService stateProvinceService,
     IAreaService areaService,
     ITourService tourService
     )
 {
     _continentService     = continentService;
     _countryRegionService = countryRegionService;
     _stateProvinceService = stateProvinceService;
     _areaService          = areaService;
     _tourService          = tourService;
 }
Exemplo n.º 9
0
 public ContinentsController(IContinentService service, ILoggingFactory loggingFactory) : base(loggingFactory)
 {
     _service = service;
 }
Exemplo n.º 10
0
 public ContinentController(IErrorService errorService
                            , IContinentService continentService) : base(errorService)
 {
     _continentService = continentService;
 }
Exemplo n.º 11
0
 public ContinentsController(IContinentService continentService)
 {
     _continentService = continentService;
 }
Exemplo n.º 12
0
 public HomeController(ILogger <HomeController> logger, IContinentService continentService, ICountryService countryService)
 {
     _logger           = logger;
     _continentService = continentService;
     _countryService   = countryService;
 }
Exemplo n.º 13
0
 public CountryController(ICountryService countryService, IContinentService continentService)
 {
     _countryService   = countryService;
     _continentService = continentService;
 }
 public CountryLocation VUpdateObject(CountryLocation countrylocation, ICountryLocationService _countrylocationService, IContinentService _continentService)
 {
     VName(countrylocation, _countrylocationService);
     if (!isValid(countrylocation))
     {
         return(countrylocation);
     }
     VAbbrevation(countrylocation, _countrylocationService);
     if (!isValid(countrylocation))
     {
         return(countrylocation);
     }
     VContinent(countrylocation, _continentService);
     if (!isValid(countrylocation))
     {
         return(countrylocation);
     }
     return(countrylocation);
 }