public ActionResult BidsIndex(int?id) { var lot = lotService.GetById(id.Value); var model = lot.ToLotViewModel(); model.Bids = GetBidsList(lot); if (Request.IsAjaxRequest()) { return(PartialView("_BidsList", model.Bids)); } else { var user = userService.GetOneByPredicate(u => u.Name == User.Identity.Name); ViewBag.isBidPossible = CheckBidPossibility(user, lot); return(View("Details", model)); } }
private static void ShowBids(string command) { try { log.Trace("ShowBids"); string[] cmd = command.Split(' '); if (cmd.Length > 1) { int id = Int32.Parse(cmd[1]); var lot = lotService.GetById(id); if (lot != null) { foreach (var bid in lot.Bids) { Console.WriteLine("N: {0}, Date: {1}, Price: {2}", bid.Id, bid.Date.ToString("dd.MM.yyyy"), bid.Price); } } else { Console.WriteLine("Wrong id"); return; } } } catch (FormatException fe) { log.Error("Error (ShowBids): Format is wrong: " + fe.ToString()); Console.WriteLine("Wrong id"); } catch (SystemException se) { log.Error("Error (ShowBids): Operation with service is wrong: " + se.ToString()); } }