public ActionResult Revenue(int?month, int?year, string searchString, int page = 1, int pageSize = 3) { var dao = new BillAdDAO(); if (month == null) { month = DateTime.Now.Month; } if (year == null) { year = DateTime.Now.Year; } var model = dao.ListAll(searchString, page, pageSize); var totalMoneyThisMonth = dao.getMoneyByMonth(month, year); var totalMoneyThisYear = dao.getMoneyByYear(year); var totalmoneyMerchant = dao.getMoneyByMerchant(searchString); var totalmoney = dao.GetTotalMoney(); ViewBag.RevenueYear = totalMoneyThisYear; ViewBag.RevenueMonth = totalMoneyThisMonth; ViewBag.RevenueTotal = totalmoney; ViewBag.RevenueMerchant = totalmoneyMerchant; ViewBag.Month = month; ViewBag.Year = year; ViewBag.SearchString = searchString; return(View(model)); }
public ActionResult Payment(Account account, long IdOrderAD, decimal Money, string TradeCode) { if (ModelState.IsValid) { var dao = new BillAdDAO(); var bill = new BillAd(); bill.Address = account.Address; bill.CMND_ID = account.CMND; bill.CreateDate = DateTime.Now; bill.IdOrderAd = IdOrderAD; bill.Money = Money; bill.NameCus = account.Name; bill.Phone = account.Phone; bill.TradingCode = TradeCode; long id = dao.Insert(bill); if (id > 0) { var IdAds = new OrderAdvertisementDAO().UpdateStatusComplete(IdOrderAD); if (IdAds > 0) { new advertisementDAO().ActiveAd(IdAds); } setAlert("Đã thanh toán thành công", "success"); return(RedirectToAction("Index", "Advertisement")); } else { ModelState.AddModelError("", "Thêm tài khoản thất bại"); } } return(View("Index")); }
// GET: Admin/Revenue public ActionResult Index(string searchString, DateTime?searchDate, long?searchID, int page = 1, int pageSize = 10) { var dao = new BillAdDAO(); var model = dao.ListAllPaging(searchString, searchDate, searchID, page, pageSize); ViewBag.SearchString = searchString; ViewBag.SearchDate = searchDate; ViewBag.SearchID = searchID; return(View(model)); }