// GET: Detail
        public ActionResult Index(int?page)
        {
            if (Session["UserID"] == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            var sessionId = Convert.ToInt32(Session["UserID"]);

            ViewBag.Name    = Session["FirstName"];
            ViewBag.Company = Session["Company"];
            ViewBag.Logo    = Session["Logo"];
            List <DetailModel> messages = new List <DetailModel>();
            DetailRepository   r        = new DetailRepository();

            messages = r.DetailList(sessionId);
            return(View(messages.ToList()));
        }
        public JsonResult DetailList(string basTarih, string bitTarih)
        {
            var sessionId = Convert.ToInt32(Session["UserID"]);

            List <DetailModel> messages = new List <DetailModel>();
            DetailRepository   r        = new DetailRepository();
            DateTime           start    = DateTime.MinValue;
            DateTime           end      = DateTime.MaxValue;
            var sDs = basTarih;
            var eDs = bitTarih;

            DateTime.TryParse(sDs, out start);
            DateTime.TryParse(eDs, out end);
            messages = r.DetailList(sessionId);
            if (start != DateTime.MinValue && end != DateTime.MinValue)
            {
                messages = messages.Where(x => Convert.ToDateTime(x.CreatedDate) >= start && Convert.ToDateTime(x.CreatedDate) <= end).ToList();
            }
            return(Json(messages, JsonRequestBehavior.AllowGet));
        }