public HttpResponseMessage GetTotalImports(HttpRequestMessage request, int year, int month) { try { string fromDate = DayHelper.GetFirstDayOfMonth(month, year).ToString("yyyy/MM/dd"); string toDate = DayHelper.GetLastDayOfMonth(month, year).ToString("yyyy/MM/dd"); var parameters = new SqlParameter[] { new SqlParameter("@fromDate", fromDate), new SqlParameter("@toDate", toDate), new SqlParameter("@comid", CurrentUser.Instance.User.ComId.ToString()) }; var result = new StoreprocedureHelper <GetTotalImportViewModel>().ExecuteStoreprocedure("exec GetTotalImportSP @fromDate,@toDate,@comid", parameters).ToList().OrderBy(n => n.Date); return(request.CreateResponse(HttpStatusCode.OK, result)); } catch (Exception ex) { Log(ex); return(request.CreateResponse(HttpStatusCode.BadRequest, "Lỗi hệ thống.")); } }