Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 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;
 }