Ejemplo n.º 1
0
        //To fill Y
        public bool InsertRatings(String[] expressions, UserProfile[] users, double[,] Y)
        {
            try
            {
                TaskManager mgr = new TaskManager();
                List<Task> tasks = mgr.selectAllTask();
                foreach (Task task in tasks)
                {

                    int[,] result = this.GetYIndex(task.JobId.ToString(), task.RecruiteeId.ToString(), expressions, users);
                    task.Rating = (decimal)Y[result[0, 0], result[0, 1]];
                    mgr.updateTask(task);
                }

                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
Ejemplo n.º 2
0
        //getting Y from data base
        public double[,] SelectRatings(String[] expressions, UserProfile[] users)
        {
            try
            {
                double[,] Y = new double[expressions.Length, users.Length];
                TaskManager mgr = new TaskManager();
                TaskRatingDTO[] tasks = mgr.selectRatings();

                foreach (TaskRatingDTO task in tasks)
                {
                    int[,] result = this.GetYIndex(task.JobId.ToString(), task.RecruiteeId.ToString(), expressions, users);
                    Y[result[0, 0], result[0, 1]] = (double)task.Rating;
                }
                return Y;
            }
            catch (Exception ex)
            {
                return null;
            }
        }