public ProcessResult Update(City newInfoCity)
        {
            ProcessResult result = VerifeyModel(newInfoCity);

            if (result.Result != Extensions.BLLResult.Verified)
            {
                return(result);
            }

            DAL.Extensions.DataBaseResult update = _cityDal.Update(newInfoCity);

            switch (update)
            {
            case DAL.Extensions.DataBaseResult.AlreadyFound:
                result.Result = Extensions.BLLResult.AlreadyFound;
                result.Errors.Add(Extensions.AlreadyFoundString(newInfoCity.Name));
                break;

            case DAL.Extensions.DataBaseResult.Error:
                result.Result = Extensions.BLLResult.InnerException;
                result.Errors.Add(Extensions.InnerException);
                break;

            case DAL.Extensions.DataBaseResult.Success:
                result.Result = Extensions.BLLResult.Success;
                result.Errors.Add(Extensions.SuccessProcess);
                break;

            case DAL.Extensions.DataBaseResult.ServerDisable:
                result.Result = Extensions.BLLResult.ServerDisable;
                result.Errors.Add(Extensions.ServerDisable);
                break;

            case DAL.Extensions.DataBaseResult.Referanced:
                break;

            case DAL.Extensions.DataBaseResult.NotFound:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(result);
        }
Beispiel #2
0
 public void Update(City entity)
 {
     _cityDAL.Update(entity);
 }
Beispiel #3
0
 public bool Update(City entity)
 {
     return(_cityDal.Update(entity) > 0);
 }
Beispiel #4
0
 public void Update(City data)
 {
     _context.Update(data);
 }
Beispiel #5
0
 public bool Update(City model)
 {
     return(_cityDAL.Update(model) > 0);
 }