using System; using System.Collections.Generic; using Pingchuan.BeijingSafeguard.DAL; using Pingchuan.BeijingSafeguard.Model; namespace Pingchuan.BeijingSafeguard.BLL { public class TaskBLL { public static void Add(int userId, string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) { Task task = ToModel(userId, taskId, region, longitude, latitude, height, simulatedDuration, simulatedInterval, releaseTime, resultState, resultMessage); TaskDAL.Add(task); } public static List GetList(int userId, string region, DateTime startTime, DateTime endTime, List tags) { return TaskDAL.GetList(userId, region, startTime, endTime, tags); } public static void Delete(string id) { TaskDAL.Delete(id); TagBLL.DeleteByTaskId(id); } public static List GetTaskIdByRegion(string region) { return TaskDAL.GetTaskIdByRegion(region); } public static Task ToModel(int userId, string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) { return new Task { Id = taskId, UserId = userId, Region = region, Longitude = longitude, Latitude = latitude, Height = height, SimulatedDuration = simulatedDuration, SimulatedInterval = simulatedInterval, ReleaseTime = releaseTime, CreateTime = DateTime.Now }; } } }