Ejemplo n.º 1
0
        public List <Job> listUnassignedJobByCategoryAndType(jobCategory category, jobType type)
        {
            try
            {
                List <Job> jobs           = new List <Job>();
                List <Job> unassignedJobs = new List <Job>();
                jobs = listJobsByCategoryAndType(category, type);

                foreach (Job job in jobs)
                {
                    if (job.JobStatus == "Unassigned")
                    {
                        unassignedJobs.Add(job);
                    }
                }

                if (unassignedJobs.Count > 0)
                {
                    return(unassignedJobs);
                }

                return(new List <Job>());
            }
            catch (Exception e)
            {
                MessageBox.Show("JobBusinessLogic : getUnassignedJobByType ERROR:" + e.Message);
                throw;
            }
        }
Ejemplo n.º 2
0
        public List <Job> listJobsByCategoryAndType(jobCategory category, jobType type)
        {
            try
            {
                DataTable  jobData = new DataTable();
                List <Job> jobs    = new List <Job>();
                switch (category)
                {
                case jobCategory.hardware:
                    jobs = listJobByCategory(jobCategory.hardware);
                    break;

                case jobCategory.software:
                    jobs = listJobByCategory(jobCategory.software);
                    break;

                default:
                    break;
                }
                switch (type)
                {
                case jobType.installation:
                    jobs = jobs.Except(listJobByType(jobType.installation)).ToList();
                    break;

                case jobType.repair:
                    jobs = jobs.Except(listJobByType(jobType.repair)).ToList();
                    break;

                default:
                    break;
                }
                if (jobs.Count > 0)
                {
                    return(jobs);
                }
                return(new List <Job>());
            }
            catch (Exception e)
            {
                MessageBox.Show("JobBusinessLogic : getJobByType ERROR:" + e.Message);
                throw;
            }
        }
Ejemplo n.º 3
0
        public List <Job> listJobByCategory(jobCategory category)
        {
            try
            {
                DataTable  jobData = new DataTable();
                List <Job> jobs    = new List <Job>();
                switch (category)
                {
                case jobCategory.hardware:
                    jobData = db.ListJobsByCategory("Hardware");
                    break;

                case jobCategory.software:
                    jobData = db.ListJobsByCategory("Software");
                    break;

                case jobCategory.callCentre:
                    jobData = db.ListJobsByCategory("CallCentre");
                    break;

                default:
                    break;
                }
                if (jobData.Rows.Count > 0)
                {
                    for (int i = 0; i < jobData.Rows.Count; i++)
                    {
                        jobs.Add(new Job(data: jobData, i: i));
                    }
                    return(jobs);
                }

                return(new List <Job>());
            }
            catch (Exception e)
            {
                MessageBox.Show("JobBusinessLogic : getJobByCategory ERROR:" + e.Message);
                throw;
            }
        }