// GET: Admin public ActionResult Index() { if (Session["admin"] == null) { return(RedirectToAction("index", "Home")); } double totalrevenue = 0; foreach (var item in profitrepo.GetAll()) { totalrevenue += (double)item.ProfitAmount; } Session["netprofit"] = totalrevenue; return(View(productRepository.ProductsWithoutSize())); }
public IHttpActionResult Getproductwithoutsize() { double totalrevenue = 0; foreach (var item in profitrepo.GetAll()) { totalrevenue += (double)item.ProfitAmount; } return(Ok(productRepository.ProductsWithoutSize())); }