//public ActionResult Stats(string selectedYear) //{ // if (selectedYear == null) // { // selectedYear = 2016.ToString(); // } // //invoiceLogic.GetTotalInvoiceAmountByYear(2017); // Invoice invoice = new Invoice(); // var income = companyStatisticsLogic.GetTotalIncomeByYear(Convert.ToInt32(selectedYear)); // return View("Stats", income); //} //public ActionResult CalculateStats(string selectedYear) //{ // return View("CalculateStats", invoiceLogic.GetTotalInvoiceAmountByYear(Convert.ToInt32(selectedYear))) ; //} public void Add(ICollection <string> taskId) { List <Task> tasks = new List <Task>(); foreach (var task in taskId) { var taskid = Convert.ToInt16(task); tasks.Add(taskLogic.GetTaskById(taskid)); } }
public async Task <IActionResult> GetTaskById(int id) { var getTaskById = await _taskLogic.GetTaskById(id); if (getTaskById == null) { return(NotFound()); } return(Ok(getTaskById)); }
public ActionResult DetailsTask(int id) { if (_taskLogic.GetTaskById(id) != null) { var task = _taskLogic.GetTaskById(id); var viewTask = _mapper.Map <TaskViewModel>(task); return(View(viewTask)); } return(RedirectToAction("Error", "Home")); }
public ActionResult BestTasks(string year) { if (year == null) { year = 2016.ToString(); } var tasks = companyStatisticsLogic.GetTop3Tasks(year); for (int i = 0; i < tasks.Count; i++) { var totalprice = tasks[i].TotalAmountOfAllSimilarTasks; tasks[i] = taskLogic.GetTaskById(tasks[i].Id); tasks[i].TotalAmountOfAllSimilarTasks = totalprice; } return(View("BestTasks", tasks)); }