public CityLocation UpdateObject(CityLocation citylocation, ICountryLocationService _countrylocationService)
 {
     if (!isValid(_validator.VUpdateObject(citylocation, this, _countrylocationService)))
     {
         citylocation = _repository.UpdateObject(citylocation);
     }
     return(citylocation);
 }
 public CountryLocation VAbbrevation(CountryLocation countrylocation, ICountryLocationService _countrylocationService)
 {
     if (String.IsNullOrEmpty(countrylocation.Abbrevation) || countrylocation.Abbrevation.Trim() == "")
     {
         countrylocation.Errors.Add("Abbrevation", "Tidak boleh kosong");
     }
     return(countrylocation);
 }
 public CityLocation CreateObject(CityLocation citylocation, ICountryLocationService _countrylocationService)
 {
     citylocation.Errors = new Dictionary <String, String>();
     if (!isValid(_validator.VCreateObject(citylocation, this, _countrylocationService)))
     {
         citylocation.MasterCode = _repository.GetLastMasterCode(citylocation.OfficeId) + 1;
         citylocation            = _repository.CreateObject(citylocation);
     }
     return(citylocation);
 }
 public CountryLocation VName(CountryLocation countrylocation, ICountryLocationService _countrylocationService)
 {
     if (String.IsNullOrEmpty(countrylocation.Name) || countrylocation.Name.Trim() == "")
     {
         countrylocation.Errors.Add("Name", "Tidak boleh kosong");
     }
     else if (_countrylocationService.IsNameDuplicated(countrylocation))
     {
         countrylocation.Errors.Add("Name", "Tidak boleh diduplikasi");
     }
     return(countrylocation);
 }
Beispiel #5
0
        public CityLocation VCountryLocation(CityLocation citylocation, ICountryLocationService _countrylocationservice)
        {
            CountryLocation countrylocation = _countrylocationservice.GetObjectById(citylocation.CountryLocationId);

            if (countrylocation == null)
            {
                citylocation.Errors.Add("Country", "Tidak boleh kosong");
            }
            else if (!VOffice(citylocation.OfficeId, countrylocation.OfficeId))
            {
                citylocation.Errors.Add("Country", "Invalid Country");
            }
            return(citylocation);
        }
 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);
 }
Beispiel #7
0
 public CityLocation VUpdateObject(CityLocation citylocation, ICityLocationService _citylocationService, ICountryLocationService _countrylocationservice)
 {
     VObject(citylocation, _citylocationService);
     if (!isValid(citylocation))
     {
         return(citylocation);
     }
     VName(citylocation, _citylocationService);
     if (!isValid(citylocation))
     {
         return(citylocation);
     }
     VAbbrevation(citylocation);
     if (!isValid(citylocation))
     {
         return(citylocation);
     }
     VCountryLocation(citylocation, _countrylocationservice);
     if (!isValid(citylocation))
     {
         return(citylocation);
     }
     return(citylocation);
 }