Esempio n. 1
0
        // GET: SubPieces
        public ActionResult Index()
        {
            var sessionId = Convert.ToInt32(Session["UserID"]);

            if (Session["UserID"] == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            ViewBag.Company = Session["Company"];
            ViewBag.Logo    = Session["Logo"];
            ViewBag.Name    = Session["FirstName"];
            List <ParcaModel> messages = new List <ParcaModel>();
            ParcaRepository   r        = new ParcaRepository();

            messages = r.SubPieceList(sessionId);
            return(View(messages));
        }
Esempio n. 2
0
        public JsonResult SubPieceList(string basTarih, string bitTarih)
        {
            var sessionId = Convert.ToInt32(Session["UserID"]);

            List <ParcaModel> messages = new List <ParcaModel>();
            ParcaRepository   r        = new ParcaRepository();
            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.SubPieceList(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));
        }