public ActionResult GetAllOrders() { var service = new BricklinkService(); var orders = service.GetOrdersNotInDb(); return(Json(orders, JsonRequestBehavior.AllowGet)); }
public ActionResult List() { var service = new BricklinkService(); var result = service.GetOrders("PACKED"); return(View(result)); }
public ActionResult UpdateInventory(int colourId) { var service = new BricklinkService(); var errors = service.UpdateInventoryForColour(colourId); return(Json(new { success = errors.Any(), errors = errors.Any() ? errors.Aggregate((current, next) => current + ", " + next) : "" }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetByHistory(string location) { var service = new BricklinkService(); var locations = service.GetHistoriesByLocation(location); var model = new LocationHistoryModel(); model.AddRange(locations); model.Location = location; return(View(model)); }
public ActionResult AddOrder(string orderId) { var service = new BricklinkService(); try { service.GetOrderWithItems(orderId); return(Json(new { success = true, error = "" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { success = false, error = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Export(IEnumerable <OrderModel> orders) { var service = new BricklinkService(); var ordersWithShipping = orders .Where(x => x.Selected) .Select(x => service.GetOrderForCsv(x.OrderId.ToString())) .OrderBy(x => x.ShippingMethod) .ThenBy(x => x.Weight) .ThenBy(x => x.Name); var bytes = WriteCsvToMemory(ordersWithShipping); return(File(bytes, "text/csv", DateTime.Now.ToString("yyyy-MM-dd") + " Bricklink Export.csv")); }
public BricklinkCatalogController() { _service = new BricklinkService(); }
public BricklinkSlipController() { _service = new BricklinkService(); }
public ActionResult GetSetInfo(string set) { var service = new BricklinkService(); return(Json(service.GetSetDetails(set), JsonRequestBehavior.AllowGet)); }