Пример #1
0
        public Response <RentDetail> ReturnCarToCompany(int RentDetailID, int KmInfo, int Score)
        {
            Response <RentDetail> res = new Response <RentDetail>();

            try
            {
                using (var rentDetailBusiness = new RentDetailBusiness())
                {
                    res = rentDetailBusiness.ReturnCarToCompany(RentDetailID, KmInfo, Score);
                }
            }
            catch (Exception ex)
            {
                res.isSuccess = false;
                res.Message   = "An error occured in ReturnCarToCompany() func. in Spice-WebService\n" + ex.Message;
            }
            return(res);
        }
Пример #2
0
        // POST: api/Rent
        // body = { RentID = int, KmInfo = int, Score = int }
        // returns the car to the company
        // SOAP Name = ReturnCarToCompany
        public IHttpActionResult Post([FromBody] JObject data)
        {
            var content = new Response <RentDetail>();

            try
            {
                using (var rentDetailBusiness = new RentDetailBusiness())
                {
                    content = rentDetailBusiness.ReturnCarToCompany(
                        Convert.ToInt32(data["RentID"]),
                        Convert.ToInt32(data["KmInfo"]),
                        Convert.ToInt32(data["Score"])
                        );
                }
            }
            catch (Exception ex)
            {
                content.isSuccess = false;
                content.Message  += ex.Message;
            }
            return(new StandartResult <RentDetail>(content, Request));
        }