CSP_Web.Controllers.SubscriptionController.Usage C# (CSharp) Method

Usage() public method

public Usage ( string SubscriptionId, System.DateTime StartDate = null, System.DateTime EndDate = null, string Granularity = "daily", bool ShowDetails = false, int Count = 1000 ) : System.Web.Mvc.ActionResult
SubscriptionId string
StartDate System.DateTime
EndDate System.DateTime
Granularity string
ShowDetails bool
Count int
return System.Web.Mvc.ActionResult
        public ActionResult Usage(string SubscriptionId, DateTime? StartDate = null, DateTime? EndDate = null, string Granularity = "daily", bool ShowDetails = false, int Count = 1000)
        {
            if (SubscriptionId == null)
                return RedirectToAction("Index", "Customer");

            if (!StartDate.HasValue)
                StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

            if (!EndDate.HasValue)
                EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);

            if (DateTime.Compare(EndDate.Value, StartDate.Value) == 0)
                StartDate = StartDate.Value.AddMonths(-1);

            ViewBag.SubscriptionId = SubscriptionId;
            ViewBag.StartDate = StartDate.Value;
            ViewBag.EndDate = EndDate.Value;
            ViewBag.Granularity = Granularity;
            ViewBag.ShowDetails = ShowDetails;
            ViewBag.Count = Count;

            return View();
        }