//
        // GET: /WebApi/MyProjectTask/

        public ActionResult Index(string keyword, bool?finish, int?type, int pageIndex = 1, int pageSize = 10)
        {
            var model =
                _iProjectTaskService.GetAll(
                    a => (a.ProjectInfo == null || !a.ProjectInfo.Deleted) && !a.Deleted && (a.SysUserId == _iUserInfo.UserId || a.UserId == _iUserInfo.UserId));

            if (!string.IsNullOrEmpty(keyword))
            {
                model = model.Where(
                    a =>
                    a.ProjectTaskName.Contains(keyword) || a.ProjectTaskObjective.Contains(keyword) ||
                    a.ProjectInfo.ProjectName.Contains(keyword));
            }

            if (finish.HasValue)
            {
                model = model.Where(a => a.Finish == finish);
            }

            if (type == 0)
            {
                model = model.Where(a => a.SysUserId == _iUserInfo.UserId);
            }

            if (type == 1)
            {
                model = model.Where(a => a.UserId == _iUserInfo.UserId);
            }

            return(GetModelDetail(model, pageIndex, pageSize));
        }
Ejemplo n.º 2
0
        //
        // GET: /Platform/MyPlan/

        public ActionResult Index()
        {
            var model =
                _iProjectTaskService.GetAll(a => !a.Deleted && !a.Finish && a.SysUserId == _iUserInfo.UserId)
                .Select(a => new
            {
                id         = a.Id,
                text       = "(任务)" + a.ProjectTaskName,
                start_date = a.BeginTime,
                end_date   = a.EndTime,
                custom     = 1
            }).Concat(
                    _iPlanService.GetAll(b => !b.Deleted && !b.Finish && b.UserId == _iUserInfo.UserId)
                    .Select(
                        b =>
                        new
            {
                id         = b.Id,
                text       = b.PlanTitle,
                start_date = b.StartDate,
                end_date   = b.EndDate,
                custom     = 0
            }));

            var setting = new JsonSerializerSettings {
                DateFormatString = "MM-dd-yyyy HH:mm"
            };

            ViewBag.JsonData = JsonConvert.SerializeObject(model, Formatting.None, setting);

            return(View());
        }
Ejemplo n.º 3
0
        public IActionResult Index()
        {
            logger.LogDebug($"ProjectTask.Index is called");
            IList <ProjectTaskVm> ProjectTasksVm = ConvertToProjectTaskVm.Convert(ProjectTaskService.GetAll());

            FillProjectTasksVm(ProjectTasksVm);
            return(View(ProjectTasksVm));
        }
        // 我的任务
        // GET: /Platform/MyProjectTask/

        public ActionResult Index(string keyword, string displaytype, bool?finish, int pageIndex = 1)
        {
            ViewBag.UserId = _iUserInfo.UserId;
            IQueryable <ProjectTask> model =
                _iProjectTaskService.GetAll(
                    a =>
                    (a.ProjectInfo == null || !a.ProjectInfo.Deleted) && !a.Deleted &&
                    (a.SysUserId == _iUserInfo.UserId || a.UserId == _iUserInfo.UserId));

            if (!string.IsNullOrEmpty(keyword))
            {
                model =
                    model.Where(
                        a =>
                        a.ProjectTaskName.Contains(keyword) || a.ProjectTaskObjective.Contains(keyword) ||
                        a.ProjectInfo.ProjectName.Contains(keyword));
            }

            ViewBag.unfinished = model.Count(a => !a.Finish);
            ViewBag.finished   = model.Count(a => a.Finish);

            //显示数量用
            ViewBag.CountAll = model.Count();
            ViewBag.CountMy  = model.Count(a => a.SysUserId == _iUserInfo.UserId);
            ViewBag.CountTo  = model.Count(a => a.UserId == _iUserInfo.UserId);

            if (finish.HasValue)
            {
                model = model.Where(a => a.Finish == finish);
            }

            if (displaytype == "0")
            {
                model = model.Where(a => a.SysUserId == _iUserInfo.UserId);
            }

            if (displaytype == "1")
            {
                model = model.Where(a => a.UserId == _iUserInfo.UserId);
            }

            model = model.OrderBy(a => a.Finish).ThenByDescending(a => a.CreatedDate);

            return(View(model.ToPagedList(pageIndex)));
        }
        //
        // GET: /Admin/Desktop/

        public ActionResult Index()
        {
            ViewBag.UserId = _iUserInfo.UserId;
            IOrderedQueryable <ProjectTask> model =
                _iProjectTaskService.GetAll(a => (a.ProjectInfo == null || !a.ProjectInfo.Deleted) && !a.Finish)
                .OrderBy(a => a.EndTime);

            ViewBag.ProjectInfo = _iProjectInfoService.GetAll(a => !a.Finish);

            ViewBag.Message = _iMessageService.GetAll(a => a.SysUserId == _iUserInfo.UserId).Take(5);

            ViewBag.Plan =
                _iPlanService.GetAll(a => !a.Finish && a.UserId == _iUserInfo.UserId && a.StartDate < DateTime.Now);

            ViewBag.CustomerCount = _ICustomerService.GetAll().Count();

            return(View(model));
        }
Ejemplo n.º 6
0
        public ActionResult Details(string departmentId, Guid?userId, DateTime?startDate, DateTime?endDate)
        {
            if (!startDate.HasValue || !endDate.HasValue)
            {
                //默认显示当前周
                DateTime thisdtWeekStart;
                DateTime thisdtWeekeEnd;
                DateTimeExtensions.GetWeek(DateTime.Now.Year, DateTime.Now.WeekOfYear(), out thisdtWeekStart,
                                           out thisdtWeekeEnd);
                startDate = thisdtWeekStart;
                endDate   = thisdtWeekeEnd;
            }

            ViewBag.startDate = startDate;
            ViewBag.endDate   = endDate;

            //默认显示本周工作总结 其他显示本月 本年总结
            IQueryable <ProjectTask> model = _iProjectTaskService.GetAll();

            if (!string.IsNullOrEmpty(departmentId))
            {
                model =
                    model.Where(
                        a => a.SysUser.SysDepartmentSysUsers.Any(b => b.SysDepartment.SystemId.StartsWith(departmentId)));
            }

            if (userId.HasValue)
            {
                model = model.Where(a => a.SysUserId == userId);
            }

            model =
                model.Where(
                    a =>
                    !((a.BeginTime >= endDate) || (a.EndTime <= startDate)));

            return(View(model));
        }
Ejemplo n.º 7
0
 // GET: api/projecttask
 public IEnumerable <ProjectTaskVM> Get()
 {
     return(_mapper.Map <IEnumerable <ProjectTaskVM> >(_projectTaskService.GetAll()));
 }