public static void Main(string[] args) { Stc.StartedList = new List <long>(); Encryption.Key = new byte[] { 28, 14, 79, 24, 168, 2, 142, 10, 198, 6, 89, 93, 115, 12, 253, 71, 62, 221, 55, 121, 38, 174, 6, 51, 168, 54, 2, 26, 228, 113, 32, 109 }; Encryption.Vector = new byte[] { 195, 74, 41, 17, 219, 10, 64, 41, 81, 39, 209, 165, 4, 86, 236, 88 }; Stc.ReadConfigs(); //Reads app.config file Business.Stc.ConnStr = Stc.ConnStr; // Dictionaries Business.Dictionary.DictionaryBusiness dictionaryBusiness = new Business.Dictionary.DictionaryBusiness(); ResponseBo <List <DictionaryBo> > responseDic = dictionaryBusiness.GetList(); Business.Stc.DicItemList = responseDic.Bo.Select(x => x.ToDicItem()).ToList(); Business.Sys.SysBusiness sysBusiness = new Business.Sys.SysBusiness(); Stc.SysSmsList = sysBusiness.GetSmsList().Bo; System.Timers.Timer tmSendSms = new System.Timers.Timer(); tmSendSms.Interval = 5000; tmSendSms.Elapsed += tmSendSms_Elapsed; tmSendSms.Start(); Console.ReadKey(true); }
protected void Application_Start() { //GlobalConfiguration.Configuration.DependencyResolver = new NinjectDependencyResolver(NinjectWebCommon.CreateKernel()); Encryption.Key = new byte[] { 28, 14, 79, 24, 168, 2, 142, 10, 198, 6, 89, 93, 115, 12, 253, 71, 62, 221, 55, 121, 38, 174, 6, 51, 168, 54, 2, 26, 228, 113, 32, 109 }; Encryption.Vector = new byte[] { 195, 74, 41, 17, 219, 10, 64, 41, 81, 39, 209, 165, 4, 86, 236, 88 }; Stc.ReadConfigs(); //Reads app.config file Business.Stc.ConnStr = Stc.ConnStr; Business.Auth.AuthBusiness authBusiness = new Business.Auth.AuthBusiness(); Stc.SessionManager = new Sessions.SessionManager(); Stc.SessionManager.Init(authBusiness.GetSessionList()); // Dictionaries Business.Dictionary.DictionaryBusiness dictionaryBusiness = new Business.Dictionary.DictionaryBusiness(); ResponseBo <List <DictionaryBo> > responseDic = dictionaryBusiness.GetList(); Business.Stc.DicItemList = responseDic.Bo.Select(x => x.ToDicItem()).ToList(); // Enums Business.EnumsOp.EnumsOpBusiness enumsOpBusiness = new Business.EnumsOp.EnumsOpBusiness(); Business.Stc.EnumShopTypeList = enumsOpBusiness.GetShopTypeList().Bo; Business.Stc.EnumCurrencyList = enumsOpBusiness.GetCurrencyList().Bo; Business.Stc.EnumFicheContentList = enumsOpBusiness.GetFicheContentList().Bo; try { Ws.wsConnManager.InitAndStart(); } catch (Exception ex) { } System.Timers.Timer tm = new System.Timers.Timer(); tm.Interval = 5 * 60 * 1000; tm.Elapsed += Tm_Elapsed; tm.Start(); System.Timers.Timer tm_dic = new System.Timers.Timer(); tm_dic.Interval = 10 * 60 * 1000; tm_dic.Elapsed += TmDic_Elapsed; tm_dic.Start(); System.Timers.Timer tm_session = new System.Timers.Timer(); tm_session.Interval = 12 * 60 * 1000; tm_session.Elapsed += Tm_session_Elapsed; tm_session.Start(); GlobalConfiguration.Configure(WebApiConfig.Register); }
private void TmDic_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { try { Business.Dictionary.DictionaryBusiness dictionaryBusiness = new Business.Dictionary.DictionaryBusiness(); ResponseBo <List <DictionaryBo> > responseDic = dictionaryBusiness.GetList(); Business.Stc.DicItemList = responseDic.Bo.Select(x => x.ToDicItem()).ToList(); } catch (Exception ex) { } }
public static void Main(string[] args) { //ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones(); //string naber = timeZones[10].ToString(); IronPdf.License.LicenseKey = "IRONPDF-1EF01-118677-74BF79-A5392C3577-37E95A5C-NEx-1EF01"; Stc.StartedList = new List <long>(); Encryption.Key = new byte[] { 28, 14, 79, 24, 168, 2, 142, 10, 198, 6, 89, 93, 115, 12, 253, 71, 62, 221, 55, 121, 38, 174, 6, 51, 168, 54, 2, 26, 228, 113, 32, 109 }; Encryption.Vector = new byte[] { 195, 74, 41, 17, 219, 10, 64, 41, 81, 39, 209, 165, 4, 86, 236, 88 }; Stc.ReadConfigs(); //Reads app.config file Business.Stc.ConnStr = Stc.ConnStr; //string reportService = Encryption.DecryptString("183070049171182237226106168064219126098169172105"); //string remindService = Encryption.DecryptString("145014132246120143136238214020201124174180138135"); //string notifyService = Encryption.DecryptString("067092194112154010003231169086207040039193099010"); // Dictionaries Business.Dictionary.DictionaryBusiness dictionaryBusiness = new Business.Dictionary.DictionaryBusiness(); ResponseBo <List <DictionaryBo> > responseDic = dictionaryBusiness.GetList(); Business.Stc.DicItemList = responseDic.Bo.Select(x => x.ToDicItem()).ToList(); Business.Sys.SysBusiness sysBusiness = new Business.Sys.SysBusiness(); Stc.SysMailList = sysBusiness.GetMailList().Bo; System.Timers.Timer tmSendMail = new System.Timers.Timer(); tmSendMail.Interval = 5000; tmSendMail.Elapsed += tmSendMail_Elapsed; tmSendMail.Start(); System.Timers.Timer tmSchedule = new System.Timers.Timer(); tmSchedule.Interval = 1000; tmSchedule.Elapsed += tmSchedule_Elapsed; tmSchedule.Start(); Console.ReadKey(true); }
public static void Main(string[] args) { Encryption.Key = new byte[] { 28, 14, 79, 24, 168, 2, 142, 10, 198, 6, 89, 93, 115, 12, 253, 71, 62, 221, 55, 121, 38, 174, 6, 51, 168, 54, 2, 26, 228, 113, 32, 109 }; Encryption.Vector = new byte[] { 195, 74, 41, 17, 219, 10, 64, 41, 81, 39, 209, 165, 4, 86, 236, 88 }; Stc.ReadConfigs(); //Reads app.config file Stc.SessionManager = new Sessions.SessionManager(); Stc.SessionManager.Init(); Business.Stc.ConnStr = Stc.ConnStr; // Dictionaries Business.Dictionary.DictionaryBusiness dictionaryBusiness = new Business.Dictionary.DictionaryBusiness(); ResponseBo <List <DictionaryBo> > responseDic = dictionaryBusiness.GetList(); Business.Stc.DicItemList = responseDic.Bo.Select(x => x.ToDicItem()).ToList(); // Addresses Business.Address.AddressBusiness addressBusiness = new Business.Address.AddressBusiness(); Business.Stc.AddressCountryList = addressBusiness.GetCountryList().Bo; Business.Stc.AddressStateList = addressBusiness.GetStateList().Bo; Business.Stc.AddressCityList = addressBusiness.GetCityList().Bo; Business.Stc.AddressDistrictList = addressBusiness.GetDistrictList().Bo; // Enums Business.EnumsOp.EnumsOpBusiness enumsOpBusiness = new Business.EnumsOp.EnumsOpBusiness(); Business.Stc.EnumShopTypeList = enumsOpBusiness.GetShopTypeList().Bo; Business.Stc.EnumCurrencyList = enumsOpBusiness.GetCurrencyList().Bo; Business.Stc.EnumFicheContentList = enumsOpBusiness.GetFicheContentList().Bo; // Others Business.Product.ProductCategoryBusiness productCategoryBusiness = new Business.Product.ProductCategoryBusiness(); Business.Stc.ProductCategoryList = productCategoryBusiness.GetList().Bo; //Business.Person.RealPersonBusiness realPersonBusiness = new Business.Person.RealPersonBusiness(); //realPersonBusiness.GetRealPerson(1); //Timer tm = new Timer(Callback, null, 0, Timeout.Infinite); //var stateTimer = new Timer(statusChecker.CheckStatus, // autoEvent, 1000, 250); Stc.ws = new WebSocketServer(Stc.wsPort); Stc.ws.AddWebSocketService <Ws.MhMainPath>(Stc.wsPath); Ws.wsConnManager.Init(); System.Timers.Timer tm = new System.Timers.Timer(); tm.Interval = 5 * 60 * 1000; tm.Elapsed += Tm_Elapsed; tm.Start(); //Stc.ws.Start(); //Console.WriteLine($"Servis başlatıldı. Port :{Stc.Port} Path:{Stc.Path}"); // Start OWIN host StartOptions options = new StartOptions(); options.Urls.Add("http://localhost:9000"); options.Urls.Add("http://127.0.0.1:9000"); options.Urls.Add("http://192.168.0.102:9000"); options.Urls.Add(string.Format("http://{0}:9000", Environment.MachineName)); using (WebApp.Start <Startup>(Stc.baseAddress)) { //// Create HttpCient and make a request to api/values //HttpClient client = new HttpClient(); //var response = client.GetAsync(Stc.baseAddress + "/values").Result; //Console.WriteLine(response); //Console.WriteLine(response.Content.ReadAsStringAsync().Result); Console.WriteLine("Servis started"); Console.ReadLine(); } }