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
private static List<T> RemoveDoubleItems<T>(List<T> list)
{
    List<T> newList = new List<T>();
    Dictionary<T,string> keyList = new Dictionary<T,string>();

    foreach (T item in list)
    {
        if (!keyList.ContainsKey(item))
        {
            keyList.Add(item, string.Empty);
            newList.Add(item);
        }
    }

    return newList;
}
private static List<T> RemoveDoubleItems<T>(List<T> list)
{
    return list.Distinct().ToList();
}

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