public static SelectedSubmissionExtra Create(SelectedSubmission selectedSubmission, byte[] inputsTableBytes) { Mapper.Initialize(cfg => { cfg.CreateMap <SelectedSubmission, SelectedSubmissionExtra>(); }); var result = Mapper.Map <SelectedSubmission, SelectedSubmissionExtra>(selectedSubmission); result.InputsTableBytes = inputsTableBytes; return(result); }
private void saveSubmission() { if (SelectedSubmission == null) { MessageBox.Show("Please select a submission"); return; } //If not in edit mode, then nothing to save. if (SelectedSubmission.EditMode == false) { MessageBox.Show("Nothing to save. This submission has not been edited."); return; } SelectedSubmission.SaveToModel(); }
private void DoEdit(string submissionURI) { var result = ServerCommand.LoadSubmission(submissionURI); selectedSubmission = result.selectedSubmission; submissionBindingSource.DataSource = selectedSubmission; inputsGrid.AutoGenerateColumns = true; inputsBindingSource.DataSource = result.inputsTable; //TODO The next 3 lines DOES NOT causes 3 round trips to the server... customerTextBox.Text = selectedSubmission.Customer; formTextBox.Text = selectedSubmission.Form; groupTextBox.Text = selectedSubmission.Group; dateTextBox.Text = selectedSubmission.Date.ToLongDateString(); ShowDialog(Program.MainForm); }