protected void ok_Click(object sender, EventArgs e) { if (dojoSeminarRegistrationID == 0) { obj = new DojoSeminarRegistration(); } else { obj = new DojoSeminarRegistration(dojoSeminarRegistrationID); } obj.Status = byte.Parse(tbStatus.Text); obj.RegistrationDate = deRegistrationDate.Date; obj.ClassUnits = int.Parse(tbClassUnits.Text); obj.TotalFee = decimal.Parse(tbTotalFee.Text); obj.PaymentDate = dePaymentDate.Date; obj.PaymentReference = tbPaymentReference.Text; obj.PaymentAmount = decimal.Parse(tbPaymentAmount.Text); if (msContact.SelectedItem != null && msContact.SelectedItem.Value != "Null") { obj.Contact = GreyFoxContact.NewPlaceHolder("kitTessen_SeminarRegistrations_Contacts", int.Parse(msContact.SelectedItem.Value)); } else { obj.Contact = null; } if (msCustomer.SelectedItem != null && msCustomer.SelectedItem.Value != "Null") { obj.Customer = RHCustomer.NewPlaceHolder( int.Parse(msCustomer.SelectedItem.Value)); } else { obj.Customer = null; } if (msInvoiceLine.SelectedItem != null && msInvoiceLine.SelectedItem.Value != "Null") { obj.InvoiceLine = RHInvoiceLine.NewPlaceHolder( int.Parse(msInvoiceLine.SelectedItem.Value)); } else { obj.InvoiceLine = null; } if (msSalesOrderLine.SelectedItem != null && msSalesOrderLine.SelectedItem.Value != "Null") { obj.SalesOrderLine = RHSalesOrderLine.NewPlaceHolder( int.Parse(msSalesOrderLine.SelectedItem.Value)); } else { obj.SalesOrderLine = null; } if (editOnAdd) { dojoSeminarRegistrationID = obj.Save(); } else { obj.Save(); } if (resetOnAdd) { tbStatus.Text = string.Empty; deRegistrationDate.Date = DateTime.Now; tbClassUnits.Text = string.Empty; tbTotalFee.Text = string.Empty; dePaymentDate.Date = DateTime.Now; tbPaymentReference.Text = string.Empty; tbPaymentAmount.Text = string.Empty; msContact.SelectedIndex = 0; msCustomer.SelectedIndex = 0; msInvoiceLine.SelectedIndex = 0; msSalesOrderLine.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }