// GET: Sales/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } try { var GetBill = Billing.GetBill(db, id).ToList(); ViewBag.GetBill = GetBill; var model = Models.Billing.GetBill(db, id).FirstOrDefault(); return(View(model)); } catch (Exception ex) { ViewBag.Error = ex.Message; } return(View()); }