コード例 #1
0
        public ProcessResult Delete(int id)
        {
            ProcessResult result = new ProcessResult();

            DAL.Extensions.DataBaseResult delete = _cityDal.Delete(id);
            switch (delete)
            {
            case DAL.Extensions.DataBaseResult.Success:
                result.Result = Extensions.BLLResult.Success;
                result.Errors.Add(Extensions.SuccessProcess);
                break;

            case DAL.Extensions.DataBaseResult.Referanced:
                result.Result = Extensions.BLLResult.Referanced;
                result.Errors.Add("İl başka tablolar üzerinde refere edildiğinden silinemedi");
                break;

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

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

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

            case DAL.Extensions.DataBaseResult.AlreadyFound:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(result);
        }
コード例 #2
0
ファイル: CityService.cs プロジェクト: Fatmasahin/KariyerNET
 public void Delete(City entity)
 {
     _cityDAL.Delete(entity);
 }
コード例 #3
0
ファイル: CityService.cs プロジェクト: umtylmz/SumoCommerce
        public bool DeleteByID(int entityID)
        {
            City deleted = GetByID(entityID);

            return(_cityDal.Delete(deleted) > 0);
        }
コード例 #4
0
 public void Detele(int id)
 {
     _context.Delete(new City {
         Id = id
     });
 }
コード例 #5
0
 public bool Delete(City model)
 {
     return(_cityDAL.Delete(model) > 0);
 }