public GarageSaleTO GetGarageyByID(Guid garageId)
        {
            GarageSaleTO result = null;

            result = _repository.GetGarageyByID(garageId);
            return(result);
        }
        public HttpResponseMessage PutGarageSale(Guid id, GarageSaleTO garageSale)
        {
            garageSale.GarageSaleID = id;
            //    throw new HttpResponseException(HttpStatusCode);

            var response = Request.CreateResponse <GarageSaleTO>(System.Net.HttpStatusCode.OK, garageSale);

            return(response);
        }
        public HttpResponseMessage Post(GarageSaleTO garageSale)
        {
            HttpResponseMessage response = Request.CreateResponse <GarageSaleTO>(System.Net.HttpStatusCode.NotAcceptable, garageSale);

            if (_repository.Add(garageSale))
            {
                response = Request.CreateResponse <GarageSaleTO>(System.Net.HttpStatusCode.Created, garageSale);
            }

            return(response);
        }
Exemplo n.º 4
0
 public bool Update(GarageSaleTO branch)
 {
     try
     {
         IGarageRepository repo = new GarageRepository(this.UserId);
         return(repo.Update(branch));
     }
     catch (Exception ex)
     {
         throw new GarageSaleException("GarageSaleUpdateError", ex);
     }
 }
Exemplo n.º 5
0
 public bool Add(GarageSaleTO newBranch)
 {
     try
     {
         IGarageRepository repo = new GarageRepository(this.UserId);
         return(repo.Add(newBranch));
     }
     catch (Exception ex)
     {
         throw new GarageSaleException("GarageSaleAddError", ex);
     }
 }