public ActionResult ShowCaseHotMap() { ShowCaseHotMapModel sm = new ShowCaseHotMapModel(); ShowCaseHotMapRequest sr = new ShowCaseHotMapRequest(); sr.StartActualDeliveryDate = DateTime.Now.Year.ToString() + "-01-01"; sr.EndActualDeliveryDate = DateTime.Now.ToString("yyyy-MM-dd"); sm.Request = sr; return(View(sm)); }
private string Where(ShowCaseHotMapRequest Request) { StringBuilder sb = new StringBuilder(); sb.Append("and CustomerId =" + Request.Customer + ""); if (!string.IsNullOrEmpty(Request.City)) { sb.Append("and EndCityName ='" + Request.City + "'"); } if (!string.IsNullOrEmpty(Request.StartActualDeliveryDate)) { sb.Append("and ActualDeliveryDate >='" + Request.StartActualDeliveryDate + "'"); } if (!string.IsNullOrEmpty(Request.EndActualDeliveryDate)) { sb.Append("and ActualDeliveryDate <'" + Request.EndActualDeliveryDate + " 23:59:59'"); } return(sb.ToString()); }
public IEnumerable <ShowCaseHotMap> ShowCaseHotMap(ShowCaseHotMapRequest Request) { string SqlWhere = ""; if (Request != null) { SqlWhere = Where(Request); } DbParam[] dbParams = new DbParam[] { new DbParam("@SqlWhere", DbType.String, SqlWhere, ParameterDirection.Input), new DbParam("@City", DbType.String, Request.City, ParameterDirection.Input), }; if (Request.HotMapType == 0) { return(base.ExecuteDataTable("Proc_ShowCaseHotMap", dbParams).ConvertToEntityCollection <ShowCaseHotMap>()); } else { return(base.ExecuteDataTable("Proc_ShowCaseHotMapType", dbParams).ConvertToEntityCollection <ShowCaseHotMap>()); } }
public Response <ShowCaseHotMapResponse> ShowCaseHotMap(ShowCaseHotMapRequest Request) { Response <ShowCaseHotMapResponse> response = new Response <ShowCaseHotMapResponse>() { Result = new ShowCaseHotMapResponse() }; try { PodReportAccessor accessor = new PodReportAccessor(); response.Result.showCaseHotMap = accessor.ShowCaseHotMap(Request); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }