static void Main(string[] args) { var server = new TCPServer(IPAddress.Any, Constant.PortImportExcel); server.StartServer(); Console.WriteLine("Server is started"); Console.WriteLine("Type 'stop' to stop server"); Console.WriteLine("Type 'loadtoredis' to load all phone and email from database to redis"); var msg = string.Empty; while (msg != "stop") { msg = Console.ReadLine(); if (msg == "loadtoredis") { Console.WriteLine("Please waiting..."); StaticData.LoadToRedis(); Console.WriteLine("Load successfully !"); } } StaticData.ClearData(); Console.WriteLine("Server is stopping..."); Console.WriteLine("Server is stopped..."); server.StopServer(); Console.WriteLine("Press any key to exit..."); Console.ReadLine(); }
public List <List <string> > GetAppeals() { StaticData.ClearData(); fileArchiving.DecompressData(pathToZipAppeals); List <List <string> > appeals = new List <List <string> >(); List <string> appeal; XDocument xdoc = XDocument.Load(pathToAppeals); foreach (XElement currentAppeal in xdoc.Element("Appeals").Elements("Appeal")) { appeal = new List <string>(); XElement fullNameElement = currentAppeal.Element("fullName"); XElement phoneNumberElement = currentAppeal.Element("phoneNumber"); XElement dateElement = currentAppeal.Element("date"); XElement currentHourElement = currentAppeal.Element("currentHour"); XElement currentMinuteElement = currentAppeal.Element("currentMinute"); XElement statusElement = currentAppeal.Element("status"); XElement roleElement = currentAppeal.Element("role"); XElement emailElement = currentAppeal.Element("email"); XElement companyElement = currentAppeal.Element("company"); XElement appealElement = currentAppeal.Element("appeal"); XElement additionalInfoElement = currentAppeal.Element("additionalInfo"); XElement userElement = currentAppeal.Element("user"); appeal.Add(fullNameElement.Value); appeal.Add(phoneNumberElement.Value); appeal.Add(dateElement.Value); appeal.Add(currentHourElement.Value); appeal.Add(currentMinuteElement.Value); appeal.Add(statusElement.Value); appeal.Add(roleElement.Value); appeal.Add(emailElement.Value); appeal.Add(companyElement.Value); appeal.Add(appealElement.Value); appeal.Add(additionalInfoElement.Value); appeal.Add(userElement.Value); appeals.Add(appeal); FillDataUser(statusElement.Value, userElement.Value); } File.Delete(pathToAppeals); appeals.Reverse(); return(appeals); }