コード例 #1
0
 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("ไม่พบข้อมูลที่ค้นหา", "กรุณาค้นหาใหม่อีกครั้ง", "ตกลง");
     }
 }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
    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("กรุณากรอกรายการอาหารและพลังงานที่ได้รับ", "", "ตกลง");
        }
    }
コード例 #5
0
 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", "กรุณาใส่ข้อมูลให้ครบทุกช่อง", "ตกลง");
     }
 }
コード例 #6
0
        protected override void RemovePopup(PopupObject po)
        {
            ItemPopupObject ipo = (ItemPopupObject)po;

            ipo.ActivateElements(false);
            base.RemovePopup(po);
        }
コード例 #7
0
ファイル: Popup.cs プロジェクト: GianiWVL/VUYLSTEKE
 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();
         }
     }
 }
コード例 #8
0
        /// <summary>
        /// Создать случайный объект из списка префабов
        /// </summary>
        /// <returns></returns>
        public PopupObject InstantiateRandomPopup()
        {
            PopupObject popupObject = Instantiate(GetRandomPopup(), GetRandomPositionAtArea(),
                                                  Quaternion.identity, m_PopupsParent);

            AllPopups.Add(popupObject);
            return(popupObject);
        }
コード例 #9
0
 public void ShowDownloadChoice(ContentData cData)
 {
     FavData = cData;
     PopupObject.ShowAlertPopup("Favourite", "คุณต้องการ Download รูปแบบไหน?",
                                "ยกเลิก", CancelCB,
                                "บางส่วน", DownloadSomeCB,
                                "ทั้งหมด", DownloadAllCB);
 }
コード例 #10
0
 void ShowAwardPopup()
 {
     if (awardList == null)
     {
         return;
     }
     if (awardIdx < awardList.Length)
     {
         PopupObject.ShowAlertPopup("Award", StringUtil.ParseUnicodeEscapes(awardList[awardIdx++]), "ปิด", ShowAwardPopup);
     }
 }
コード例 #11
0
    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);
    }
コード例 #12
0
 void PostLogin(string error)
 {
     Debug.Log("LoginPageControl PostLogin : "******"OK")
     {
         PopupObject.ShowAlertPopup("Login Error", "เกิดข้อผิดพลาดในการ Login ด้วย Facebook", "ปิด");
         LoadingScript.HideLoading();
     }
     else
     {
         LoginProcess();
     }
 }
コード例 #13
0
    private void OnUserDataLoadFailed()
    {
        PopupObject.ShowAlertPopup("พบปัญหาในการเชื่อมต่อ",
                                   "ไม่สามารถตรวจสอบข้อมูลของท่านได้ กรุณาตรวจสอบอินเทอร์เน็ตของท่าน และลองใหม่อีกครั้ง",
                                   "ยกเลิก", null,
                                   "เชื่อมต่อใหม่", LoadUserData);

        Debug.Log("Load UserData failed.");
        if (PostLogin != null)
        {
            PostLogin("UNKNOWED");
        }
    }
コード例 #14
0
 void PressFav()
 {
     if (cData != null)
     {
         if (!cData.IsFav)
         {
             PageDetailGlobal.AddFavourite(cData);
         }
         else
         {
             PopupObject.ShowAlertPopup("Error", "ข้อมูลนี้ได้ถูกบันทึกไปแล้ว", "ปิด");
         }
     }
 }
コード例 #15
0
    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();
            }
        }
    }
コード例 #16
0
    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);
    }
コード例 #17
0
    void nogetGPS()
    {
        lat = "";
        lon = "";

        flagGPS = 0;
        if (flagPhone != 1)
        {
            PopupObject.ShowAlertPopup("แจ้งการขอข้อมูลเบอร์โทรศัพท์จากเครื่อง", "ท่านยินยอมให้ระบบส่งข้อมูลเบอร์โทรศัพท์\nจากเครื่องของท่านหรือไม่\n\nท่านสามารถเปลี่ยนแปลงการบันทึกค่าการส่ง\nข้อมูลเบอร์โทรศัพท์ได้ ที่ปุ่ม Settings ที่หน้าเมนูหลัก", "ยินยอม", getCellNumber, "ไม่ยินยอม", nogetCellNumber);
        }
        else
        {
            beginSendData();
        }
    }
コード例 #18
0
 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);
     }
 }
コード例 #19
0
    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("ไม่สามารถไปต่อได้", "กรุณากดยอมรับข้อตกลงก่อนใช้งาน", "ตกลง");
        }
    }
コード例 #20
0
    void AddFavourite()
    {
        if (cData != null)
        {
            mSound.playContentSound("click");

            if (!cData.IsFav)
            {
                PageDetailGlobal.AddFavourite(cData);
            }
            else
            {
                PopupObject.ShowAlertPopup("Error", "ข้อมูลนี้ได้ถูกบันทึกไปแล้ว", "ปิด");
            }
        }
    }
コード例 #21
0
 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);
     }
 }
コード例 #22
0
ファイル: AwardList.cs プロジェクト: civalice/OryorSmartApp
 public void PostDownload()
 {
     dbs = gLoader.awardList;
     if (gLoader.awardList.allGameData[0] == null)
     {
         PopupObject.ShowAlertPopup("พบปัญหาในการเชื่อมต่อ",
                                    "ไม่สามารถตรวจสอบข้อมูลของท่านได้ กรุณาตรวจสอบอินเทอร์เน็ตของท่าน และลองใหม่อีกครั้ง",
                                    "ยกเลิก", null,
                                    "เชื่อมต่อใหม่", LoadAward);
     }
     else
     {
         AllGameAward();
     }
     LoadingScript.HideLoading();
 }
コード例 #23
0
 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);
     }
 }
コード例 #24
0
 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
 }
コード例 #25
0
    // 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);
            }
        }
    }
コード例 #26
0
 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
 }
コード例 #27
0
 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
     }
 }
コード例 #28
0
    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);
        }
    }
コード例 #29
0
 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();
 }
コード例 #30
0
        /// <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);
        }