Ejemplo n.º 1
0
        public override RefItem LoadFromJSONItem(dynamic AJSONObject, List <Ref> ARefs = null)
        {
            LBReader LResult = new LBReader();

            foreach (var LProperty in AJSONObject)
            {
                if (((String)LProperty.Name).Equals("Id"))
                {
                    LResult.Id = LProperty.Value;
                }
                if (((String)LProperty.Name).Equals("Name"))
                {
                    LResult.Name = LProperty.Value;
                }
                if (((String)LProperty.Name).Equals("TicketNo"))
                {
                    LResult.TicketNo = LProperty.Value;
                }
                if (((String)LProperty.Name).Equals("Address"))
                {
                    LResult.Address = LProperty.Value;
                }
                if (((String)LProperty.Name).Equals("Phone"))
                {
                    LResult.Phone = LProperty.Value;
                }
            }
            return(LResult);
        }
Ejemplo n.º 2
0
        public override void GenTest(List <Ref> ARefs = null)
        {
            String[] LCReaders = new String[] {
                "Иванов И.И."
                , "Иванов Е.А."
                , "Петров С.С."
                , "Петров И.П."
                , "Сидоров С.С."
                , "Сидоров А.В."
                , "Кравченко К.Е."
                , "Коваленко А.А."
            };
            Random Rnd = new Random();

            for (int i = 0; i < TestDataCount; i++)
            {
                int      LIndx = Rnd.Next(0, LCReaders.Length);
                LBReader LItem = new LBReader();
                LItem.Id       = i + 1;
                LItem.Name     = LCReaders[LIndx];
                LItem.TicketNo = "18899500" + i.ToString().PadLeft(3).Replace(" ", "0");
                Add(LItem);
            }
        }