/// <summary> /// Return Job Dto /// </summary> /// <param name="JobId"></param> /// <returns></returns> public JobListDto FindJobDto(int JobId) { Job job = ctx.Job.Find(JobId); JobListDto dto = new JobListDto(); jobMapper.Map(job, dto); return(dto); }
public void SetDatasource(int jobID) { if (jobID != default) { _activeJob = productService.GetJobProducts(jobID); bsProducts.DataSource = _activeJob.Products; dgProductGrid.DataSource = bsProducts; } }
public JobListDto GetJobProducts(int jobID) { Job job = ctx.Job.Include(p => p.Product).ThenInclude(s => s.SubAssembly).Where(j => j.JobID == jobID).FirstOrDefault(); JobListDto dto = new JobListDto(); jobProductMapper.Map(job, dto); return(dto); }
/// <summary> ----------------------------------------------------------------------------- /// Hydrate the Products DTO /// </summary> /// <param name="sender"></param> /// <param name="e"></param>--------------------------------------------------------------- private void ComboBox1_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cbo = (ComboBox)sender; _selectedJobDto = (JobListDto)cbo.SelectedItem; _selectedJobDto = _productService.GetProducts(_selectedJobDto.JobID); _activeProductList = _selectedJobDto.Products; bsProduct.DataSource = _activeProductList; FormateProductGrid(); }
/// <summary> /// Job Picker /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cboJobPicker_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cbx = (ComboBox)sender; _activeJob = (JobListDto)cbx.SelectedItem; bsDeliveries.DataSource = _deliveryService.JobDeliveries(_activeJob.JobID); isDirty = false; //ToogleButtonStyle(IsDirty); OnSelectJob(new JobSelectedEventArgs { JobID = _activeJob.JobID }); }
private void LoadProducts(int jobID) { try { _selectedJob = _jobService.GetDeepJob(_selectedJob.JobID); _SelectedJobDTO = new JobListDto(); jobMapper.Map(_selectedJob, _SelectedJobDTO); _products = _SelectedJobDTO.Products; bsProducts.DataSource = _products; dgProductGrid.DataSource = bsProducts; } catch (Exception) { MessageBox.Show("Error"); } }
public JobScheduledNotificationMessage(JobListDto item) { EventName = NotificationEvents.JobScheduled; Item = item; }