Beispiel #1
0
        public JsonResult GetNewMessages(string j, int?_START_LIMIT, int?_END_LIMIT)
        {
            dynamic x      = JsonConvert.DeserializeObject(j);
            string  conStr = Session["conStr"].ToString(); //ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString;
            int     uid    = Convert.ToInt32(Session["CURENT_USER_ID"]);

            if (x.id_dosar != null)
            {
                DosareRepository dr = new DosareRepository(uid, conStr);
                Dosar            d  = (Dosar)dr.Find(Convert.ToInt32(x.id_dosar)).Result;
                //return Json(d.GetNewMesaje(Convert.ToDateTime(x.last_refresh)), JsonRequestBehavior.AllowGet);
                return(Json(d.GetNewMesaje(DateTime.ParseExact(Convert.ToString(x.last_refresh), CommonFunctions.DATE_TIME_FORMAT, System.Globalization.CultureInfo.InvariantCulture)), JsonRequestBehavior.AllowGet));
            }
            else
            {
                Utilizator u = (Utilizator)Session["CURENT_USER"];
                return(Json(u.GetNewMesaje(DateTime.ParseExact(Convert.ToString(x.last_refresh), CommonFunctions.DATE_TIME_FORMAT, System.Globalization.CultureInfo.InvariantCulture), _START_LIMIT, _END_LIMIT), JsonRequestBehavior.AllowGet));
            }
        }