Exemplo n.º 1
0
        public HttpResponseMessage View()
        {
            var deserializer = new JavaScriptSerializer();

            bal = new T_Planing_WeatherCollectionBAL();
            ResposeType         response   = new ResposeType();
            HttpResponseMessage mapMessage = null;

            T_Planing_WeatherCollectionDTO dto = null;

            try
            {
                var context = HttpContext.Current;

                dto = ConvertX.GetReqeustForm <T_Planing_WeatherCollectionDTO>();

                logger.debug("View dto:" + dto.ToString());
                dto = bal.FindByPK(dto);

                response.statusCode = true;
                response.data       = dto;
            }
            catch (Exception ex)
            {
                logger.error("View error:" + ex.ToString());
                response.statusText = ex.ToString();
            }

            mapMessage = Request.CreateResponse(HttpStatusCode.OK, response);
            return(mapMessage);
        }
Exemplo n.º 2
0
        public HttpResponseMessage Delete()
        {
            bal = new T_Planing_WeatherCollectionBAL();
            ResposeType         response   = new ResposeType();
            HttpResponseMessage mapMessage = null;

            T_Planing_WeatherCollectionDTO dto = null;

            try
            {
                var context = HttpContext.Current;
                //context.Response.ContentType = "multipart/form-data";

                dto = ConvertX.GetReqeustForm <T_Planing_WeatherCollectionDTO>();

                logger.debug("Delete dto:" + dto.ToString());
                response.statusCode = bal.Delete(dto);
            }
            catch (Exception ex)
            {
                logger.error("Delete error:" + ex.ToString());
                response.statusText = ex.ToString();
            }

            mapMessage = Request.CreateResponse(HttpStatusCode.OK, response);
            return(mapMessage);
        }