/// <summary> /// 删除地区价格趋势 /// </summary> /// <param name="entity">地区价格趋势</param> public HttpResponseMessage Delete([FromBody]AreaPriceTrend entity) { if (entity == null) { return new HttpResponseMessage(HttpStatusCode.BadRequest); } else { AreaPriceTrendFunction areaPriceTrendFunction = new AreaPriceTrendFunction(); int error = areaPriceTrendFunction.DeleteAreaPriceTrend(entity); var response = GetResponse.PriceTrendResponse(error); return response; } }
/// <summary> /// 查询地区价格趋势 /// </summary> /// <returns>地区价格趋势,总页数</returns> public IEnumerable<object> Get() { int totalPage = 0; List<AreaPriceTrend> result = new List<AreaPriceTrend>(); var queryString = Request.GetQueryNameValuePairs(); var queryConditions = new AreaPriceTrendQueryConditions(); queryConditions.GetValues(queryString); AreaPriceTrendFunction areaPriceTrendFunction = new AreaPriceTrendFunction(); areaPriceTrendFunction.QueryAreaPriceTrend(queryConditions, out result, out totalPage); List<object> objectResult = new List<object>() { result, new { totalPage = totalPage } }; return objectResult; }
/// <summary> /// 删除地区价格趋势 /// </summary> /// <param name="area">地区</param> public HttpResponseMessage Delete(string area) { if (string.IsNullOrEmpty(area)) { return new HttpResponseMessage(HttpStatusCode.BadRequest); } else { var entity = new AreaPriceTrend() { Area = area }; AreaPriceTrendFunction areaPriceTrendFunction = new AreaPriceTrendFunction(); int error = areaPriceTrendFunction.DeleteAreaPriceTrend(entity); var response = GetResponse.PriceTrendResponse(error); return response; } }
/// <summary> /// 查询单个地区价格趋势 /// </summary> /// <param name="area">地区</param> /// <returns>地区价格趋势,总页数</returns> public IEnumerable<object> Get(string area) { int totalPage = 0; List<AreaPriceTrend> result = new List<AreaPriceTrend>(); var queryConditions = new AreaPriceTrendQueryConditions() { Area = area }; AreaPriceTrendFunction areaPriceTrendFunction = new AreaPriceTrendFunction(); areaPriceTrendFunction.QueryAreaPriceTrend(queryConditions, out result, out totalPage); List<object> objectResult = new List<object>() { result, new { totalPage = totalPage } }; return objectResult; }
/// <summary> /// 新增地区价格趋势 /// </summary> /// <param name="auto">是否添加当前地区均价到价格趋势</param> public HttpResponseMessage Post(int auto) { if (auto == 1) { AreaPriceTrendFunction areaPriceTrendFunction = new AreaPriceTrendFunction(); int error = areaPriceTrendFunction.AddCurrentAreaPriceTrends(); var response = GetResponse.PriceTrendResponse(error); return response; } else { return new HttpResponseMessage(HttpStatusCode.BadRequest); } }