コード例 #1
0
 public Cache()
 {
     Prods.Add(new Product("1111111111", 1, "Indesit111", null));
     Prods.Add(new Product("2222222222", 2, "Indesit222", null));
     Prods.Add(new Product("3333333333", 3, "Indesit333", null));
     Prods.Add(new Product("4444444444", 4, "Indesit444", null));
     Prods.Add(new Product("5555555555", 5, "Indesit555", null));
     Prods.Add(new Product("6666666666", 6, "Indesit666", null));
     Prods.Add(new Product("7777777777", 7, "Indesit777", null));
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: koanse/Terminal
        /// <summary>
        /// Конструктор
        /// </summary>
        public Cache(string s)
        {
            Products = new ArrayList();

            Prods.Add(new Product("5555555555", "5", "Indesit555", null));
            Prods.Add(new Product("6666666666", "6", "Indesit666", null));
            Prods.Add(new Product("7777777777", "7", "Indesit777", null));

            ArrayList regs = new ArrayList();

            regs.Add(new Registration(new DateTime(2008, 4, 15, 15, 46, 0), 1, "460192120232", "460192120232", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 15, 15, 46, 1), 1, "460192120232", "460192120232", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 15, 15, 46, 2), 1, "3", "460192120232", RegState.Unchanged));
            Product p = new Product("R44-2695", "1", "Indesit111", regs);

            Prods.Add(p);
            Products.Add(p.Clone());

            regs = new ArrayList();
            regs.Add(new Registration(new DateTime(2008, 4, 1, 14, 6, 0), 1, "4", "460192120232", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 1, 14, 7, 1), 1, "5", "460192120232", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 1, 14, 8, 2), 1, "6", "3", RegState.Unchanged));
            p = new Product("460192120232", "1", "Indesit222", regs);
            Prods.Add(p);
            Products.Add(p.Clone());

            regs = new ArrayList();
            regs.Add(new Registration(new DateTime(2008, 4, 1, 15, 3, 0), 1, "460192120232", "460192120232", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 1, 15, 4, 1), 1, "3", "460192120232", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 1, 15, 5, 2), 1, "6", "460192120232", RegState.Unchanged));
            p = new Product("3333333333", "1", "Indesit333", regs);
            Prods.Add(p);
            Products.Add(p.Clone());

            regs = new ArrayList();
            regs.Add(new Registration(new DateTime(2008, 4, 1, 16, 3, 0), 1, "460192120232", "460192120232", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 1, 16, 5, 1), 1, "460192120232", "3", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 1, 16, 7, 2), 1, "5", "460192120232", RegState.Unchanged));
            regs.Add(new Registration(new DateTime(2008, 4, 1, 16, 7, 2), 1, "3", "460192120232", RegState.Unchanged));
            p = new Product("4444444444", "1", "Indesit444", regs);
            Prods.Add(p);
            Products.Add(p.Clone());

            Prods.Sort();
            Products.Sort();
            TempRegs = new ArrayList();
        }
コード例 #3
0
        private void Initialize()
        {
            string sql = "select prodspec_id from mmview.fvprodspec ";

            switch (type)
            {
            case 0:
                sql += "where prodcat_id='Dummy'";
                break;

            case 1:
                sql += "where prodcat_id='Equipment Monitor'";
                break;

            case 2:
                sql += "where prodcat_id='Process Monitor'";
                break;

            case 3:
                sql += "where prodcat_id='Production'";
                break;

            case 4:
                sql += "where prodcat_id='Raw'";
                break;

            case 5:
                sql += "where prodcat_id='Recycle'";
                break;

            case 6:
                sql += "where prodcat_id='Production' and prodspec_id not like 'SL%'";
                break;

            default:
                break;
            }
            DB2Helper dB2 = new DB2Helper();

            dB2.GetSomeData(sql);
            for (var i = 0; i < dB2.dt.Rows.Count; i++)
            {
                Prods.Add(dB2.dt.Rows[i][0].ToString());
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: koanse/Terminal
        /// <summary>
        /// Получение информации об изделии из БД
        /// </summary>
        public void UpdateProdInfo()
        {
            int index = Prods.BinarySearch(0, Prods.Count, new Product(SelectedProdID), null);

            if (index < 0)
            {
                throw new Exception("Неверный код изделия");
            }
            Product p = Prods[index] as Product;

            if (p.Regs == null)
            {
                Products.Add(p.Clone());
                return;
            }
            ArrayList regs = null;

            foreach (Registration r in p.Regs)
            {
                if (DateTime.Now < r.Time.Add(ProgramSettings.ReentrancePeriod))
                {
                    if (regs == null)
                    {
                        regs = new ArrayList();
                    }
                    regs.Add(r.Clone());
                }
            }
            if (regs != null)
            {
                regs.Sort();
                regs.Reverse();
            }
            p = new Product(p.ID, p.ModID, p.Model, regs);
            Products.Add(p);
        }