public void TestGetAlltasks() { TaskManager.BusinessLib.TaskBL obj = new TaskBL(); int Count = obj.GetAllTasks().Count; Assert.Greater(Count, 0); }
public void Benchmark(BenchmarkContext context) { // _counter.Increment(); // var bytes = new byte[0]; TaskManager.BusinessLib.TaskBL obj = new TaskBL(); int Count = obj.GetAllTasks().Count; }
public IHttpActionResult DeleteTask(int taskId) { TaskBL blTask = new TaskBL(); try { blTask.DeleteTask(taskId); } catch (Exception ex) { return(Ok(ex.Message)); } return(Ok(blTask.GetAllTasks())); }
static void Main(string[] args) { try { TaskBL obj = new TaskBL(); Task t = obj.GetTaskById(2); t.TaskName = "new task"; obj.UpdateTask(t); List <Task> ts = obj.GetAllTasks(); /* foreach ( Task t in ts) * { * Console.WriteLine("amount is {0}, and type is {1}", t.TaskId, t.TaskName); * }*/ obj.AddTask(new TaskManager.Entities.Task() { TaskId = 2, TaskName = "Testdfgdgdg2", Startdate = DateTime.Now, Enddate = DateTime.Now, Priority = 10 } ); /* * obj.AddTask(new TaskManager.Entities.Task() * { * TaskId = 3, * TaskName = "Test3", * Startdate = DateTime.Now, * Enddate = DateTime.Now, * Priority = 10, * * TaskParentId = 2 * * } * );*/ } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public IHttpActionResult GetAllTasks() { var taskBL = new TaskBL(_context); var allTasks = taskBL.GetAllTasks(); var tasks = (from ts in allTasks from pts in allTasks .Where(x => x.TaskId == ts.ParentId) .DefaultIfEmpty() select new { TaskId = ts.TaskId, TaskName = ts.TaskName, Priority = ts.Priority, StartDate = ts.StartDate.ToString("dd-MM-yyyy"), EndDate = ts.EndDate.ToString("dd-MM-yyyy"), ParentTaskName = pts?.TaskName, EndTask = ts.EndTask }).ToList(); return(Ok(tasks)); }
public IHttpActionResult GetAllTasks() { var taskBL = new TaskBL(_context); List <Task> allTasks = new List <Task>(); try { allTasks = taskBL.GetAllTasks(); } catch (Exception ex) { return(InternalServerError(ex)); } finally { taskBL = null; } var tasks = (from ts in allTasks from pts in allTasks .Where(x => x.TaskId == ts.ParentId) .DefaultIfEmpty() select new { TaskId = ts.TaskId, TaskName = ts.TaskName, Priority = ts.Priority, StartDate = ts.StartDate.ToString("dd-MM-yyyy"), EndDate = ts.EndDate.ToString("dd-MM-yyyy"), ParentTaskName = pts?.TaskName, EndTask = ts.EndTask, IsParent = ts.IsParent }).ToList(); return(Ok(tasks)); }
public async Task <IHttpActionResult> All() { TaskBL wl = new TaskBL(); return(Ok(wl.GetAllTasks())); }
public IHttpActionResult Get() { TaskBL obj = new TaskBL(); return(Ok(obj.GetAllTasks())); }
public IHttpActionResult GetAllTasks() { TaskBL blTask = new TaskBL(); return(Ok(blTask.GetAllTasks())); }