public void GetTaskCountDetailsFail() { TaskBusiness objTaskBusiness = new TaskBusiness(); li = objTaskBusiness.GetTasks(); Assert.AreNotEqual(0, li.Count); }
public void GetTaskCountDetailsPass() { TaskBusiness objTaskBusiness = new TaskBusiness(); li = objTaskBusiness.GetTasks(); Assert.AreEqual(8, li.Count); }
public void GetTasksThroughput_ThroughputMode(BenchmarkContext context) { TaskBusiness taskBusiness = new TaskBusiness(); List <Task> task = taskBusiness.GetTasks().ToList(); addCounter.Increment(); }
public void get_all_task_from_repo() { mock.Setup(a => a.GetTasks()).Returns(new List <Task> { new Task { Task_ID = 1, Task1 = "SampleTask", Priority = 1, StartDate = DateTime.Now.Date } }); TaskBusiness appBusiness = new TaskBusiness(mock.Object, mockuser.Object); List <TaskDTO> result = appBusiness.GetTasks(); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count()); Assert.AreEqual("SampleTask", result.ElementAt(0).Task); }
public void GetTaskDetailsFail() { List <TaskParentDetail> li1 = new List <TaskParentDetail>(); TaskParentDetail objTaskParentDetail = new TaskParentDetail(); objTaskParentDetail.id = 1; objTaskParentDetail.Parent_Id = 1; objTaskParentDetail.Range = 10; objTaskParentDetail.Task_Name = "Task 1"; objTaskParentDetail.parentTaskName = "Parent Task 1"; objTaskParentDetail.Start_Date = DateTime.Parse("Jan 1, 2018"); objTaskParentDetail.End_Date = DateTime.Parse("Jan 1, 2019"); li1.Add(objTaskParentDetail); TaskBusiness objTaskBusiness = new TaskBusiness(); li = objTaskBusiness.GetTasks(); Assert.AreEqual(li1, li); }
//获取任务列表 public JsonResult GetTasks(string keyWords, int filterType, string userID, int taskType, int colorMark, int finishStatus, int invoiceStatus, int preFinishStatus, string beginDate, string endDate, string beginEndDate, string endEndDate, int orderType, int taskOrderColumn, int isAsc, int pageSize, int pageIndex, string listType) { int pageCount = 0; int totalCount = 0; string ownerID = string.Empty; if (filterType == -1) { if (!string.IsNullOrEmpty(userID)) { ownerID = userID; } } else { ownerID = CurrentUser.UserID; } List <TaskEntity> list = TaskBusiness.GetTasks(keyWords.Trim(), ownerID, filterType, 1, finishStatus, invoiceStatus, preFinishStatus, colorMark, taskType, beginDate, endDate, beginEndDate, endEndDate, orderType, "-1", "-1", (EnumTaskOrderColumn)taskOrderColumn, isAsc, CurrentUser.ClientID, pageSize, pageIndex, ref totalCount, ref pageCount); JsonDictionary.Add("items", list); JsonDictionary.Add("totalCount", totalCount); JsonDictionary.Add("pageCount", pageCount); return(new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
// GET: api/Tasks public IQueryable <Task> GetTasks() { return(taskBusiness.GetTasks()); }
public void GetAllTasks() { TaskBusiness appBusiness = new TaskBusiness(_appRepository, _userData); appBusiness.GetTasks(); }
public JsonResult GetTasks(string filter, string userID, string clientID) { var paras = new FilterTasks(); if (!string.IsNullOrEmpty(filter)) { paras = JsonConvert.DeserializeObject <FilterTasks>(filter); } int pageCount = 0; int totalCount = 0; string ownerID = userID; List <TaskEntity> list = TaskBusiness.GetTasks(paras.keyWords.Trim(), ownerID, paras.filtertype, paras.status, paras.finishStatus, -1, -1, paras.colorMark, paras.taskType, paras.beginDate, paras.endDate, string.Empty, string.Empty, paras.orderType, paras.orderProcessID, paras.orderStageID, (EnumTaskOrderColumn)paras.taskOrderColumn, paras.isAsc, clientID, paras.pageSize, paras.pageIndex, ref totalCount, ref pageCount); var lables = SystemBusiness.BaseBusiness.GetLableColor(clientID, EnumMarkType.Tasks).ToList(); List <Dictionary <string, object> > tasks = new List <Dictionary <string, object> >(); string domainUrl = Request.Url.Scheme + "://" + Request.Url.Host; foreach (var item in list) { Dictionary <string, object> task = new Dictionary <string, object>(); task.Add("taskID", item.TaskID); task.Add("title", item.Title); task.Add("mark", item.Mark); task.Add("colorMark", item.ColorMark); string colorValue = string.Empty; var lable = lables.Find(m => m.ColorID == item.ColorMark); if (lable != null) { colorValue = lable.ColorValue; } task.Add("colorValue", colorValue); task.Add("finishStatus", item.FinishStatus); task.Add("preTitle", item.PreTitle); task.Add("preFinishStatus", item.PreFinishStatus); task.Add("pEndTime", item.PEndTime.ToString("yyyy-MM-dd") != "0001-01-01" ? item.PEndTime.ToString("yyyy-MM-dd") : ""); task.Add("orderType", item.OrderType); var orderImg = item.OrderImg; if (!string.IsNullOrEmpty(item.OrderImg) && !item.OrderImg.Contains("bkt.clouddn.com")) { orderImg = domainUrl + item.OrderImg; } task.Add("orderImg", orderImg); task.Add("acceptTime", item.AcceptTime.ToString("yyyy-MM-dd") != "0001-01-01" ? item.AcceptTime.ToString("yyyy-MM-dd"):""); task.Add("endTime", item.EndTime.ToString("yyyy-MM-dd") != "0001-01-01" ? item.EndTime.ToString("yyyy-MM-dd"):""); task.Add("completeTime", item.CompleteTime.ToString("yyyy-MM-dd") != "0001-01-01" ? item.CompleteTime.ToString("yyyy-MM-dd"):""); task.Add("createTime", item.CreateTime.ToString("yyyy-MM-dd")); Dictionary <string, object> order = new Dictionary <string, object>(); var orderItem = item.Order; order.Add("goodsName", orderItem.GoodsName); order.Add("goodsCode", orderItem.IntGoodsCode); order.Add("planTime", orderItem.PlanTime.ToString("yyyy-MM-dd")); task.Add("order", order); tasks.Add(task); } JsonDictionary.Add("tasks", tasks); JsonDictionary.Add("totalCount", totalCount); JsonDictionary.Add("pageCount", pageCount); return(new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
// GET: api/Employee public IEnumerable <TaskParentDetail> Get() { return(obj.GetTasks()); }