Пример #1
0
        public async Task <JsonResult> GetReceivedForToday()
        {
            SetViewbag(userContext.CourtId);
            SetViewbagArea(userContext.CourtId);

            bool          isOk        = false;
            string        messageErr  = "";
            List <string> viewsForDay = new List <string>();

            List <DeliveryItem> deliveries = service.GetReceivedForToday(userContext.UserId, DateTime.Now.Date).ToList();

            foreach (var model in deliveries)
            {
                ViewBag.showButtons = false;
                ViewBag.conteinerId = Guid.NewGuid();
                var item = await RenderPartialViewToString("_AddReceived", model);

                viewsForDay.Add(item);
            }
            return(Json(new
            {
                isOk = isOk,
                messageErr = messageErr,
                viewsForDay = viewsForDay
            }));
        }