private void DoEdit(string submissionURI) { ssr = ServerCommand.LoadSubmission(submissionURI); submissionBindingSource.DataSource = ssr.Submission; inputsGrid.AutoGenerateColumns = true; inputsBindingSource.DataSource = ssr.Submission.InputsBytes.ToDataTable(); //TODO The next lines DOES NOT causes round trips to the server... customerTextBox.BindTextTo(submissionBindingSource, "Customer.Name"); formTextBox.BindTextTo(submissionBindingSource, "Form.Name"); groupTextBox.BindTextTo(submissionBindingSource, "Form.Group.Name"); emailTextBox.BindTextTo(submissionBindingSource, "Customer.Email"); dateTextBox.BindTextTo(submissionBindingSource, "Date"); ShowDialog(Program.MainForm); }
private void DoEdit(string submissionURI) { selectedSubmission = ServerCommand.LoadSubmission(submissionURI); submissionBindingSource.DataSource = selectedSubmission; inputsGrid.AutoGenerateColumns = true; inputsBindingSource.DataSource = selectedSubmission.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); }
private void DoEdit(string submissionURI) { var result = ServerCommand.LoadSubmission(submissionURI); submission = result.submission; submissionBindingSource.DataSource = submission; inputsGrid.AutoGenerateColumns = true; inputsBindingSource.DataSource = result.inputsTable; //TODO The next 3 lines causes 3 round trips to the server... customerTextBox.Text = submission.Customer.Name; formTextBox.Text = submission.Form.Name; groupTextBox.Text = submission.Form.Group.Name; dateTextBox.Text = submission.Date.ToLongDateString(); ShowDialog(Program.MainForm); }
private void DoEdit(string submissionURI) { var result = ServerCommand.LoadSubmission(submissionURI); submission = result.submission; //TODO This next 3 lines are important but feels like boilerplate to me and if the developer forget to do this it will lazyload. submission.Form = result.form; submission.Form.Group = result.group; submission.Customer = result.customer; submissionBindingSource.DataSource = submission; inputsGrid.AutoGenerateColumns = true; inputsBindingSource.DataSource = result.inputsTable; //TODO The next 3 lines DOES NOT causes 3 round trips to the server... customerTextBox.Text = submission.Customer.Name; formTextBox.Text = submission.Form.Name; groupTextBox.Text = submission.Form.Group.Name; dateTextBox.Text = submission.Date.ToLongDateString(); ShowDialog(Program.MainForm); }