public async Task <ActionResult> EditTask(Guid taskId, string fromTab)
        {
            TaskDataEntity taskdataEntity = await _taskDataRepository.GetTaskDetailsByTaskIDAsync(taskId);

            TaskAttachementsEntity taskAttachementsEntity = await _taskAttachementsRepository.GetTaskAttachementDetailsByTaskIDAsync(taskId);

            List <TaskActivityEntity> taskActivityEntity = await _taskActivityRepository.GetTaskActivityDetailsByTaskIDAsync(taskId);

            var sortedActivityList = taskActivityEntity.OrderByDescending(x => x.Timestamp).ToList();
            var taskList           = (await DBHelper.GetPageLoadDataAsync(_configuration)).ListofTaskIDs;
            var userList           = await DBHelper.GetListOfUser(_configuration);

            var listofTasks = this.GetTaskListSelectItems(taskList);

            ViewBag.priority    = taskdataEntity.TaskPriority;
            ViewBag.assignedTo  = taskdataEntity.TaskAssignedTo;
            ViewBag.status      = taskdataEntity.TaskStatus;
            ViewBag.title       = taskdataEntity.TaskTitle;
            ViewBag.description = taskdataEntity.TaskDescription;
            ViewBag.subscribers = string.Join(",", taskdataEntity.Subscribers);
            ViewBag.dependetOn  = string.Join(",", taskdataEntity.Dependencies);
            ViewBag.blocks      = string.Join(",", taskdataEntity.Blocks);

            TaskInfo taskInfo = new TaskInfo
            {
                taskID          = taskId,
                taskNumber      = taskdataEntity.TaskName,
                taskAssignedTo  = taskdataEntity.TaskAssignedTo,
                assignedToList  = userList,
                status          = taskdataEntity.TaskStatus,
                statusList      = this.GetStatusList(),
                priority        = taskdataEntity.TaskPriority,
                priorityList    = this.GetPriorityList(),
                title           = taskdataEntity.TaskTitle,
                description     = taskdataEntity.TaskDescription,
                startDate       = taskdataEntity.TaskStartDate,
                dueDate         = taskdataEntity.TaskDueDate,
                attachementURL  = taskAttachementsEntity.AttachementURL,
                subscribers     = taskdataEntity.Subscribers.ToList(),
                subscribersList = userList,
                dependentOn     = taskdataEntity.Dependencies.ToList(),
                dependentOnList = listofTasks,
                blocks          = taskdataEntity.Blocks.ToList(),
                blocksList      = listofTasks,
                activity        = sortedActivityList,
            };

            if (fromTab != null)
            {
                ViewBag.callFromTab = fromTab;
            }
            return(View(taskInfo));
        }
예제 #2
0
        public static async Task SaveTaskAttachements(TaskInfo taskInfo, IConfiguration configuration)
        {
            TaskAttachementsRepository taskAttachementsRepository = new TaskAttachementsRepository(configuration);
            var rowKey = Guid.NewGuid();

            TaskAttachementsEntity taskAttachementsEntity = new TaskAttachementsEntity
            {
                PartitionKey   = PartitionKeyNames.TaskAttachementsDataTable.TaskAttachementsDataPartition,
                RowKey         = rowKey.ToString(),
                AttachementID  = taskInfo.attachementID,
                TaskID         = taskInfo.taskID,
                AttachementURL = taskInfo.attachementURL
            };

            await taskAttachementsRepository.CreateOrUpdateAsync(taskAttachementsEntity);
        }