Beispiel #1
0
        public async Task <AddTaskDto> CreateAsync(AddTaskDto addTaskDto)
        {
            //var veri = await _generictaskdate.GetAllAsync();



            var gunluk   = _taskDateDal.GetGunluk();
            var haftalik = _taskDateDal.GetHaftalık();
            var aylik    = _taskDateDal.GetAylik();



            if (addTaskDto.TaskDate == gunluk)
            {
                addTaskDto.StartDate  = DateTime.Now;
                addTaskDto.FinishDate = DateTime.Now.AddDays(1);
            }
            else if (addTaskDto.TaskDate == haftalik)
            {
                addTaskDto.StartDate  = DateTime.Now;
                addTaskDto.FinishDate = DateTime.Now.AddDays(7);
            }
            else if (addTaskDto.TaskDate == aylik)
            {
                addTaskDto.StartDate  = DateTime.Now;
                addTaskDto.FinishDate = DateTime.Now.AddDays(30);
            }


            addTaskDto.Status = "Active";


            await _tasksDal.AddAsync(_mapper.Map <Tasks>(addTaskDto));

            return(null);
        }
Beispiel #2
0
        public async Task <IActionResult> Index(int page = 1)
        {
            var userId = await _userManager.FindByNameAsync(User.Identity.Name);

            int user           = userId.Id;
            var gunlukgorevler = _tasksManager.GetTodayActiveTasks(out int toplamsayfa, page, user);

            ViewBag.aktifsayfa = page;


            ViewBag.toplamsayfa = toplamsayfa;
            ViewBag.veriler     = gunlukgorevler;



            var gunluk   = _taskDateDal.GetGunluk();
            var haftalik = _taskDateDal.GetHaftalık();
            var aylik    = _taskDateDal.GetAylik();


            var total = _tasksDal.GetTotalTasksCount(user);

            ViewBag.total = total;

            var today = _tasksDal.GetTodayTasksCount(user, gunluk);

            ViewBag.today = today;

            var week = _tasksDal.GetWeekTasksCount(user, haftalik);

            ViewBag.week = week;

            var month = _tasksDal.GetMonthTasksCount(user, aylik);

            ViewBag.month = month;

            var active = _tasksDal.GetActiveTasksCount(user);

            ViewBag.active = active;

            var completed = _tasksDal.GetCompletedTasksCount(user);

            ViewBag.completed = completed;

            return(View());
        }