コード例 #1
0
        // GET: api/Brand/id
        // brings one brand with given id
        // url parameter: id of needed Brand
        // SOAP Name = FetchOneBrandById
        public IHttpActionResult Get(int id)
        {
            var content = new Response <Brand>();

            try
            {
                using (var brandBusiness = new BrandBusiness())
                {
                    content = brandBusiness.FetchOneBrandById(id);
                }
            }
            catch (Exception ex)
            {
                content.isSuccess = false;
                content.Message  += ex.Message;
            }
            return(new StandartResult <Brand>(content, Request));
        }
コード例 #2
0
        public Response <Brand> FetchOneBrandById(int BrandID)
        {
            Response <Brand> res = new Response <Brand>();

            try
            {
                using (var brandBusiness = new BrandBusiness())
                {
                    res = brandBusiness.FetchOneBrandById(BrandID);
                }
            }
            catch (Exception ex)
            {
                res.Message   = "An error occured in FetchOneBrandById() in Spice-WebService.BrandService\n" + ex.Message;
                res.isSuccess = false;
            }
            return(res);
        }