void FinishDownload() { if (xmlData.contentList.Length > 0) { for (int i = 0; i < xmlData.contentList.Length; i++) { GameObject dtx = new GameObject("DownloadedTex" + i); DownloadedTexture dtxComp = dtx.AddComponent <DownloadedTexture> (); dtx.transform.parent = this.transform; dtxComp.StartDownload(xmlData.contentList [i].imgthumbnail); mDownloadTexList.Add(dtxComp); } int nextPageSize = Mathf.CeilToInt((float)xmlData.maxPage / PageDetailGlobal.pGlobal.MaxContentPerPage); if (nextPageSize != CurrentPageSize) { CurrentPageSize = nextPageSize; FooterBar.ClearPaging(); FooterBar.CreatePaging(CurrentPageSize); } ShelfDetail.CreateShelfItem(xmlData.contentList, mDownloadTexList, FooterBar.IsFirstPage(), FooterBar.IsLastPage()); FullListDetail.CreateItemDetail(xmlData.contentList, mDownloadTexList); } else { Indecator.SetActive(false); PopupObject.ShowAlertPopup("ไม่พบข้อมูลที่ค้นหา", "กรุณาค้นหาใหม่อีกครั้ง", "ตกลง"); } }
public bool Remove(PopupObject popup) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "Popup_DELETE", CreateParameter("@popupID", SqlDbType.UniqueIdentifier, popup.PopupID, ParameterDirection.Input) ); return(true); } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void Save(PopupObject popup) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "Popup_SAVE", CreateParameter("@popupID", SqlDbType.UniqueIdentifier, popup.PopupID, ParameterDirection.InputOutput), CreateParameter("@Description", SqlDbType.NVarChar, popup.Description), CreateParameter("@Repeat", SqlDbType.Int, popup.Repeation), CreateParameter("@Active", SqlDbType.Bit, popup.Active), CreateParameter("@CreationDate", SqlDbType.VarChar, popup.CreationDate), CreateParameter("@Time", SqlDbType.VarChar, popup.Time), CreateParameter("@ShowDirect", SqlDbType.Bit, popup.ShowDirect) ); popup.PopupID = (Guid)cmd.Parameters["@popupID"].Value; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void AddData() { //Debug.Log("Add Data"); if (AddFoodName.text != "" && AddFoodCal.text != "") { AddPage.SetActive(false); MainPage.SetActive(true); SelectedFood.FoodName = AddFoodName.text; SelectedFood.reciveCal = int.Parse(AddFoodCal.text); // SelectedFood.saveDate = DateTime.Now; if (!IsEditMode) { AddBT.SetActive(true); EditBT.SetActive(false); IsEditMode = false; cme.DataFoodList.Add(SelectedFood); cme.AddToListData(); } else { AddBT.SetActive(true); EditBT.SetActive(false); IsEditMode = false; Debug.Log(editFood.FoodName + " " + editPos); cme.editToListData(editFood, editPos); } } else { PopupObject.ShowAlertPopup("กรุณากรอกรายการอาหารและพลังงานที่ได้รับ", "", "ตกลง"); } }
void submitData() { //check all attribute first //PopupObject.Button1.OnReleased += getGPS; //PopupObject.Button2.OnReleased += nogetGPS; if ((name.text != "") && (email.text != "") && (Tel.text != "") && (Detail.text != "")) { if (flagGPS != 1) { PopupObject.ShowAlertPopup("แจ้งการขอข้อมูลพิกัดที่อยู่ปัจจุบัน", "ท่านยินยอมให้ระบบส่งพิกัดปัจจุบันของท่านหรือไม่ \n\nท่านสามารถเปลี่ยนแปลงการบันทึกค่าการส่ง\nพิกัดได้ ที่ปุ่ม Settings ที่หน้าเมนูหลัก", "ยินยอม", getGPS, "ไม่ยินยอม", nogetGPS); } else if (flagPhone != 1) { PopupObject.ShowAlertPopup("แจ้งการขอข้อมูลเบอร์โทรศัพท์จากเครื่อง", "ท่านยินยอมให้ระบบส่งข้อมูลเบอร์โทรศัพท์\nจากเครื่องของท่านหรือไม่\n\nท่านสามารถเปลี่ยนแปลงการบันทึกค่าการส่ง\nข้อมูลเบอร์โทรศัพท์ได้ ที่ปุ่ม Settings ที่หน้าเมนูหลัก", "ยินยอม", getCellNumber, "ไม่ยินยอม", nogetCellNumber); } else { beginSendData(); } } else { PopupObject.ShowAlertPopup("Error", "กรุณาใส่ข้อมูลให้ครบทุกช่อง", "ตกลง"); } }
protected override void RemovePopup(PopupObject po) { ItemPopupObject ipo = (ItemPopupObject)po; ipo.ActivateElements(false); base.RemovePopup(po); }
public void Remove(PopupObject popup) { try { CheckTransaction(); new PopupDataService().Remove(popup); if (popup.PopupUsers != null) { new PopupUserDataService().RemoveAllByPopup(popup); } if (IsOwner) { Transaction.Commit(); } } catch (Exception exception1) { if (IsOwner) { Transaction.Rollback(); } Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) { Connection.Close(); } } }
/// <summary> /// Создать случайный объект из списка префабов /// </summary> /// <returns></returns> public PopupObject InstantiateRandomPopup() { PopupObject popupObject = Instantiate(GetRandomPopup(), GetRandomPositionAtArea(), Quaternion.identity, m_PopupsParent); AllPopups.Add(popupObject); return(popupObject); }
public void ShowDownloadChoice(ContentData cData) { FavData = cData; PopupObject.ShowAlertPopup("Favourite", "คุณต้องการ Download รูปแบบไหน?", "ยกเลิก", CancelCB, "บางส่วน", DownloadSomeCB, "ทั้งหมด", DownloadAllCB); }
void ShowAwardPopup() { if (awardList == null) { return; } if (awardIdx < awardList.Length) { PopupObject.ShowAlertPopup("Award", StringUtil.ParseUnicodeEscapes(awardList[awardIdx++]), "ปิด", ShowAwardPopup); } }
protected float GetTargetHeight(PopupObject po) { float count = 0f; for (int i = 0; i < po.ID; i++) { PopupObject other = GetActivePopupWithID(i); count += other.Height; } return(count); }
void PostLogin(string error) { Debug.Log("LoginPageControl PostLogin : "******"OK") { PopupObject.ShowAlertPopup("Login Error", "เกิดข้อผิดพลาดในการ Login ด้วย Facebook", "ปิด"); LoadingScript.HideLoading(); } else { LoginProcess(); } }
private void OnUserDataLoadFailed() { PopupObject.ShowAlertPopup("พบปัญหาในการเชื่อมต่อ", "ไม่สามารถตรวจสอบข้อมูลของท่านได้ กรุณาตรวจสอบอินเทอร์เน็ตของท่าน และลองใหม่อีกครั้ง", "ยกเลิก", null, "เชื่อมต่อใหม่", LoadUserData); Debug.Log("Load UserData failed."); if (PostLogin != null) { PostLogin("UNKNOWED"); } }
void PressFav() { if (cData != null) { if (!cData.IsFav) { PageDetailGlobal.AddFavourite(cData); } else { PopupObject.ShowAlertPopup("Error", "ข้อมูลนี้ได้ถูกบันทึกไปแล้ว", "ปิด"); } } }
public IEnumerator DownloadJSON(string url) { WWWForm form = new WWWForm(); Debug.Log("Search " + rtype + ", " + rnumber + ", " + UserCommonData.pGlobal.user.user_id); form.AddField("user_id", UserCommonData.pGlobal.user.user_id); form.AddField("code", rnumber); www = new WWW(url, form); Debug.Log("Start Download JSON Register : " + url); yield return(new WaitForSeconds(3f)); while (!www.isDone) { yield return(null); } yield return(www); /* EDIT: */ if (!string.IsNullOrEmpty(www.error)) { PopupObject.ShowAlertPopup("พบปัญหาในการเชื่อมต่อ", "ไม่สามารถลงทะเบียนได้ กรุณาตรวจสอบอินเทอร์เน็ตของท่าน และลองใหม่อีกครั้ง", "ตกลง", null); Debug.LogWarning("LOCAL FILE ERROR: " + www.error); } else { //JSONObject j = new JSONObject(www.text); Debug.Log(www.text); if (www.text != null) { resultRegis = www.text; } else { resultRegis = "0"; } isFinish = true; OryorActivityData data = new OryorActivityData(); data.result = www.text; Debug.Log("Register Activity Result " + rtype + " : " + data.result); contentList = data; if (postDownloaded != null) { Debug.Log("postDownloaded"); postDownloaded(); } } }
protected void ActivatePopup(PopupObject po) { if (activePopups.Contains(po) || !inactivePopups.Contains(po)) { return; } foreach (PopupObject activePo in activePopups) { activePo.ID++; } po.ID = 0; activePopups.Add(po); inactivePopups.Remove(po); }
void nogetGPS() { lat = ""; lon = ""; flagGPS = 0; if (flagPhone != 1) { PopupObject.ShowAlertPopup("แจ้งการขอข้อมูลเบอร์โทรศัพท์จากเครื่อง", "ท่านยินยอมให้ระบบส่งข้อมูลเบอร์โทรศัพท์\nจากเครื่องของท่านหรือไม่\n\nท่านสามารถเปลี่ยนแปลงการบันทึกค่าการส่ง\nข้อมูลเบอร์โทรศัพท์ได้ ที่ปุ่ม Settings ที่หน้าเมนูหลัก", "ยินยอม", getCellNumber, "ไม่ยินยอม", nogetCellNumber); } else { beginSendData(); } }
public void RemoveAllByPopup(PopupObject popup) { try { foreach (PopupUserObject popupUser in popup.PopupUsers) { Remove(popupUser); } } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
void AcceptLicense() { if (IsTickAccept) { UserCommonData.SetAG(true); // AgreementDrag.onAcceptLicense = false; // StopCoroutine ("Popout"); // StartCoroutine ("Popout");this.gameObject.SetActive(false); this.gameObject.SetActive(false); } else { PopupObject.ShowAlertPopup("ไม่สามารถไปต่อได้", "กรุณากดยอมรับข้อตกลงก่อนใช้งาน", "ตกลง"); } }
void AddFavourite() { if (cData != null) { mSound.playContentSound("click"); if (!cData.IsFav) { PageDetailGlobal.AddFavourite(cData); } else { PopupObject.ShowAlertPopup("Error", "ข้อมูลนี้ได้ถูกบันทึกไปแล้ว", "ปิด"); } } }
private void gdvPopups_DoubleClick(object sender, EventArgs e) { try { GridView view = (GridView)sender; PopupObject popupObj = (PopupObject)view.GetRow(view.FocusedRowHandle); Popup popup = new Popup(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, popupObj); popup.ShowDialog(); FindAll(); } catch (System.Exception excepion1) { System.Exception thisException = excepion1; Management.ShowException(thisException); } }
public void PostDownload() { dbs = gLoader.awardList; if (gLoader.awardList.allGameData[0] == null) { PopupObject.ShowAlertPopup("พบปัญหาในการเชื่อมต่อ", "ไม่สามารถตรวจสอบข้อมูลของท่านได้ กรุณาตรวจสอบอินเทอร์เน็ตของท่าน และลองใหม่อีกครั้ง", "ยกเลิก", null, "เชื่อมต่อใหม่", LoadAward); } else { AllGameAward(); } LoadingScript.HideLoading(); }
void PostLoginFB(string Error) { if (Error == "OK") { UserCommonData.IsFBLogin = true; UserCommonData.pGlobal.Save(); PopupObject.ShowAlertPopup("Login Success", "Login สำเร็จ", "ปิด", LoadRank); } else { PopupObject.ShowAlertPopup("Facebook Error", "ไม่สามารถนำรายชื่อเพื่อนจาก Facebook ได้ กรุณา Login ผ่าน Facebook ก่อน", "ปิด", CloseRanking, "Login", LoginFB); } }
void GetFriendCB(string Error) { FriendIsDone = true; #if UNITY_WINRT Debug.Log("getFrendCB"); if (Error != null) { Loading(Error); } else { GetFriendClose(); } #else if (Error == "OK") { FriendIsDone = true; int i = 0; string friendString = ""; foreach (FB_UserInfo friend in FacebookLogin.pGlobal.mFriendList) { if (i != 0) { friendString += ","; } friendString += friend.Id; i++; } Loading(friendString); } else if (Error == "NOAUTH") { //no login //close and popup menu to ask to login GetFriendClose(); } else { //Unknowed error PopupObject.ShowAlertPopup("Facebook Error", "มีปัญหาจากการเชื่อมต่อกับ Facebook เชื่อมต่ออีกครั้งหรือไม่?", "ปิด", GetFriendClose, "ลองใหม่", GetFriendList); } #endif }
// Update is called once per frame void Update() { bool touchedDown = TouchInterface.GetTouchDown(); bool touchedUp = TouchInterface.GetTouchUp(); Vector2 touchPos = TouchInterface.GetTouchPosition(); if (touchedDown) { if (this.GetComponent <Collider2D>().OverlapPoint(touchPos)) { //run event here PopupObject.ShowAlertPopup(HeaderText, DetailText, ButtonText); // StopCoroutine("TestTiming"); // StartCoroutine("TestTiming"); // PopupObject.ShowWaitingPopup(HeaderText,"Cancel",ProgressCB,Cancel); } } }
public void DownloadSomeCB() { if (!pGlobal.file.AddContentToFile(FavData, false)) { PopupObject.ShowAlertPopup("Error", "ข้อมูลนี้ได้ถูกบันทึกไปแล้ว", "ปิด"); } else { state = DetailState.DS_WAITING; pGlobal.StartLoading(); } #if !UNITY_WEBGL && !DISABLE_WEBVIEW if (pGlobal.pchk) { contentPage.webviewshow(); } #endif }
void FavButtonPress() { mSound.playContentSound("click"); if (currentData != null) { #if !UNITY_WEBGL && !DISABLE_WEBVIEW webviewhide(); if (!currentData.IsFav) { PageDetailGlobal.AddFavourite(currentData, IsWeb); } else { PopupObject.ShowAlertPopup("Error", "ข้อมูลนี้ได้ถูกบันทึกไปแล้ว", "ปิด", webviewhide); } #endif } }
protected virtual void RemovePopup(PopupObject po) { if (!activePopups.Contains(po) || inactivePopups.Contains(po)) { return; } inactivePopups.Add(po); activePopups.Remove(po); int ID = po.ID; int maxID = HighestID; for (int i = ID + 1; i <= maxID; i++) { DecrementPopupsWithID(i); } }
void UpdateCB(APIMsg msg) { //done update //check msg first if (msg.msg == "OK") { //update UserCommonData and save UserCommonData.pGlobal.user = msg.user[0]; UserCommonData.pGlobal.Save(); } else { //update error PopupObject.ShowAlertPopup("Update Error", "ไม่สามารถปรับปรุงข้อมูลได้", "ปิด"); //reset data ResetUpdateDataForm(); } LoadingScript.HideLoading(); }
/// <summary> /// Получить случайный объект, с учётом вероятности его выпадения /// </summary> /// <returns>Случайный префаб из списка</returns> public PopupObject GetRandomPopup() { if (m_PopupPrefabs == null || m_PopupPrefabs.Length == 0) { return(null); } PopupObject randomPopup = null; while (randomPopup == null) { foreach (var popup in m_PopupPrefabs) { if (Random.Range(0, 100 + 1) < popup.PopupObjectAsset.PercentChance) { return(popup); } } } return(null); }