Ejemplo n.º 1
0
        public int insertJobDetails(Printing_Job Job)
        {
            //Method ID : MTH01

            //Methode Description : This method will Save job details & return job Id.

            try
            {
                db.Printing_Jobs.InsertOnSubmit(Job);
                db.SubmitChanges();

                var jobIds = (from x in db.Printing_Jobs
                              orderby x.JobID descending
                              select x.JobID).Take(1);
                int jobId = 0;

                foreach (var x in jobIds)
                {
                    jobId = Convert.ToInt32(x);
                }

                return(jobId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occuered while processing. CLZ02MTH01 Error Code : " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(0);
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Printing_Job job = new Printing_Job
                {
                    MachineID        = Convert.ToInt32(cmbMachineID.SelectedValue),
                    colours          = Convert.ToInt32(txtNoOfColours.Text),
                    StartingPosition = Convert.ToDouble(txtStartingPosition.Text),
                    Width            = Convert.ToDouble(txtWidthOfJob.Text),
                    Height           = Convert.ToDouble(txtHeightOfJob.Text),
                    EndTime          = Convert.ToDateTime(dtpExpectedDeadLine.SelectedDate.Value),
                    Note             = txtNote.Text,
                    Sample           = imagePath
                };

                int jobID = jobClass.insertJobDetails(job);
                if (jobID != 0)
                {
                    MessageBox.Show("Information successfully saved.", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                    txtJobID.Text = jobID.ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occuered while processing. Error Code : " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 3
0
        private void cmbJobID_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int jobID = Convert.ToInt32(cmbJobID.SelectedValue);

            BitmapImage sampleImage = jobClass.getSampleImage(jobID);

            imgSampleImage.Source = sampleImage;

            Printing_Job job = jobClass.getPrintingJobDetails(jobID);

            txtNoOfColours.Text = job.colours.ToString();

            fillCmbColours();
        }