Example #1
0
        public FileStreamResult GetListPerson()
        {
            StringBuilder sb = new StringBuilder();

            foreach (var personItem in PersonHelper.PersonModelList)
            {
                var awardsIds =
                    PersonLinkAwardHelper.GetPersonLinkAwardList()
                    .Where(_ => _.PersonModelData.Id == personItem.Id)
                    .Select(_ => _.AwardModelData.Id)
                    .ToList();
                if (awardsIds.Any())
                {
                    foreach (var itemawardsId in awardsIds)
                    {
                        sb.Append(string.Format("{0} {1} \r\n", personItem.Name, AwardHelper.GetAwardById(itemawardsId).Title));
                    }
                }
                else
                {
                    sb.Append(string.Format("{0} Наград нет \r\n", personItem.Name));
                }
            }

            var fs = new MemoryStream(Encoding.UTF8.GetBytes(sb.ToString()));

            return(File(fs, "text/csv"));
        }
Example #2
0
 public ActionResult ModalAction(Guid id)
 {
     return(PartialView("ModalContent", AwardHelper.GetAwardById(id)));
 }
 public ActionResult ModalAction(string id)
 {
     return(PartialView("_ModalContentPartial", AwardHelper.GetAwardById(Guid.Parse(id))));
 }