protected override void Start() { var datas = new List <Dictionary <string, string> >(); var ordNda = new Nda(FileMode.WriteOnly); var ordIdn = new Idn(FileMode.WriteOnly); try { SetTemplates(); datas.AddRange(_configObj.Rics.Select(GetData)); ordIdn.LoadFromTemplate(_ordIdn, datas); ordIdn.Save(Path.Combine(_configObj.WorkingDir, String.Format("IdnAdd{0}.txt", _configObj.Market))); AddResult("Idn Add file", ordIdn.Path, "idn"); ordNda.LoadFromTemplate(_ordNda, datas); ordNda.Save(Path.Combine(_configObj.WorkingDir, String.Format("NdaAdd{0}.csv", _configObj.Market))); AddResult("Nda Add file", ordNda.Path, "nda"); } catch (Exception ex) { LogMessage("Task failed, error: " + ex.Message, Logger.LogType.Error); throw new Exception("Task failed, error: " + ex.Message, ex); } finally { } }
protected override void Start() { var datas = new Dictionary <string, string>(); var cleanData = new List <Dictionary <string, string> >(); var ordNda = new Nda(FileMode.WriteOnly); var ordQuoteFuture = new Nda(FileMode.WriteOnly); var ordIssueFuture = new Nda(FileMode.WriteOnly); var ordFm = new Fm(); var ordIdn = new Idn(FileMode.WriteOnly); try { SetTemplates(); foreach (var ric in _configObj.Rics) { datas = GetInfos(ric.Trim()); cleanData.Add(CleanData(datas)); } ordIssueFuture.LoadFromTemplate(_ordIssueFuture, cleanData); ordIssueFuture.Save(Path.Combine(_configObj.WorkingDir, String.Format("IssueFutureAdd{0}.csv", _configObj.Market))); AddResult("Issue Future Add file", ordIssueFuture.Path, "nda"); ordIdn.LoadFromTemplate(_ordIdn, cleanData); ordIdn.Save(Path.Combine(_configObj.WorkingDir, String.Format("IdnAdd{0}.txt", _configObj.Market))); AddResult("Idn Add file", ordIdn.Path, "idn"); ordNda.LoadFromTemplate(_ordNda, cleanData); ordNda.Save(Path.Combine(_configObj.WorkingDir, String.Format("NdaAdd{0}.csv", _configObj.Market))); AddResult("Nda Add file", ordNda.Path, "nda"); ordQuoteFuture.LoadFromTemplate(_ordQuoteFuture, cleanData); ordQuoteFuture.Save(Path.Combine(_configObj.WorkingDir, String.Format("QuoteFutureAdd{0}.csv", _configObj.Market))); AddResult("Quote Future Add file", ordQuoteFuture.Path, "nda"); ordFm.LoadFromTemplate(_ordFm, cleanData); ordFm.Save(Path.Combine(_configObj.WorkingDir, String.Format("Fm{0}.txt", _configObj.Market))); AddResult("Fm file", ordFm.Path, "fm"); } catch (Exception ex) { LogMessage("Task failed, error: " + ex.Message, Logger.LogType.Error); throw new Exception("Task failed, error: " + ex.Message, ex); } finally { } }
protected override void Start() { Thread.Sleep(2000); LogMessage("task start"); var props = new List <Dictionary <string, string> > { new Dictionary <string, string> { { "ric", "12345" }, { "commonname", "first company" } }, new Dictionary <string, string> { { "ric", "33322" }, { "commonname", "other company" } } }; var myNda = new Nda(); var test = typeof(Nda); LogMessage("Load nda from File"); myNda.Load(@"C:\Users\websiting\Documents\ricpresentation\result.xls"); myNda.Save(@"C:\Users\websiting\Documents\ricpresentation\result4.xls"); Thread.Sleep(2000); //LogMessage("the first ric is : " + myNda.Content[0].Ric); ////foreach (NdaEntry testentry in myNda) ////{ //// var commoname = testentry.AssetCommonName; ////} //var test42 = from NdaEntry entry in myNda // where entry.Ric == "ORD" // select entry; //LogMessage("[DYNAMIC]the first ric is : " + myNda.DynamicContent[0].RIC); LogMessage("task done"); }