Beiträge getagged ‘C#’

Hallo mite. Hier spricht .NET

19 Juli 2009

Wünsche viel Vergnügen beim Zeiten stoppen.

static void Main(string[] args)
{
   Configuration configuration = new Configuration();
   configuration.ApiKey = {apikey};
   configuration.Domain = new Uri("https://{domain}.mite.yo.lk");
 
   using (IDataContext context = new MiteDataContext(configuration))
   {
      Project project = new Project();
      project.Name = "mite.net";
 
      context.Create(project);
   }
}

Das Projekt ist auf Codeplex gehostet [ mitenet.codeplex.com ] und steht unter der MS-PL.

Überarbeiten eines Angebots

18 Juni 2009

Um über den Webservice eine Revision eines Angebots zu erstellen, muss dieses zuerst mit dem Status ‘Überarbeitet’ geschlossen werden.

quoteclose qc = new quoteclose();
qc.quoteid = new Lookup( EntityName.quote.ToString(), q.quoteid  );
 
CloseQuoteRequest cqr = new CloseQuoteRequest();
cqr.QuoteClose = qc;
cqr.Status = 7;
 
service.Execute(cqr);

Danach kann eine neue Revision erzeugt werden

ReviseQuoteRequest rqr = new ReviseQuoteRequest();
 
rqr.QuoteId = quoteid;
rqr.ColumnSet = new AllColumns();
 
ReviseQuoteResponse rqresp = (ReviseQuoteResponse)service.Execute(rqr);
 
quote  quoteDraft = (quote)rqresp.BusinessEntity;

Doppelte Einträge in einer Liste entfernen

16 Juli 2008
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
private static List<t> RemoveDoubleItems</t><t>(List</t><t> list)
{
    List</t><t> newList = new List</t><t>();
    Dictionary</t><t , string> keyList = new Dictionary</t><t , string>();
 
    foreach (T item in list)
    {
        if (!keyList.ContainsKey(item))
        {
            keyList.Add(item, string.Empty);
            newList.Add(item);
        }
    }
 
    return newList;
}</t>

ReflectionTypeLoadException beim Installieren von MMC Snap-ins

16 Juli 2008

Die Installation eines MMC Snapins schlägt unter XP SP2 mit einer ReflectionTypeLoadException fehl.

InstallUtil.exe SimpleSnapin.dll

Abhilfe siehe http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2621568&SiteID=1