public BindingSource LoadCrmTemplatesToBindingSource(BindingSource bs) { bs.Clear(); var crmService = new DocumentTemplateService(service, new SettingsService()); var documents = crmService.QueryDocuments(); var templateList = documents.General; FillBindingSourceWithTemplates(bs, documents.General); FillBindingSourceWithTemplates(bs, documents.Personal); return(bs); }
private void DocumentTemplateExport_Load(object sender, EventArgs e) { _fileOperationService = new FileOperationService(MySettings); _documentTemplateService = new DocumentTemplateService(Service, _settingsService); _bindingSourceService = new BindingSourceService(Service, MySettings); //TxtDirectoryPath.Text = MySettings.LastDirectoryPath; SetToolTips(); if (!string.IsNullOrEmpty(TxtDirectoryPath.Text) && Directory.Exists(TxtDirectoryPath.Text)) { BsCrmTemplates = _bindingSourceService.LoadCrmTemplatesToBindingSource(BsCrmTemplates); } SetButtonLayoutTabCrmDocumentTemplates(); foreach (DataGridViewColumn col in DgvDocumentTemplates.Columns) { switch (col.Name) { case "EntityTypeDatagridViewComboBox": case "DescriptionDataGridViewTextBoxColumn": col.ReadOnly = false; break; default: col.ReadOnly = true; break; } } //EntityTypeDatagridViewComboBox.ReadOnly = false; //EntityTypeDatagridViewComboBox.Items.Add("documenttemplate"); //EntityTypeDatagridViewComboBox.Items.Add("personaldocumenttemplate"); }