Hoe best te werken met c# , AD/SQL / VSTO ?

Status
Niet open voor verdere reacties.

knijn

Nieuwe gebruiker
Lid geworden
22 apr 2010
Berichten
2
Ik had mijn probleem/vraag reeds in het engels gemaakt en zal het hier zo plakken, indien het gewenst is dat et toch in het nederlands is, zal ik het vertalen.

I want to create a vsto project, or better : when starting a .dotx file a windows form should pop up with eg 4 comboboxes and 4 listboxes. 2 comboboxes should contain the usernames of our Active Directory accounts and 2 other comboboxes should contain usernames of external contacts, these will be fetched from a sql database. When a user is selected from that list it will be copied into a textbox belonging to the respective combobox. The usernames that are in the textboxes are used for later usage. When the user clicks on the OK/Submit button, the window closes and the usernames are filled in in certain areas of the word document.
BUT, the first user of a certain textbox will also have its phonenumber/faxnumber/... shown in a certain area of the word document. It is also possible that for the other textboxes the first user (or all of them) of the textbox will have more info in the worddocument than previously shown in the windows form.
My main question : how do I create all this ?
I am a newbie/noob in programming, but I know a bit of it and as soon as I know what to use and handle the stuff I know I can create this.

I tried with comboboxes, but I can only add a displaymember and valuemember to it, so only the fullname and as value its email for instance, but how do I go from there ??
I also heard about loading the AD users into memory and go from there, but is this a good thing and how do I do this ? and what about the sql-data then ?

I would appreciate it if you could give me as much info as I can use going from examples to websites giving good explanations or examples to books that are not only good for beginning stuff, because even loading data from AD is not in every book well described. I am dutch speaking but my english is very well as well.
I hope someone can and wants to help me out.
thank you
 
kan je een GUI maken en zeggen ongeveer wat je waar wilt hebben.
en je huidige project uploaden.
dan kunnen we er samen naar kijken ;) (ik ken dat ook niet van AD maar beetje zoeken en klooien moet het wel lukken )

Byee VRC
 
let's begin :)

Ik heb een persons collection gemaakt als in http://en.csharp-Online.net/Understanding_Generics%E2%80%94Type_Safety_and_Strongly_Typed_Collections

en in mijn main class lees ik de gegevens uit AD en plaats die in de collection :
[cpp]
try
{

string strPath ="LDAP://DOMAIN";
DirectoryEntry entry = new DirectoryEntry(strPath);
DirectorySearcher mySearcher = new DirectorySearcher(entry);
mySearcher.Filter = "(&(objectCategory=person)(mail=*))";
mySearcher.PropertiesToLoad.Add("ADsPath");
mySearcher.PropertiesToLoad.Add("givenname"); // firstname
mySearcher.PropertiesToLoad.Add("sn"); // lastname
mySearcher.PropertiesToLoad.Add("mail"); // mail


foreach (SearchResult result in mySearcher.FindAll())
{
string First_Name = "", Last_Name = "", Email="";
DirectoryEntry Dir_Entry = result.GetDirectoryEntry();

if (Dir_Entry.Properties["mail"].Value != null) Email = Dir_Entry.Properties["mail"].Value.ToString();
if (Dir_Entry.Properties["givenname"].Value != null) First_Name = Dir_Entry.Properties["givenname"].Value.ToString();
if (Dir_Entry.Properties["sn"].Value != null) Last_Name = Dir_Entry.Properties["sn"].Value.ToString();

PeopleCollection myPeople = new PeopleCollection();
myPeople.AddPerson(new Person(First_Name, Last_Name, Email));

}


comboBox1.SelectedValueChanged += new EventHandler(comboBox1_SelectedValueChanged);

}
[/cpp]


Maar hoe krijg ik nu de First_Name en Last_Name als 'fullname' in de combobox1.

(Ook wil die gegevens als ik er op ga klikken, in een textbox tevoorschijn toveren en als het form gesubmit wordt, moet de Email (en in een verder stadium telnr en faxnr) gekopieerd worden naar het word-document.)
 
Laatst bewerkt door een moderator:
песок ирпень

Песок может быть природного и искусственного происхождения. Если мы говорим о натуральном песке, то это осадочная горная порода, которая образовалась в процессе выветривания (т.е. разрушения) более крупных горных пород. Натуральный, природный карьерный песок представляет собой рыхлую песок ирпень горную породу, в составе которой находятся крупинки полевых шпатов, кварца, слюды и прочих минералов. В строительстве и ландшафтном дизайне чаще всего используются такие виды песка как: морской, речной и карьерный песок.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan