public void GetMedKitReportTest()
 {
     ReportController target = new ReportController(); // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     actual = target.GetLast30DaysReportByBookName();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void GetLast30DaysReportByCategoryTest()
 {
     ReportController target = new ReportController(); // TODO: Initialize to an appropriate value
     DateTime fromDate = new DateTime(2012,9,25); // TODO: Initialize to an appropriate value
     DateTime toDate = DateTime.Now; // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     actual = target.GetDateRangeReportByBookSize(fromDate, toDate);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Esempio n. 3
0
        public ActionResult Index(int? currentMonth, int? year)
        {
            int filteredMonth = DateTime.Now.Month;
            int filteredYear = DateTime.Now.Year;
            if (currentMonth != null)
            {
                filteredMonth = currentMonth.Value;
            }
            if (year != null)
            {
                filteredYear = year.Value;
            }
            ReportController  summaryInfo= new ReportController();
               var  TempleID = Convert.ToInt32(Request.Cookies["dcsankirtan"].Values["TempleID"]);
               var eventList = db.EventMasters.Where(o => o.EventDate.Value.Month == filteredMonth && o.EventDate.Value.Year == filteredYear && o.TempleID == TempleID)
                .OrderByDescending(o => o.ModifiedDate).ToList();
            if (eventList.Count == 0)
            {
                var lastestEvent = db.EventMasters.OrderByDescending(o => o.EventDate).FirstOrDefault();
                filteredMonth = lastestEvent.EventDate.Value.Month;
                filteredYear = lastestEvent.EventDate.Value.Year;
                eventList = db.EventMasters.Where(o => o.EventDate.Value.Month == filteredMonth && o.EventDate.Value.Year == filteredYear && o.TempleID == TempleID)
                   .OrderByDescending(o => o.ModifiedDate).ToList();
            }
            foreach (var item in eventList)
            {
                var report = summaryInfo.GetReportByBookName(DateTime.Now, DateTime.Now, item.EventID, TempleID);
                item.TotalBookPoint = report.Sum(o => o.TotalBookPoint);
                item.TotalNumberOfBooks = report.Sum(o => o.TotalNumberOfBooks);
                item.TotalNumberOfSets = report.Sum(o => o.TotalNumberOfSets);
            }
            var orderedlist = eventList.OrderByDescending(o => o.ModifiedDate);
            if (orderedlist.Count() == 0)
            {
                return View(new List<EventMaster> { new EventMaster{EventDate=DateTime.Now, EventType="DummyForNewTemple"}});

            }
            else
            {
                return View(orderedlist);

            }
        }
Esempio n. 4
0
        //
        // GET: /Event/Details/5
        public ActionResult Details(int id = 0)
        {
            var TempleID = Convert.ToInt32(Request.Cookies["dcsankirtan"].Values["TempleID"]);
            EventMaster eventmaster = db.EventMasters.Find(id);
            if (eventmaster == null)
            {
                return HttpNotFound();
            }
            ReportController summaryInfo = new ReportController();

            List<ReportData> result;

            result = summaryInfo.GetReportByBookName(DateTime.Now, DateTime.Now, eventmaster.EventID,TempleID);
            return View(result);
        }
Esempio n. 5
0
 public ActionResult EventsByDateRange(DateTime? fromDate, DateTime? toDate)
 {
     if (fromDate != null && toDate != null)
     {
         ReportController summaryInfo = new ReportController();
         var TempleID = Convert.ToInt32(Request.Cookies["dcsankirtan"].Values["TempleID"]);
         var eventList = db.EventMasters.Where(o => o.EventDate >= fromDate && o.EventDate <= toDate && o.TempleID == TempleID).ToList();
         foreach (var item in eventList)
         {
             var report = summaryInfo.GetReportByBookName(DateTime.Now, DateTime.Now, item.EventID, TempleID);
             item.TotalBookPoint = report.Sum(o => o.TotalBookPoint);
             item.TotalNumberOfBooks = report.Sum(o => o.TotalNumberOfBooks);
             item.TotalNumberOfSets = report.Sum(o => o.TotalNumberOfSets);
         }
         var orderedlist = eventList.OrderByDescending(o => o.ModifiedDate);
         return View(orderedlist);
     }
     else
     {
         return View();
     }
 }