示例#1
0
            /// <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);
            }
示例#2
0
 public void SetDatasource(int jobID)
 {
     if (jobID != default)
     {
         _activeJob               = productService.GetJobProducts(jobID);
         bsProducts.DataSource    = _activeJob.Products;
         dgProductGrid.DataSource = bsProducts;
     }
 }
示例#3
0
        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);
        }
示例#4
0
        /// <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();
        }
示例#5
0
        /// <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
            });
        }
示例#6
0
 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;
 }