Ejemplo n.º 1
0
        public JsonResult GetLatestNotes(DateTime?lastDate)
        {
            var    items   = RemindHistoryManager.GetLasts(lastDate.Value);
            string message = string.Empty;
            bool   IsNew   = false;

            if (items.Count > 0)
            {
                IsNew = true;
            }


            return(Json(new
            {
                Html = this.RenderPartialView("Lists", items),
                Message = message,
                IsNew = IsNew
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult PostNote(string content)
        {
            RemindHistory model = new RemindHistory
            {
                sRemind  = content,
                kStaffId = (Guid)Membership.GetUser().ProviderUserKey
            };

            RemindHistoryManager.Create(model);

            //List<RemindHistory> items = new List<RemindHistory>();
            //items.Add(model);
            var    items   = RemindHistoryManager.GetLasts(model.dtDateAdd);
            string message = string.Empty;
            bool   IsNew   = false;

            if (items.Count > 0)
            {
                IsNew = true;
            }


            var staff      = StaffManager.GetById((Guid)Membership.GetUser().ProviderUserKey);
            var clientName = staff.sStaffName;

            Task.Factory.StartNew(() =>
            {
                var clients = Hub.GetClients <RealTimeJTableDemoHub>();
                clients.RecordUpdated(clientName, content);
            });

            return(Json(new
            {
                Html = this.RenderPartialView("Lists", items),
                Message = message,
                IsNew = IsNew
            }, JsonRequestBehavior.AllowGet));
        }