Пример #1
0
        private bool check()
        {
            string msg     = "";
            bool   isEmpty = false;


            if (string.IsNullOrEmpty(txtName.Text))
            {
                msg     = "欄位不能為空值!";
                isEmpty = true;
            }

            if (!isEmpty && !string.IsNullOrEmpty(txtIndex.Text) && txtIndex.Text != "0")
            {
                PhraseInfo view = new PhraseInfo(APConfig.Conn);
                view.Conditions  = " 1=1 ";
                view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), ddlCategory.SelectedItem.ToString());
                view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.index.ToString(), txtIndex.Text);
                if (view.calculateCount() > 0)
                {
                    msg = "排序已存在!請重新選擇!";
                }
            }

            if (!string.IsNullOrEmpty(msg))
            {
                APConfig.SweetAlert(ShowBoxType.alert, msg);
            }
            return(string.IsNullOrEmpty(msg) ? true : false);
        }
Пример #2
0
        private void phraseLoadData()
        {
            dgvPhrase.Rows.Clear();
            DataGridViewRowCollection rows = dgvPhrase.Rows;
            PhraseInfo view = new PhraseInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), ddlPhraseCategory.SelectedItem.ToString());
            if (!string.IsNullOrEmpty(txtPhraseName.Text))
            {
                view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.name.ToString(), txtPhraseName.Text);
            }
            if (!string.IsNullOrEmpty(txtPhraseType.Text))
            {
                view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.type.ToString(), txtPhraseType.Text);
            }
            if (view.load())
            {
                while (!view.IsEof)
                {
                    rows.Add(new Object[] { view.PHS_SERNO, view.PHS_NAME, view.PHS_TYPE, view.PHS_INDEX });
                    view.next();
                }
            }
            lblPhraseTotal.Text = view.calculateCount().ToString();
        }
Пример #3
0
        public void DetailPhrase(PhraseInfo _currentPhrase)
        {
            currentPhrase = _currentPhrase;
            DetailPanel.SetActive(true);

            Debug.Log("Detail Phrase :" + currentPhrase.data.Id);
            AudioManager.I.PlayPhrase(currentPhrase.data);

            //ArabicText.text = currentPhrase.data.Arabic;
            //ScoreText.text = "Score: " + currentPhrase.score;
        }
Пример #4
0
 private void initView()
 {
     if (mode == mode.Add)
     {
         btnOK.ButtonText      = "新增";
         btnOK.IdleFillColor   = Color.FromArgb(33, 166, 117);
         btnOK.IdleLineColor   = Color.FromArgb(33, 166, 117);
         btnOK.ActiveFillColor = Color.FromArgb(33, 166, 117);
         btnOK.ActiveLineColor = Color.FromArgb(33, 166, 117);
     }
     else if (mode == mode.Edit)
     {
         btnOK.ButtonText      = "修改";
         btnOK.IdleFillColor   = Color.FromArgb(255, 161, 0);
         btnOK.IdleLineColor   = Color.FromArgb(255, 161, 0);
         btnOK.ActiveFillColor = Color.FromArgb(255, 161, 0);
         btnOK.ActiveLineColor = Color.FromArgb(255, 161, 0);
         ddlCategory.Enabled   = false;
         PhraseInfo view = new PhraseInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.serno.ToString(), serno);
         if (view.load())
         {
             txtName.Text  = view.PHS_NAME;
             txtIndex.Text = view.PHS_INDEX.ToString();
             txtType.Text  = view.PHS_TYPE;
             txtColor.Text = view.PHS_COLOR;
             txtSize.Text  = view.PHS_SIZE;
             APConfig.getSelectIndex(ddlCategory, view.PHS_CATEGORY);
         }
     }
     else if (mode == mode.View)
     {
         DisableControls();
         btnOK.ButtonText = "確認";
         PhraseInfo view = new PhraseInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.serno.ToString(), serno);
         if (view.load())
         {
             txtName.Text  = view.PHS_NAME;
             txtIndex.Text = view.PHS_INDEX.ToString();
             txtType.Text  = view.PHS_TYPE;
             txtColor.Text = view.PHS_COLOR;
             txtSize.Text  = view.PHS_SIZE;
             APConfig.getSelectIndex(ddlCategory, view.PHS_CATEGORY);
         }
     }
 }
Пример #5
0
        public void DetailPhrase(PhraseInfo info)
        {
            DetailPanel.SetActive(true);
            Debug.Log("Detail Phrase :" + info.data.Id);
            AudioManager.I.PlayPhrase(info.data.Id);
            MoreInfoPanel.SetActive(false);
            ScoreText.text = "Score: " + info.score;

            ArabicText.text = info.data.Arabic;

            LL_Isolated.gameObject.SetActive(false);
            LL_Initial.gameObject.SetActive(false);
            LL_Medial.gameObject.SetActive(false);
            LL_Final.gameObject.SetActive(false);
        }
Пример #6
0
        public void Init(PhrasesPage _manager, PhraseInfo _info)
        {
            info    = _info;
            manager = _manager;

            if (info.unlocked || AppManager.I.Player.IsDemoUser)
            {
                LockIcon.enabled = false;
            }
            else
            {
                LockIcon.enabled = true;
            }

            Title.text    = info.data.Text;
            SubTitle.text = AppManager.I.ParentEdition.ShowHelpText ? info.data.Id : "";
        }
Пример #7
0
        public void Init(BookPanel _manager, PhraseInfo _info)
        {
            info    = _info;
            manager = _manager;

            if (info.unlocked || AppManager.I.GameSettings.CheatSuperDogMode)
            {
                LockIcon.enabled = false;
            }
            else
            {
                LockIcon.enabled = true;
            }

            Title.text    = info.data.Arabic;
            SubTitle.text = info.data.Id;
        }
Пример #8
0
        public void Init(PhrasesPage _manager, PhraseInfo _info)
        {
            info    = _info;
            manager = _manager;

            if (info.unlocked || AppManager.I.Player.IsDemoUser)
            {
                LockIcon.enabled = false;
            }
            else
            {
                LockIcon.enabled = true;
            }

            Title.text    = info.data.Arabic;
            SubTitle.text = info.data.English;
        }
Пример #9
0
        private void ItemSearch()
        {
            lbxItem.Items.Clear();
            PhraseInfo view = new PhraseInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), PhraseCategory.銷售商品資訊.ToString());
            if (!string.IsNullOrEmpty(txtName.Text))
            {
                view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.name.ToString(), txtName.Text);
            }
            view.load();
            while (!view.IsEof)
            {
                lbxItem.Items.Add(view.PHS_TYPE + view.PHS_NAME);
                view.next();
            }
        }
Пример #10
0
        public static ComboBox loadPhrase(ComboBox c, string category, bool isALL = false)
        {
            c.Items.Clear();
            if (isALL)
            {
                c.Items.Add("全部");
            }
            PhraseInfo view = new PhraseInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), category);
            view.load();
            while (!view.IsEof)
            {
                c.Items.Add(view.PHS_NAME);
                view.next();
            }
            return(c);
        }
Пример #11
0
        private void ItemSearch()
        {
            dgvItem.Rows.Clear();
            DataGridViewRowCollection rows = dgvItem.Rows;
            PhraseInfo view = new PhraseInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), PhraseCategory.商品資訊.ToString());
            if (!string.IsNullOrEmpty(txtName.Text))
            {
                view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.name.ToString(), txtName.Text);
            }
            view.load();
            while (!view.IsEof)
            {
                rows.Add(new Object[] { view.PHS_NAME, view.PHS_TYPE, view.PHS_COLOR, view.PHS_SIZE });
                view.next();
            }
        }
Пример #12
0
        private bool check()
        {
            string msg     = "";
            bool   isEmpty = false;


            if (string.IsNullOrEmpty(txtName.Text))
            {
                msg     = "欄位不能為空值!";
                isEmpty = true;
            }

            if (!isEmpty)
            {
                PhraseInfo view = new PhraseInfo(APConfig.Conn);
                view.Conditions  = " 1=1 ";
                view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.category.ToString(), ddlCategory.SelectedItem.ToString());
                view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.EQname.ToString(), txtName.Text);
                if (isItem)
                {
                    view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.EQsize.ToString(), txtSize.Text);
                    view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.EQtype.ToString(), txtType.Text);
                    view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.EQcolor.ToString(), txtColor.Text);
                }
                if (view.calculateCount() > 0)
                {
                    msg = "項目已存在!請確認!";
                }
            }

            if (!string.IsNullOrEmpty(msg))
            {
                APConfig.SweetAlert(ShowBoxType.alert, msg);
            }
            return(string.IsNullOrEmpty(msg) ? true : false);
        }