Exemple #1
0
        private void WriteInfo(StolotoResult stolotoResult, string format, string path)
        {
            using (FileStream fileStream = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite))
                using (StreamWriter streamWriter = new StreamWriter(fileStream, Encoding.Default))
                {
                    foreach (var stolotoParseResult in stolotoResult.Result)
                    {
                        foreach (var itemKey in stolotoParseResult.Keys)
                        {
                            var results = stolotoParseResult[itemKey];

                            foreach (var key in results.Keys)
                            {
                                var items = results[key];

                                foreach (var item in items.OrderBy(v => v.ExternalId))
                                {
                                    var draw = item.ExternalId;

                                    var numbers = item.Numbers.Select(val => Convert.ToInt32(val));

                                    streamWriter.WriteLine(string.Format(format, draw, string.Join(" ", numbers.Select(val => val.ToString("d2")))));
                                }
                            }
                        }
                    }
                }
        }
Exemple #2
0
        private void WriteStolotoResult(StolotoResult stolotoResult, string filePath)
        {
            var format = "{0} _ {1}";

            this.WriteInfo(stolotoResult, format, filePath);
        }