private void btnOK_Click(object sender, EventArgs e) { if (!NamingGuidance.CheckNameFocus(tbName, "Custom Dialog Name", true)) { return; } if (!NamingGuidance.CheckCaptionFocus(tbTopic, "Topic", true)) { return; } if (!NamingGuidance.CheckDLLName(tbDLLName.Text.Trim(), "DLL Name", true)) { tbDLLName.Focus(); return; } CustomDialog.Name = tbName.Text.Trim(); CustomDialog.Topic = tbTopic.Text.Trim(); CustomDialog.DLLName = tbDLLName.Text.Trim(); // Save the Custom Dialog to database modelService.SaveDomainObject(CustomDialog); // if this is a new dialog leave the dialog as checked out if (newDialog == true) { CheckOutInObject(CustomDialog, true); ContaindDomainObjectIdAndType = new KeyValuePair <Guid, Type>(CustomDialog.Id, typeof(CustomDialog)); } DialogResult = DialogResult.OK; }
private void btnOK_Click(object sender, EventArgs e) { // Check name. if (!NamingGuidance.CheckCustomViewName(tbName.Text.Trim(), true)) { tbName.Focus(); return; } // Check Title if (!NamingGuidance.CheckCaptionFocus(tbTitle, "Custom View Title", true)) { return; } // Check DLL Name if (!NamingGuidance.CheckDLLName(cbDLLName.Text.Trim(), "Custom View DLL Name", true)) { cbDLLName.Focus(); return; } // Check CustomClassName if (!NamingGuidance.CheckClassName(tbClassName.Text, "Custom View Class Name", true)) { tbClassName.Focus(); return; } // Create the view EditView.BusinessEntity = (BusinessEntity)cbBusinessEntity.SelectedItem; EditView.CustomClassName = tbClassName.Text.Trim(); EditView.CustomDLLName = cbDLLName.Text.Trim(); EditView.Name = tbName.Text.Trim(); EditView.Title = tbTitle.Text.Trim(); // Persist the view EditView = (DataAccess.Domain.View)modelService.SaveDomainObject(EditView); DialogResult = DialogResult.OK; }