public MessageExtension(IConfiguration configuration)
 {
     _configuration         = configuration;
     _cardHelper            = new CardHelper(_configuration);
     _taskDataRepository    = new TaskDataRepository(_configuration);
     _userDetailsRepository = new UserDetailsRepository(_configuration);
 }
        public AddTaskViewModel(INavigation navigation)
        {
            nav      = navigation;
            task     = new TaskData();
            taskRepo = new TaskDataRepository();

            AddTaskComm = new Command(async() => await AddTask());
        }
 public HomeController(IConfiguration configuration)
 {
     _configuration              = configuration;
     _cardHelper                 = new CardHelper(_configuration);
     _taskDataRepository         = new TaskDataRepository(_configuration);
     _taskAttachementsRepository = new TaskAttachementsRepository(_configuration);
     _taskActivityRepository     = new TaskActivityRepository(_configuration);
 }
예제 #4
0
        public static async Task <PageLoadData> GetPageLoadDataAsync(IConfiguration configuration)
        {
            Common             common             = new Common(configuration);
            TaskDataRepository taskDataRepository = new TaskDataRepository(configuration);
            PageLoadData       pageLoadData       = new PageLoadData
            {
                //NewTaskId = common.GetNewTaskID(),
                ListofTaskIDs = await taskDataRepository.GetAllTaskIDAsync(),
                //TeamMembers = await DBHelper.GetTeamMembers(turnContext)
            };

            return(pageLoadData);
        }
        public TaskListViewModel(INavigation navigation)
        {
            nav      = navigation;
            taskRepo = new TaskDataRepository();

            AddTaskComm = new Command(async() => await ShowAddTask());

            //get user from application
            if (CrossConnectivity.Current.IsConnected)
            {
                DataServices.Synchronise();
            }
            TaskDataList = taskRepo.GetAllTasksForUser(SettingServices.Username);
        }
예제 #6
0
        //constructor to take the navigation and the selected task
        public TaskDetailViewModel(INavigation navigation, int selectedTask)
        {
            //set the variables from the inherited class
            nav      = navigation;
            task     = new TaskData();
            task.Id  = selectedTask;
            taskRepo = new TaskDataRepository();

            //set the commands
            UpdateTaskComm = new Command(async() => await UpdateTask());
            DeleteTaskComm = new Command(async() => await DeleteTask());

            //call the fetch task method
            FetchTask();
        }
예제 #7
0
        public static async Task SaveTaskInfo(TaskInfo taskInfo, IConfiguration configuration)
        {
            TaskDataRepository taskDataRepository = new TaskDataRepository(configuration);

            if (taskInfo != null)
            {
                var rowKey = Guid.NewGuid();

                if (taskInfo.action == "sendAdaptiveCard" || taskInfo.action == "Depends on" || taskInfo.action == "Blocks")
                {
                    taskInfo.taskID        = Guid.NewGuid();
                    taskInfo.attachementID = Guid.NewGuid();
                    taskInfo.subscriberID  = Guid.NewGuid();

                    TaskDataEntity taskDataEntity = new TaskDataEntity
                    {
                        PartitionKey       = PartitionKeyNames.TaskDetailsDataTable.TaskDataPartition,
                        RowKey             = rowKey.ToString(),
                        TaskName           = taskInfo.taskNumber, // change it to auto crated taskName
                        TaskId             = taskInfo.taskID,
                        TaskCreatedBy      = taskInfo.taskCreatedBy,
                        TaskAssignedTo     = taskInfo.taskAssignedTo,
                        TaskCreatedByEmail = taskInfo.taskCreatedByEmail,
                        TaskStatus         = taskInfo.status,
                        TaskPriority       = taskInfo.priority,
                        TaskTitle          = taskInfo.title,
                        TaskDescription    = taskInfo.description,
                        TaskStartDate      = taskInfo.startDate,
                        TaskDueDate        = taskInfo.dueDate,
                        AttachementID      = taskInfo.attachementID,
                        Subscribers        = taskInfo.subscribers,
                        Dependencies       = taskInfo.dependentOn,
                        Blocks             = taskInfo.blocks
                    };

                    await taskDataRepository.CreateOrUpdateAsync(taskDataEntity);
                }
                else if (taskInfo.action == "updateAdaptiveCard")
                {
                    TaskDataEntity taskData = await taskDataRepository.GetTaskDetailsByTaskIDAsync(taskInfo.taskID);

                    taskData.TaskAssignedTo  = taskInfo.taskAssignedTo;
                    taskData.TaskStatus      = taskInfo.status;
                    taskData.TaskPriority    = taskInfo.priority;
                    taskData.TaskTitle       = taskInfo.title;
                    taskData.TaskDescription = taskInfo.description;
                    taskData.TaskDueDate     = taskInfo.dueDate;
                    taskData.Subscribers     = taskInfo.subscribers;
                    taskData.Dependencies    = taskInfo.dependentOn;
                    taskData.Blocks          = taskInfo.blocks;

                    await taskDataRepository.CreateOrUpdateAsync(taskData);
                }

                //check required conditions before pushing data to below tables
                await DBHelper.SaveTaskAttachements(taskInfo, configuration);

                //await DBHelper.SaveSubscribersInfo(taskInfo, configuration);
                //await DBHelper.SaveDependency(taskInfo, configuration);
                if (!string.IsNullOrEmpty(taskInfo.activityComment))
                {
                    await DBHelper.SaveActivity(taskInfo, configuration);
                }
            }
            ;
        }