IEnumerator Start() { Connection = GameObject.Find("InternetManager").GetComponent <CheckInternetConnection>(); Default(); string path = Application.persistentDataPath + "/BookmarkWord.txt"; if (!File.Exists(path)) { if (Connection.IsConnected) { WWWForm form = new WWWForm(); form.AddField("user", PlayerPrefs.GetString("usernameKey").ToString()); WWW www = new WWW("http://192.168.7.92/readBookmark.php", form); yield return(www); Word = www.text.Split(';'); File.WriteAllText(path, www.text); } } else { Word = File.ReadAllText(path).Split(';'); } }
/// <summary> /// In this event we check internet connection is available or not and according to /// this we display image indicator, if internet connection is not there then /// it will display red image and if internet connection is there then it will display green image. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TM1_Tick(object sender, EventArgs e) { if (CheckInternetConnection.CheckNet() == true) { PBimgRed.Visible = false; NetConnectionChecker.Connection = true; if (PBimggreen.Visible == true) { PBimggreen.Visible = false; } else { PBimggreen.Visible = true; } } else { NetConnectionChecker.Connection = false; PBimggreen.Visible = false; if (PBimgRed.Visible == true) { PBimgRed.Visible = false; } else { PBimgRed.Visible = true; } } }
public AddProduct() { try { InitializeComponent(); if (CheckInternetConnection.CheckNet() == true) { NetConnectionChecker.Connection = true; } else { NetConnectionChecker.Connection = false; } ProductBL = new ProductBL(new ProductConcrete()); DGData.DataSource = ProductBL.GetData(ShareObject.CLientIDToken); DGData.AllowUserToAddRows = false; DGData.ReadOnly = true; lblStatus.ForeColor = Color.Black; } catch (Exception) { throw; } }
void Start() { form = new WWWForm(); wordlist.AddRange(Arr_word.Word); Connection = GameObject.Find("InternetManager").GetComponent <CheckInternetConnection>(); Word = GameObject.Find("Script Manager").GetComponent <PronunciationFunction>(); }
IEnumerator Start() { Connection = GameObject.Find("InternetManager").GetComponent <CheckInternetConnection>(); loading.SetActive(true); string path = Application.persistentDataPath + "/" + SceneManager.GetActiveScene().name + ".txt"; if (Connection.IsConnected) { if (!File.Exists(path)) { File.WriteAllText(path, ""); WWWForm form = new WWWForm(); WWW words; form.AddField("userName", PlayerPrefs.GetString("usernameKey").ToString()); words = new WWW("http://192.168.7.92/readVocabularyOnly.php", form); yield return(words); Debug.Log("Complete"); RawString = words.text; Debug.Log(RawString); Word = RawString.Split(';'); for (i = 0; i < Word.Length - 1; i++) { File.AppendAllText(path, Word[i] + "\n"); } Debug.Log("Success"); } else { Debug.Log("Local"); Word = File.ReadAllText(path).Split('\n'); } GetComponent <CorrectWordFilter>().enabled = true; } else { if (!File.Exists(path)) { loading.SetActive(false); } else { Word = File.ReadAllText(path).Split('\n'); } } loading.SetActive(false); GetComponent <Understood>().enabled = true; }
IEnumerator Start() { Connection = GameObject.Find("InternetManager").GetComponent <CheckInternetConnection>(); LoadingPanel.SetActive(true); form = new WWWForm(); form.AddField("userName", PlayerPrefs.GetString("usernameKey").ToString()); if (SceneManager.GetActiveScene().name == "MainScene") { TextAsset SceneFile = (TextAsset)Resources.Load("SceneName"); Word = SceneFile.text.Split(';'); for (int i = 0; i < Word.Length - 1; i++) { InstantiateCard(i); } } else if (SceneManager.GetActiveScene().name == "Recommend") { string path = Application.persistentDataPath + "/RecommendScene.txt"; if (Connection.IsConnected) { WWW words = new WWW("http://192.168.7.92/readTempScene.php", form); yield return(words); if (!File.Exists(path)) { DownloadData(path, words); } else { DownloadData(path, words); } } else { LoadData(path); } } else if (SceneManager.GetActiveScene().name == "Completed") { WWW words = new WWW("http://192.168.7.92/completedScene.php", form); yield return(words); RawString = words.text; Debug.Log(RawString); Word = RawString.Split(';'); for (int i = 0; i < Word.Length - 1; i++) { InstantiateCard(i); } } LoadingPanel.SetActive(false); }
void Awake() { instance = this; noInternet = transform.Find("AnimationHolderGlavni/AnimationHolder/NoInternetPopup/Text/NoInternet").GetComponent <TextMesh>(); checkConnection = transform.Find("AnimationHolderGlavni/AnimationHolder/NoInternetPopup/Text/CheckConnection").GetComponent <TextMesh>(); checkOK = transform.Find("AnimationHolderGlavni/AnimationHolder/NoInternetPopup/Button_CheckOK/Text").GetComponent <TextMesh>(); loading = transform.Find("AnimationHolderGlavni/Loading Buffer HOLDER/Loading").GetComponent <Animator>(); pomCollider = transform.Find("AnimationHolderGlavni/PomocniColliderKodProveravanjaKonekcije"); loadingHolder = transform.Find("AnimationHolderGlavni/Loading Buffer HOLDER"); }
void Start() { Connection = GameObject.Find("InternetManager").GetComponent <CheckInternetConnection>(); form = new WWWForm(); if (Connection.IsConnected) { StartCoroutine(FetchUndWord()); } }
// Initialize levels void Awake() { // Stop this game object from being Destroyed when the scene loads if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != null) { Destroy(gameObject); } }
void Awake() { transform.SetParent(null); if (Instance != null) { Destroy(transform.root.gameObject); return; } else { DontDestroyOnLoad(transform.root.gameObject); Instance = this; } //Nella build togli sempre il debugMode if (!Application.isEditor) { debugMode = false; } Level = SceneManager.GetActiveScene().buildIndex; checkInternetConnection = FindObjectOfType <CheckInternetConnection>(); mainMenu = FindObjectOfType <MainMenu>(); MasterAudioSource = GetComponent <AudioSource>(); Screen.sleepTimeout = (int)0f; Screen.sleepTimeout = SleepTimeout.NeverSleep; SceneManager.sceneLoaded += OnSceneWasLoaded; MasterAudioSource.priority = 256; ReadLanguage(); Advertisement.Initialize(gameId); //Questo awake viene eseguito solo all'inizio e se non si tratta del livello menu //vuol dire che è stato caricato un livello senza menu //dunque, siamo in editor, segno il developmentMode come vero if (!Level.Equals(1)) { developmentMode = true; } }
private void dispatcherTimerSendReport_Tick(object sender, EventArgs e) { var currentTime = DateTime.Now; if (currentTime.Hour == createReportHour && currentTime.Minute == createReportMinute && currentTime.Second == createReportSecond) { var storingReportPerDateList = new List <StoringModel>(); storingReportPerDateList = StoringController.SelectByDate(DateTime.Now, account.UserName); if (storingReportPerDateList.Count > 0) { // Send Email mailAddressReceiveMessageList = MailAddressReceiveMessageController.Get(); foreach (MailAddressReceiveMessageModel mailAddressReceiveMessage in mailAddressReceiveMessageList) { MailAddress mailAddressReceive = new MailAddress(mailAddressReceiveMessage.MailAddress, mailAddressReceiveMessage.Name); mailMessage.To.Add(mailAddressReceive); } string mailHeader = @"<html><table border='1' style='width:75%'> <tr><td style='width:20%'>ProductNo</td><td style='width:15%'>Total</td><td style='width:15%'>Inputted</td><td style='width:15%'>Total Inputted</td><td style='width:15%'>Balance</td><td style='width:20%'>Location</td></tr>"; string mailBody = ""; foreach (var productNo in storingReportPerDateList.Select(s => s.ProductNo).Distinct().ToList()) { //int total = storingTempList.Where(w => w.ProductNo == productNo).Select(s => s.CartonNo).Max(); int total = CartonNumberingDetailController.Select(productNo).Select(s => s.CartonNo).Max(); int inputted = storingReportPerDateList.Where(w => w.ProductNo == productNo && w.IsPass == true && w.IsComplete == true).Count(); //int totalInputed = storingCurrentList.Where(w => w.StoringModel.ProductNo == productNo && w.StoringModel.IsPass == true && w.StoringModel.IsComplete == true).Count(); int totalInputted = StoringController.SelectPerPO(productNo).Where(w => w.IsPass == true && w.IsComplete == true).Count(); int balance = total - totalInputted; mailBody += string.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td>{5}</td></tr>", productNo, total, inputted, totalInputted, balance, electricScaleProfile.Location); } mailMessage.Body = mailHeader + mailBody + "</table></html>"; if (flagSending == false && mailMessage.To.Count > 0 && CheckInternetConnection.CheckConnection() == true) { smtpClient.SendAsync(mailMessage, mailMessage); flagSending = true; MessageBox.Show(String.Format("Đã gửi report ngày: {0:dd/MM/yyyy HH:mm:ss}", DateTime.Now), "Infor", MessageBoxButton.OK, MessageBoxImage.Information); } } } }
public Login() { InitializeComponent(); LoginBL = new LoginBL(new LoginConcrete()); if (CheckInternetConnection.CheckNet() == true) { NetConnectionChecker.Connection = true; } else { NetConnectionChecker.Connection = false; } _ManageDBBL = new ManageDBBL(new ManageDBConcrete()); #region UnComment this part only to create New Database and Tables _ManageDBBL.CreateSqlLiteDatabaseBL(); //_ManageDBBL.SetpasswordBL(); //_ManageDBBL.ChangepasswordBL(); _ManageDBBL.RemovepasswordBL(); _ManageDBBL.CreatetbproductBL(); _ManageDBBL.Createt_Login_TableBL(); #endregion }
public IActionResult Login(CredentialsViewModel c) { var checkInternetConnection = CheckInternetConnection.CheckConnection(); if (checkInternetConnection == false) { ViewBag.internet = checkInternetConnection; return(View()); } var stringJson = JsonConvert.SerializeObject(c); var rJson = JObject.Parse(stringJson); var returntype = _homecredentials.LoginCredentials(rJson); var succeed = returntype["Succeed"].Value <Boolean>(); if (succeed == false) { ViewBag.succeed = succeed; return(View()); } return(RedirectToAction("Index", "Rooms")); }
public async Task RunCounter(CancellationToken token) { int i = 0; stopwatch = new Stopwatch(); servicePosition = new PositionService(); IConnection = new CheckInternetConnection(); int? minPosAnterior = null; string msgPos = string.Empty; String msgWithOutInternet = string.Empty; await Task.Run(async() => { while (true) { token.ThrowIfCancellationRequested(); if (!stopwatch.IsRunning) { stopwatch.Start(); Device.StartTimer(TimeSpan.FromMilliseconds(100), () => { TimeSpan ts = stopwatch.Elapsed; String timer = String.Format("{0:00}:{1:00}:{2:00}", ts.Hours, ts.Minutes, ts.Seconds); var tmessage = "TickedMessage"; if (token.IsCancellationRequested == true) { stopwatch.Stop(); timer = "00:00:00"; stopwatch.Reset(); tmessage = "CancelledMessage"; } var message = new TickedMessage(); message.Message = "|" + timer + "|"; if (minPosAnterior != null && minPosAnterior != ts.Minutes) { Boolean HasInternet = IConnection.HasInternetConnection(); if (HasInternet) { i++; //Save position Task taskPosition = new Task(() => servicePosition.SetPosition()); taskPosition.Start(); msgWithOutInternet = string.Empty; } else { msgWithOutInternet = "Rastreamento não está sendo realizado por falta de internet."; } if (i == 1) { msgPos = " posição rastreada."; } else { msgPos = " posições rastreadas."; } } message.Message = i.ToString() + msgPos + "|" + timer + "|" + msgWithOutInternet; minPosAnterior = ts.Minutes; Device.BeginInvokeOnMainThread(() => { MessagingCenter.Send <TickedMessage>(message, tmessage); }); if (!stopwatch.IsRunning) { return(false); } { return(true); } }); } //return false; } }, token); }
void Start() { form = new WWWForm(); Connection = GameObject.Find("InternetManager").GetComponent <CheckInternetConnection>(); }
private void bwInsertAndSendEmail_DoWork(object sender, DoWorkEventArgs e) { // Send Email mailAddressReceiveMessageList = MailAddressReceiveMessageController.Get(); foreach (MailAddressReceiveMessageModel mailAddressReceiveMessage in mailAddressReceiveMessageList) { MailAddress mailAddressReceive = new MailAddress(mailAddressReceiveMessage.MailAddress, mailAddressReceiveMessage.Name); mailMessage.To.Add(mailAddressReceive); } string reason = ""; reason = issuesList.Where(w => w.IssuesId == issuesId).Select(s => s.IssuesName).FirstOrDefault().ToString(); string mailBody = ""; // OUTPUT PROMBLEM if (receiveOutputModel != null) { mode = 1; receiveOutputModel.IssuesId = issuesId; // InsertDB if (OutputingController.Insert(receiveOutputModel) == false) { MessageBox.Show("Insert Error!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } //CreatedLog string logBodyOldCarton = "Production No.: {0}, Size No.: {1}, Carton No.: {2}, Gross Weight: {3}kg, Actual Weight: {4}kg, Difference Percent: {5}%, Created By: {6}, Reason :{7}, Location {8}"; LogHelper.CreateOutputLog(string.Format(logBodyOldCarton, receiveOutputModel.ProductNo, receiveOutputModel.SizeNo, receiveOutputModel.CartonNo, receiveOutputModel.GrossWeight, receiveOutputModel.ActualWeight, receiveOutputModel.DifferencePercent, findControlAccountModel.FullName, reason, electricScaleProfile.Location)); // Created Email mailBody = @"<html><table border='1' style='width:100%'> <tr><td>ProductNo</td><td>SizeNo</td><td>CartonNo</td><td>Gross Weight</td><td>Actual Weight</td><td>Difference Percent</td><td>Check By</td><td>Location</td><td>Reason</td></tr> <tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3} kg</td><td>{4} kg</td><td>{5} %</td><td>{6}</td><td>{7}</td><td>{8}</td></tr> </table></html>"; //string logBody = "Production No.:{0} Size No.:{1} Carton No.:{2} Gross Weight:{3}kg Actual Weight: {4}kg Difference Percent:{5}% Check by:{6} Reason:{7}"; mailMessage.Subject = string.Format("STORING SYSTEM - OUTPUT PROMBLEM"); mailMessage.Body = string.Format(mailBody, receiveOutputModel.ProductNo, receiveOutputModel.SizeNo, receiveOutputModel.CartonNo, receiveOutputModel.GrossWeight, receiveOutputModel.ActualWeight, receiveOutputModel.DifferencePercent, findControlAccountModel.FullName, electricScaleProfile.Location, reason); outputingCurrent = receiveOutputModel; } // INPUT PROBLEM if (receiveStoringModel != null) { mode = 2; receiveStoringModel.IssuesId = issuesId; if (StoringController.Insert(receiveStoringModel) == false) { MessageBox.Show("Insert Error!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } if (issuesType == IssuesType.Issues.IssuesFirstCartonOfSizeOfPO) { mailBody = @"<html><table border='1' style='width:100%'> <tr><td>ProductNo</td><td>SizeNo</td><td>CartonNo</td><td>Check By</td><td>Location</td><td>Reason</td></tr> <tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td>{5}</td></tr> </table></html>"; mailMessage.Body = string.Format(mailBody, receiveStoringModel.ProductNo, receiveStoringModel.SizeNo, receiveStoringModel.CartonNo, findControlAccountModel.FullName, electricScaleProfile.Location, reason); //string logBody = "Production No.:{0} Size No.:{1} Carton No.:{2} Gross Weight:{3}kg Actual Weight: {4}kg Difference Percent:{5}% Check by:{6} Reason:{7}"; mailMessage.Subject = string.Format("STORING SYSTEM - INPUT PROBLEM - FIRST CARTON"); } if (issuesType == IssuesType.Issues.IssuesCompareWeight) { mailBody = @"<html><table border='1' style='width:100%'> <tr><td>ProductNo</td><td>SizeNo</td><td>CartonNo</td><td>Gross Weight</td><td>Actual Weight</td><td>Difference Percent</td><td>Check By</td><td>Location</td><td>Reason</td></tr> <tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3} kg</td><td>{4} kg</td><td>{5} %</td><td>{6}</td><td>{7}</td><td>{8}</td></tr> </table></html>"; //string logBody = "Production No.:{0} Size No.:{1} Carton No.:{2} Gross Weight:{3}kg Actual Weight: {4}kg Difference Percent:{5}% Check by:{6} Reason:{7}"; mailMessage.Subject = string.Format("STORING SYSTEM - INPUT PROMBLEM - WEIGHT"); mailMessage.Body = string.Format(mailBody, receiveStoringModel.ProductNo, receiveStoringModel.SizeNo, receiveStoringModel.CartonNo, receiveStoringModel.GrossWeight, receiveStoringModel.ActualWeight, receiveStoringModel.DifferencePercent, findControlAccountModel.FullName, electricScaleProfile.Location, reason); string logBodyOldCarton = "Production No.: {0}, Size No.: {1}, Carton No.: {2}, Gross Weight: {3}kg, Actual Weight: {4}kg, Difference Percent: {5}%, Created By: {6}, Reason :{7}, Location {8}"; LogHelper.CreateIssuesLog(string.Format(logBodyOldCarton, receiveStoringModel.ProductNo, receiveStoringModel.SizeNo, receiveStoringModel.CartonNo, receiveStoringModel.GrossWeight, receiveStoringModel.ActualWeight, receiveStoringModel.DifferencePercent, findControlAccountModel.FullName, reason, electricScaleProfile.Location)); } storingCurrent = receiveStoringModel; } if (flagSending == false && mailMessage.To.Count > 0) { if (CheckInternetConnection.CheckConnection() == false) { MessageBox.Show("Không có kết nối Internet!\nNo Internet Connection!", "Info", MessageBoxButton.OK, MessageBoxImage.Warning); return; } smtpClient.SendAsync(mailMessage, mailMessage); flagSending = true; MessageBox.Show("Đã gửi Email!\nSent Email!", "Info", MessageBoxButton.OK, MessageBoxImage.Information); } }