Example #1
0
        /// <summary>
        /// 获取牧场所有任务
        /// </summary>
        /// <param name="pastureID">牧场ID</param>
        /// <returns></returns>
        public List <DairyTask> GetAllTasks(int pastureID)
        {
            List <DairyTask> list = new List <DairyTask>();
            //以下代码功能怀疑有误,暂时注释掉,sopy
            //if (UserBLL.Instance.CurrentUser.Role.CanBreed)
            //{
            //    DairyTask task = new DairyTask();
            //    task.EarNum = -1;
            //    task.TaskType = TaskType.InseminationTask;
            //    task.Status = DairyTaskStatus.Initial;
            //    task.ArrivalTime = DateTime.Now;
            //    task.RoleID = UserBLL.Instance.CurrentUser.Role.ID;
            //    task.PastureID = UserBLL.Instance.CurrentUser.Pasture.ID;
            //    task.OperatorID = Convert.ToInt32(UserBLL.Instance.CurrentUser.ID);
            //    list.Add(task);
            //}

            DataTable tb = taskDAL.GetAllTasks(pastureID);

            foreach (DataRow item in tb.Rows)
            {
                list.Add(WrapTaskItem(item));
            }
            return(list);
        }
Example #2
0
        public IActionResult Index()
        {
            List <Task> lstTask = new List <Task>();

            lstTask         = objtask.GetAllTasks().ToList();
            ViewBag.Checked = " ";

            return(View(lstTask));
        }
Example #3
0
        public List <Task> GetAllTasks()
        {
            List <Task> tasks = TaskDAL.GetAllTasks();

            foreach (Task t in tasks)
            {
                CheckOverdue(t);
            }

            return(tasks);
        }
Example #4
0
        public List <TaskDTO> GetAllTasks()
        {
            var taskDa = new TaskDAL();

            return(taskDa.GetAllTasks());
        }