Beispiel #1
0
        public PartialViewResult groupContentList(int id, int?pageNumber = null, int?itemsPerPage = null)
        {
            int listCount = 0;
            int offset    = 0;

            offset = (((int)pageNumber - 1) * (int)itemsPerPage);

            GroupContentModel objGroupContent = new GroupContentModel();

            /* Contents
             * Projects
             * Publications
             * Activities
             * Galleries
             * */

            //Projects


            objGroupContent.Publications = PublicationMap.Map(_repoPublication.GetList(x => x.GroupId == id).OrderBy(x => x.CreatedDate).ToList());

            ViewBag.PagedListofPublications = objGroupContent.Publications ?? new List <PublicationModel>();
            //ViewBag.TotalUserCount = listCount;
            return(PartialView("_GroupContents", objGroupContent));
        }
Beispiel #2
0
 public ActionResult Publication(PublicationModel objPublication)
 {
     try
     {
         ViewBag.DisciplineId = new SelectList(_repoDiscipline.GetList().ToList(), "Id", "DisciplineName", "");
         if (ModelState.IsValid)
         {
             if (objPublication.IsNew == true)
             {
                 objPublication.CreatedBy   = _repoUserProfile.GetSingle(x => x.UserId == CurrentUser.UserId).Id;
                 objPublication.CreatedDate = DateTime.Now;
                 _repoPublication.Add(PublicationMap.Map(objPublication));
                 objPublication.IsNew = false;
             }
             else
             {
             }
             _repoPublication.Save();
         }
         else
         {
             TempData[LeonniConstants.ErrorMessage] = " Update Unsuccessful";
             return(View(objPublication));
         }
         TempData[LeonniConstants.SuccessMessage] = "Profile Updated Successfully";
         return(RedirectToAction("Publication"));
     }
     catch (Exception e)
     {
         TempData[LeonniConstants.ErrorMessage] = e.ToString();
         return(View(objPublication));
     }
 }
        public PartialViewResult userContentList(string name, string countryName, int?provinceId, int?disciplineId, string sex, int?categoryId, int?sortOrder, int?pageNumber = null, int?itemsPerPage = null)
        {
            int publicationListCount = 0;
            int groupListCount       = 0;
            int offset = 0;

            offset = (((int)pageNumber - 1) * (int)itemsPerPage);

            List <GroupModel> lstGroups = GroupMap.Map(_repoGroup.GetList(x => x.CreatedBy == 25).ToList());

            groupListCount = lstGroups.Count();

            List <PublicationModel> lstPublication = PublicationMap.Map(_repoPublication.GetList(x => x.CreatedBy == 25).ToList());

            publicationListCount = lstPublication.Count();

            foreach (var item in lstGroups.ToList())
            {
                var objEntityFile = _repoEntityFile.GetSingle(x => x.EntityId == item.Id && x.Section.SectionName == "Groups");
                if (objEntityFile != null)
                {
                    item.FileId = objEntityFile.FileId;
                }
                lstGroups.Add(item);
            }

            //foreach (var item in lstPublication.ToList())
            //{
            //    var objEntityFile = _repoEntityFile.GetSingle(x => x.EntityId == item.Id && x.Section.SectionName == "Groups");
            //    if (objEntityFile != null)
            //    {
            //        item.FileId = objEntityFile.FileId;
            //    }
            //    lstGroups.Add(item);
            //}
            ViewBag.TotalCount = groupListCount + publicationListCount;

            ViewBag.PagedListofPublication = lstPublication ?? new List <PublicationModel>();
            ViewBag.PagedListofGroups      = lstGroups ?? new List <GroupModel>();

            return(PartialView("_UserContentList"));
        }