public HttpResponseMessage Get(int id) { var quotes = _quotesRepository.Get(id); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, quotes); return(response); }
// GET: EmailAcceptedOffer public ActionResult Index() { string errMsg = String.Empty; var nvc = Request.QueryString; string strQHK = nvc["q"] ?? "0"; int QHK = Convert.ToInt32(strQHK); int VendorKey = Convert.ToInt32(nvc["v"] ?? "0"); int Winner = Convert.ToInt32(nvc["w"] ?? "0"); var quote = repoQuotes.Get(QHK, ref errMsg); var vendor = repoVendors.Get(VendorKey, ref errMsg); var protocol = Request.IsSecureConnection ? "https:" : "http:"; var host = Request.Url.Host.ToLower(); var path = Request.Url.AbsolutePath.ToLower().Replace("emailacceptedoffer", ""); path = host + @"/" + path; path = path.Replace(@"//", @"/"); path = protocol + @"//" + path; ViewBag.path = path; ViewBag.Customer = quote.CustName; ViewBag.Quote = quote; ViewBag.Vendor = vendor.VendorName; ViewBag.Winner = Winner == 1; return(View()); }
public object GetAll() { try { var queryValues = Request.RequestUri.ParseQueryString(); int page = Convert.ToInt32(queryValues["page"]); int start = Convert.ToInt32(queryValues["start"]); int limit = Convert.ToInt32(queryValues["limit"]); int id = Convert.ToInt32(queryValues["id"]); int orden = Convert.ToInt32(queryValues["orden"]); string filterDateField = queryValues["FilterDateField"]; string strDateFrom = queryValues["DateFrom"]; string strDateTo = queryValues["DateTo"]; int roleId = Convert.ToInt32(queryValues["Role"]); string strFilterBalance = queryValues["FilterBalance"]; Decimal filterBalance = String.IsNullOrEmpty(strFilterBalance) ? 0 : Convert.ToDecimal(strFilterBalance); string FilterShowWithInvoice = queryValues["FilterShowWithInvoice"]; FilterShowWithInvoice = !String.IsNullOrEmpty(FilterShowWithInvoice) ? FilterShowWithInvoice : "All"; #region Configuramos el orden de la consulta si se obtuvo como parametro string strOrder = !string.IsNullOrWhiteSpace(queryValues["sort"]) ? queryValues["sort"] : ""; strOrder = strOrder.Replace('[', ' '); strOrder = strOrder.Replace(']', ' '); Sort sort; if (!string.IsNullOrWhiteSpace(strOrder)) { sort = JsonConvert.DeserializeObject <Sort>(strOrder); } else { sort = new Sort(); } #endregion #region Configuramos el filtro de la consulta si se obtuvo como parametro string strFilter = !string.IsNullOrWhiteSpace(queryValues["filter"]) ? queryValues["filter"] : ""; strFilter = strFilter.Replace('[', ' '); strFilter = strFilter.Replace(']', ' '); Filter filter; if (!string.IsNullOrWhiteSpace(strFilter)) { filter = JsonConvert.DeserializeObject <Filter>(strFilter); } else { filter = new Filter(); } #endregion Configuramos el filtro de la consulta si se obtuvo como parametro string query = !string.IsNullOrWhiteSpace(queryValues["query"]) ? queryValues["query"] : ""; int totalRecords = 0; if (id == 0) { object json; string msgError = ""; var lista = repository.GetList(query, filter, sort, page, start, limit, ref totalRecords, ref msgError); json = new { total = totalRecords, data = lista, success = true }; return(json); } else { string msgError = ""; QuoteHeader estatus = repository.Get(id, ref msgError); object json = new { data = estatus, success = true, message = msgError }; return(json); } } catch (Exception ex) { LogManager.Write("ERROR:" + Environment.NewLine + "\tMETHOD = " + this.GetType().FullName + "." + MethodBase.GetCurrentMethod().Name + Environment.NewLine + "\tMESSAGE = " + ex.Message); object error = new { message = ex.Message }; object json = new { message = ex.Message, success = false }; return(json); } }
public Quotes Get(long id) { return(_quotesRepository.Get(id)); }