private void btnOk_Click(object sender, EventArgs e) { docTypeBindingSource.EndEdit(); var docType = docTypeBindingSource.Current as DocumentType; docType = new DocumentTypeRepository().Save(docType); this.DialogResult = DialogResult.OK; this.Close(); }
public static DocumentType GetById(int id) { DocumentType documentType; if (!_types.TryGetValue(id, out documentType)) { documentType = new DocumentTypeRepository().GetDocType(id); _types.Add(id, documentType); } return documentType; }