Esempio n. 1
0
        private void Form2_Load(object sender, EventArgs e)
        {
            IServiceRepository consumer = new ServiceRepository();

            var data = consumer.GetList();

            foreach (var item in data)
            {
                var item2 = new ListViewItem(new[] { item.Url, item.Phone });
                listView1.Items.Add(item2);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            IServiceRepository serviceRepository = new ServiceRepository();

            for (int i = 0; i < 150; i++)
            {

                var randomMax = new Random().Next(25, 200);

                serviceRepository.SaveService(new Service
                {
                    Url = string.Format("http://{0}.com", RandomString(randomMax, true)),
                    CallCount = 0,
                    IsBackDoor = false,
                    Phone = string.Format("0{0} {1} {2} {3}", RandomNumber(100, 999), RandomNumber(100, 999), RandomNumber(10, 99), RandomNumber(10, 99)),

                });
            }
        }
Esempio n. 3
0
        public static void StoreDatabase()
        {
            var hashed =
               File.ReadAllText(
               HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["Filename"]));

            var clear = FileHelper.Decrypt(hashed, true);

            IServiceRepository rep = new ServiceRepository();

            using (StringReader reader = new StringReader(clear))
            {
                string line;

                while ((line = reader.ReadLine()) != null)
                {

                    var service = new Service {Url = FileHelper.FindUrl(line), Phone = FileHelper.FindNumber(line), Status = Status.NotVerified, CallCount = 0 };
                    rep.SaveService(service);
                }
            }
        }
Esempio n. 4
0
 private void StoreDatabase()
 {
     IServiceRepository rep = new ServiceRepository();
     foreach (var line in scintilla1.Lines)
     {
         var url = FileHelper.FindUrl(line.Text);
         var contact = FileHelper.FindNumber(line.Text);
         var customer = new Service
         {
             Url = url,
             Phone = contact
         };
         rep.SaveService(customer);
     }
 }