Exemplo n.º 1
0
    private static void CreateJob(IDictionary <string, IEmployee> employeesByName, string[] commandArgs, JobCollection jobCollection)
    {
        string    jobName            = commandArgs[1];
        int       requiredHours      = int.Parse(commandArgs[2]);
        string    targetEmployeeName = commandArgs[3];
        IEmployee targetEmployee     = employeesByName[targetEmployeeName];
        IJob      job = new Job(jobName, requiredHours, targetEmployee);

        jobCollection.Add(job);
    }
Exemplo n.º 2
0
 private void AddJob(EncodeInfo inJob)
 {
     try
     {
         JobCollection.Add(inJob);
         NotifyOfPropertyChange(() => JobCollection);
     }
     catch (Exception ex)
     {
         Log.Error(ex);
     }
 }
Exemplo n.º 3
0
        public void Load()
        {
            JobCollection.Clear();
            DAL       dal = new DAL();
            DataTable dt  = dal.Read("select JobRequest_Id,bit_job_type.Job_Type,bit_job_type.Job_Type_Id,RequestDate,Priority,Comments,Status,bit_client_location.Location_Name,bit_client_location.Location_Id from bit_job_request, bit_job_type, bit_client_location where bit_job_request.Job_Type_Id = bit_job_type.Job_Type_Id and   bit_job_request.Location_Id = bit_client_location.Location_Id and   Status in('Requested','Acknowledged') order by JobRequest_Id");

            foreach (DataRow dr in dt.Rows)
            {
                JobAssignment job = new JobAssignment(dr);
                JobCollection.Add(job);
            }
        }
Exemplo n.º 4
0
        private JobCollection InitializeCollection(DataTable dt)
        {
            JobCollection retVal = null;

            if (dt != null && dt.Columns.Count > 0)
            {
                retVal = new JobCollection();
                foreach (DataRow row in dt.Rows)
                {
                    Job item = InitializeObject(row);
                    retVal.Add(item);
                }
            }
            return(retVal);
        }
Exemplo n.º 5
0
 public void RefreshJobList()
 {
     try
     {
         List <Job> jobList = DataController.GetInstance.GetJobs();
         jc = Application.Current.Resources["JobCollection"] as JobCollection;
         jc.Clear();
         foreach (Job job in jobList)
         {
             jc.Add(job);
         }
         Application.Current.Resources["JobCollection"] = jc;
     }
     catch (MySqlException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 6
0
 public void SearchJobList(string searchTerm)
 {
     if (searchTerm.Length == 0 || searchTerm.Equals("Search"))
     {
         jlc = jc;
         Application.Current.Resources["JobListCollection"] = jlc;
     }
     else
     {
         JobCollection tempList = new JobCollection();
         foreach (Job job in jc)
         {
             if (job.Job_Number.ToLower().Contains(searchTerm.ToLower()) ||
                 job.Job_Status.ToLower().Contains(searchTerm.ToLower()))
             {
                 tempList.Add(job);
             }
         }
         Application.Current.Resources["JobListCollection"] = tempList;
     }
 }
Exemplo n.º 7
0
        private static JobCollection CreateStartWorkflowJob()
        {
            JobCollection jobs = new JobCollection();

            StartWorkflowJob sJob = new StartWorkflowJob();

            sJob.JobID       = UuidHelper.NewUuidString();
            sJob.ProcessKey  = "DefaultApprovalProcess";
            sJob.JobID       = Guid.NewGuid().ToString();
            sJob.Name        = "启动流程测试";
            sJob.Description = "小测一下";
            sJob.Creator     = new OguUser("6872ac4c-48a2-47fc-a12f-05415dc50042");         //zhangyy
            sJob.Operator    = new OguUser("22c3b351-a713-49f2-8f06-6b888a280fff");         //wangli5
            JobSchedule schedule  = CreateSchedule();
            JobSchedule schedule0 = CreateSchedule();

            sJob.Schedules.Add(schedule);
            sJob.Schedules.Add(schedule0);

            jobs.Add(sJob);

            return(jobs);
        }
Exemplo n.º 8
0
        public JobCollection GetJobsByGroup(string group)
        {
            var jobs = new JobCollection();

            lock (_initLock)
            {
                foreach (var job in _jobs)
                {
                    if (job.Group == group)
                        jobs.Add(job);
                }
            }

            return jobs;
        }
Exemplo n.º 9
0
 private static void AddToJobList(Job job)
 {
     L.I("Adding New Job to the collection: " + job.JobName);
     JobCollection.Add(job);
 }
Exemplo n.º 10
0
		private static JobCollection CreateStartWorkflowJob()
		{
			JobCollection jobs = new JobCollection();

			StartWorkflowJob sJob = new StartWorkflowJob();

			sJob.JobID = UuidHelper.NewUuidString();
			sJob.ProcessKey = "DefaultApprovalProcess";
			sJob.JobID = Guid.NewGuid().ToString();
			sJob.Name = "启动流程测试";
			sJob.Description = "小测一下";
			sJob.Creator = new OguUser("6872ac4c-48a2-47fc-a12f-05415dc50042"); //zhangyy
			sJob.Operator = new OguUser("22c3b351-a713-49f2-8f06-6b888a280fff"); //wangli5
			JobSchedule schedule = CreateSchedule();
			JobSchedule schedule0 = CreateSchedule();

			sJob.Schedules.Add(schedule);
			sJob.Schedules.Add(schedule0);

			jobs.Add(sJob);

			return jobs;
		}