Пример #1
0
        public ResponseResult <AppTask> AppGetAllTaskByTime(string shipId, string startTime, string endTime)
        {
            var result = ResponseResult <AppTask> .Default();

            AppService     appService = new AppService();
            List <AppTask> tasks      = new List <AppTask>();

            try
            {
                if (string.IsNullOrEmpty(shipId))
                {
                    return(ResponseResult <AppTask> .Error("船体Id不能为空"));
                }
                if (string.IsNullOrEmpty(startTime))
                {
                    return(ResponseResult <AppTask> .Error("开始时间不能为空"));
                }
                if (string.IsNullOrEmpty(endTime))
                {
                    return(ResponseResult <AppTask> .Error("结束时间不能为空"));
                }
                else
                {
                    tasks  = appService.AppGetAllTaskByTime(Convert.ToInt32(shipId), Convert.ToDateTime(startTime), Convert.ToDateTime(endTime));
                    result = ResponseResult <AppTask> .Success(tasks, "获取任务信息成功");
                }
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <AppTask> .Error(ex.Message);
            }
            return(result);
        }