public List <Reports> Report(string type = "year", string year = "2016", string month = "1", string day = "1")
        {
            GetReport getrep = new GetReport();

            RangeDate range = getrep.getRange();

            char[] split_char = new char[] { '/' };



            List <Reports> reports;

            if (type == "year")
            {
                reports = getrep.getMonthInfo(year);
            }
            else if (type == "month")
            {
                reports = getrep.getWeekInfo(year, month);
            }
            else //(type == "day")
            {
                reports = getrep.getDayInfo(year, month);
            }

            return(reports);
        }
Example #2
0
        public ActionResult Report(string type = "year", string thisyear = "2016", string month = "1", string day = "1")
        {
            GetReport getrep = new GetReport();

            RangeDate range = getrep.getRange();

            char[] split_char = new char[] { '/' };

            string[] param = range.enddate.Split(split_char);


            ViewBag.Year  = thisyear;
            ViewBag.Month = month;
            ViewBag.Day   = day;
            ViewBag.type  = type;

            List <Reports> reports;

            if (type == "year")
            {
                reports = getrep.getMonthInfo(thisyear);
            }
            else if (type == "month")
            {
                reports = getrep.getWeekInfo(thisyear, month);
            }
            else if (type == "day")
            {
                reports = getrep.getDayInfo(thisyear, month);
            }
            else
            {
                List <DetailReport> dreports;

                dreports = getrep.getDayDetailInfo(thisyear, month, day);
                return(View("Detail", dreports));
            }
            return(View(reports));
        }