private Task StartBusinessCardProcessing(string exportFormat, Options options)
        {
            var task = new UserTask(options.SourcePath)
            {
                TaskStatus      = "Uploading",
                OutputFilePaths = new Dictionary <string, string>
                {
                    [exportFormat] = Path.Combine(options.TargetPath, $"{options.FileName}.{exportFormat.ToExtension()}"),
                },
                TargetFormat = exportFormat,
            };

            UserTasks.Add(task);

            var bcrOptions = new Options
            {
                SourcePath   = options.SourcePath,
                TargetPath   = options.TargetPath,
                Mode         = options.Mode,
                Language     = options.Language,
                OutputFormat = exportFormat,
            };

            return(SafeInvokeProcessorCommands(_processor.ProcessPathAsync(bcrOptions, task), task));
        }
Example #2
0
        /// <summary>
        /// Adds a task based on user input.
        /// </summary>
        /// <param name="task">The task.</param>
        public void AddUserTask(string task)
        {
            if (string.IsNullOrEmpty(task))
            {
                return;
            }

            UserTasks.Add(task);
        }
Example #3
0
        public UserTask CreateTask(string taskType, long userId, string status, string description, string notes = null, string userNotes = null)
        {
            UserTask task = new UserTask();

            task.TaskType    = taskType;
            task.UserId      = userId;
            task.Status      = status;
            task.Description = description;
            task.Notes       = notes;
            task.UserNotes   = userNotes;
            UserTasks.Add(task);
            return(task);
        }
Example #4
0
        public UserTask Recognize(string base64Image, string outputFilePath)
        {
            var imageData = Convert.FromBase64String(base64Image);

            var task = new UserTask()
            {
                TaskStatus     = "Uploading",
                OutputFilePath = outputFilePath,
            };

            UserTasks.Add(task);
            this._restClientAsync.ProcessBusinessCardAsync(imageData, this._settings, task);

            return(task);
        }
        private Task StartGeneralProcessing(IEnumerable <string> exportFormats, Options options)
        {
            var task = new UserTask(options.SourcePath)
            {
                TaskStatus      = "Uploading",
                OutputFilePaths = exportFormats
                                  .ToDictionary(
                    x => x,
                    x => Path.Combine(options.TargetPath, $"{options.FileName}.{x.ToExtension()}")),
                TargetFormat = options.OutputFormat,
            };

            UserTasks.Add(task);

            return(SafeInvokeProcessorCommands(_processor.ProcessPathAsync(options, task), task));
        }
        private Task StartSingleFieldProcessing(Image sourceImage, Options options)
        {
            var task = new UserTask(options.SourcePath)
            {
                TaskStatus       = "Uploading",
                SourceIsTempFile = true,
                IsFieldLevel     = true,
                SourceImage      = sourceImage,
                OutputFilePaths  = new Dictionary <string, string>
                {
                    ["Xml"] = Path.Combine(options.TargetPath, $"{options.FileName}.xml"),
                },
            };

            UserTasks.Add(task);
            FieldLevelTasks.Add(task);

            return(SafeInvokeProcessorCommands(_processor.ProcessPathAsync(options, task), task));
        }
Example #7
0
 private void ExecuteLoadItemsCommand()
 {
     if (IsBusy)
     {
         return;
     }
     IsBusy = true;
     UserTasks.Clear();
     if (AppService == null || AppService.UserTasks == null)
     {
         IsBusy = false;
         return;
     }
     foreach (var userTask in AppService.UserTasks)
     {
         UserTasks.Add(userTask);
     }
     IsBusy = false;
 }
        public void Create_TaskToFave(int taskID, int curUserID)
        {
            var maxIndex = UserTasks.Select(ut => ut.IndexNumber).Max();

            if (maxIndex == null)
            {
                maxIndex = 0;
            }
            maxIndex++;
            ChangeTracker.DetectChanges();
            UserTasks.Add(new UserTask()
            {
                TaskID = taskID, UserID = curUserID, IndexNumber = maxIndex
            });
            var taskName = Tasks.Where(t => t.ID == taskID).Select(t => t.TaskName).FirstOrDefault();

            WriteLog(taskID, taskName, DateTime.Now, "INSERT_FAVE");
            SaveChanges();
        }
Example #9
0
        private Task AddUserTask(User findedUser, string taskName, List <Task> addedTasks)
        {
            Task userTask = new Task(taskName);

            if (UserTasks.ContainsKey(findedUser))
            {
                if (UserTasks[findedUser].FirstOrDefault(f => f.Name == taskName) == null)
                {
                    UserTasks[findedUser].Add(userTask);
                }
            }
            else
            {
                UserTasks.Add(findedUser, new List <Task>()
                {
                    userTask
                });
            }

            addedTasks.Add(userTask);
            return(userTask);
        }
Example #10
0
        public static void Init()
        {
            Specialties.Add(new Speciality
            {
                FacultyId = 123,
                Id        = 2,
                LectorId  = 321,
                Name      = "Telecommunications",
                ShortName = "TIS"
            });
            Users.Add(new User
            {
                Id         = 1,
                FacultylID = 123,
                Name       = "Boris",
                Email      = "*****@*****.**",
                TeamID     = 12
            });

            Users.Add(new User
            {
                Id         = 2,
                FacultylID = 456,
                Name       = "Stefan",
                Email      = "*****@*****.**",
                TeamID     = 12
            });

            //Initi Story
            Stories.Add(new Story
            {
                Id          = 55,
                Name        = "Controlers Story",
                Description = "Create all required controlers",
                EndDate     = new DateTime(2020, 12, 23),
                ProjectId   = 2,
                StartDate   = DateTime.Now
            });

            //Inti faculties

            Faculties.Add(new Faculty()
            {
                Id          = 1,
                Name        = "Physico-technological faculty",
                Description = "We are the best",
                ShortName   = "PTF"
            });

            //Init Teams
            Teams.Add(new Team
            {
                Id          = 43,
                Name        = "Team A",
                FacultyID   = 1,
                DateCreated = new DateTime(2019, 10, 01)
            });

            Teams.Add(new Team
            {
                Id          = 44,
                Name        = "Team B",
                FacultyID   = 1,
                DateCreated = new DateTime(2019, 10, 01)
            });

            //Init User Taks
            UserTasks.Add(new UserTask
            {
                Id = 23,
                AssignedToUserID = 2,
                Description      = "Task Description",
                EndDate          = new DateTime(2020, 11, 23),
                Name             = "Create Controlers",
                OwnerId          = 1,
                StartDate        = DateTime.Now,
                StoryId          = 55
            });

            Sprints.Add(new Sprint
            {
                Description = "Description",
                EndDate     = DateTime.Now.AddDays(5),
                Id          = 133,
                Name        = "Sprint name",
                StartDate   = DateTime.Now,
                TeamID      = 1
            });
            Lectors.Add(new Lector
            {
                Id          = 24,
                FirstName   = "Vladimir",
                LastName    = "Sovniov",
                DateStarted = new DateTime(2018, 10, 12)
            });

            Projects.Add(new Project
            {
                Description = "Project description",
                Id          = 4322,
                Name        = "Some project name",
                OwnerId     = 2
            });

            //User positions
            UserPositions.Add(new UserPosition
            {
                Id           = 1,
                PositionName = "Junior Developer",
                Description  = "Begginer C# developer"
            });
            UserPositions.Add(new UserPosition
            {
                Id           = 2,
                PositionName = "Middle Developer",
                Description  = "Experienced C# developer"
            });
            UserPositions.Add(new UserPosition
            {
                Id           = 3,
                PositionName = "Senior Developer",
                Description  = "Very experienced C# developer"
            });
        }
Example #11
0
 public void AddNewTask(string name, string description, string group, DateTime dueDate)
 {
     UserTasks.Add(new UserTask {
         Name = name, Description = description, Group = @group, DueDate = dueDate
     });
 }
Example #12
0
 private void AddUserTask()
 {
     UserTasks.Add(CurrentUserTask);
 }