Пример #1
0
 public AddEditJobView(Job thisJob)
 {
     InitializeComponent();
     if (!IsRuntime) return;
     _currentJob = thisJob;
     InitializeStuff();
     BindDataSources();
     UpdateCurrentJobFaultType();
     UpdateCurrentJobItemType();
     UpDateOrSetJobCreator();
 }
Пример #2
0
        public void PrintJobReceipt(Job jobToBePrinted)
        {
            JobToBePrinted = jobToBePrinted;

            PrintDialog printDialog = new PrintDialog();

            PrintDocument printDocument = new PrintDocument();

            printDialog.Document = printDocument;

            printDocument.PrintPage += printJob_PrintPage;

            DialogResult result = printDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                printDocument.Print();
            }
        }
Пример #3
0
 private void ShowJobDetails(Job thisJob)
 {
     ShowWaitForm();
     using (var jobDetailsView = new AddEditJobView(thisJob))
     {
         jobDetailsView.SaveButtonClicked += SaveChanges;
         jobDetailsView.RecordJobPaymentButtonClicked += RecordJobPaymentButtonClicked;
         HideWaitForm();
         jobDetailsView.ShowDialog();
     }
 }
Пример #4
0
 private void SaveOrUpdateJob(Job thisJob)
 {
     if (thisJob.JobID < 1)
     {
         _dataManager.AddJob(thisJob);
         JobsBindingSource.Add(thisJob);
     }
     else
     {
         _dataManager.UpdateJob(thisJob);
     }
 }
Пример #5
0
 public Job AddJob(Job newJob)
 {
     _dataBaseContext.Jobs.AddObject(newJob);
     SaveChangesToDataBase();
     return newJob;
 }
Пример #6
0
 public void UpdateJob(Job newJob)
 {
     _dataBaseContext.Jobs.ApplyCurrentValues(newJob);
     SaveChangesToDataBase();
 }