public ActionResult SearchByDate(DateTime fromDate, DateTime toDate, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin   = User.IsInAnyRoles("SuperAdmin");
            var  organisationId = UserOrganisationId;
            var  activityIds    = NidanBusinessService.RetrieveActivityTaskDataGrids(organisationId, e => isSuperAdmin || e.AssignTo == UserPersonnelId, orderBy, paging).Items.Select(e => e.ActivityId);

            return(this.JsonNet(NidanBusinessService.RetrieveActivityDataGrids(UserOrganisationId, e => (isSuperAdmin || activityIds.Contains(e.ActivityId) || e.CreatedBy == UserPersonnelId) && e.StartDate >= fromDate && e.StartDate <= toDate, orderBy, paging)));
        }
        public ActionResult List(Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin   = User.IsInAnyRoles("SuperAdmin");
            var  organisationId = UserOrganisationId;
            var  activityIds    = NidanBusinessService.RetrieveActivityTaskDataGrids(organisationId, e => isSuperAdmin || e.AssignTo == UserPersonnelId, orderBy, paging).Items.Select(e => e.ActivityId);
            var  data           = NidanBusinessService.RetrieveActivityDataGrids(UserOrganisationId, e => isSuperAdmin || activityIds.Contains(e.ActivityId) || e.CreatedBy == UserPersonnelId, orderBy, paging);

            return(this.JsonNet(data));
        }
        public ActionResult ViewActivity(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var organisationId = UserOrganisationId;
            var activity       = NidanBusinessService.RetrieveActivityDataGrids(organisationId, e => e.ActivityId == id.Value).Items.FirstOrDefault();

            if (activity == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new ActivityTaskViewModel
            {
                ActivityDataGrid = activity
            };

            return(View(viewModel));
        }