Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Worksheet pSheet = GetWorksheet("таблица цен");

            int emptyColumn = 2;//А1 - пустая, и ее надо пропустить

            for (;; emptyColumn++)
            {
                Range  pRange = pSheet.Cells[1, emptyColumn];
                string text   = pRange.Text;
                if (text == "")
                {
                    break;
                }
            }
            pSheet.Cells[1, emptyColumn].Value = DateTime.Now;

            List <Core.CAuctionItem> items = m_Analyzer.GetItems();
            int count = items.Count;

            for (int i = 0; i < count; i++)
            {
                Core.CAuctionItem item = items[i];
                string            name = item.GetName();
                int  row   = 1;
                bool bFind = false;
                for (; row < 30; row++) //ToDo: 20 !!!!!!!!!!!!!!!
                {
                    Range pRange = pSheet.Cells[row, 1];


                    if (name.Equals(pRange.Text, StringComparison.OrdinalIgnoreCase))
                    {
                        bFind = true;
                        break;
                    }
                }
                if (!bFind)
                {
                    System.Diagnostics.Debug.Assert(false, name);
                }
                int needSize = 300;
                if (name == spisok.GetName(Core.ProductTag.ptYakorTrava))
                {
                    needSize = 100;
                }
                if (name.Contains("Настой") || name.Contains("Боевое"))
                {
                    needSize = 1;
                }
                double Gold = item.GetCost(needSize);
                //Gold /= needSize;
                Range pRange1 = pSheet.Cells[row, emptyColumn];
                pRange1.Value = Gold;
            }
        }
        public void Parse(string [] s)
        {
            int Count = s.Length;

            for (int startPos = 0; startPos < Count;)
            {
                string str = s[startPos];
                if (str.Contains("AnalyzeSortData - self - start"))
                {
                    CAuctionItem item = new CAuctionItem();
                    startPos = item.Parse(s, startPos);
                    item.Sort();
                    m_Items.Add(item);
                }
                else
                {
                    startPos++;
                }
            }
        }