Exemple #1
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfCheckIn config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_CheckIn", fieldName, fieldValue);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        config = null;
                        return(false);
                    }
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("CheckIn 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
        public SignInItemTable GetCurrentReward()
        {
            ConfCheckIn checkIn = ConfCheckIn.Get(m_data.Id);

            if (checkIn == null || m_data == null)
            {
                return(null);
            }
            return(m_itemTable[m_data.Day - 1]);
        }
Exemple #3
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_CheckIn");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfCheckIn _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
Exemple #4
0
        private static ConfCheckIn GetConfByDic(DataTable reader)
        {
            long   id        = reader.GetInt64(0);
            string startTime = reader.GetString(1);
            int    type      = reader.GetInt32(2);
            string picture   = reader.GetString(3);
            int    count7    = reader.GetInt32(4);
            long   reward7   = reader.GetInt64(5);
            int    count6    = reader.GetInt32(6);
            long   reward6   = reader.GetInt64(7);
            int    count5    = reader.GetInt32(8);
            long   reward5   = reader.GetInt64(9);
            int    count4    = reader.GetInt32(10);
            long   reward4   = reader.GetInt64(11);
            int    count3    = reader.GetInt32(12);
            long   reward3   = reader.GetInt64(13);
            int    count2    = reader.GetInt32(14);
            long   reward2   = reader.GetInt64(15);
            int    count1    = reader.GetInt32(16);
            long   reward1   = reader.GetInt64(17);
            string descs     = reader.GetString(18);

            ConfCheckIn new_obj_ConfCheckIn = new ConfCheckIn(id,
                                                              startTime,
                                                              type,
                                                              picture,
                                                              count7,
                                                              reward7,
                                                              count6,
                                                              reward6,
                                                              count5,
                                                              reward5,
                                                              count4,
                                                              reward4,
                                                              count3,
                                                              reward3,
                                                              count2,
                                                              reward2,
                                                              count1,
                                                              reward1,
                                                              descs
                                                              );

            return(new_obj_ConfCheckIn);
        }
        public bool AddItemTable()
        {
            ConfCheckIn confCheckIn = ConfCheckIn.Get(m_data.Id);

            if (confCheckIn == null)
            {
                return(false);
            }
            m_itemTable.Clear();
            m_itemTable.Add(new SignInItemTable(confCheckIn.reward1, confCheckIn.count1));
            m_itemTable.Add(new SignInItemTable(confCheckIn.reward2, confCheckIn.count2));
            m_itemTable.Add(new SignInItemTable(confCheckIn.reward3, confCheckIn.count3));
            m_itemTable.Add(new SignInItemTable(confCheckIn.reward4, confCheckIn.count4));
            m_itemTable.Add(new SignInItemTable(confCheckIn.reward5, confCheckIn.count5));
            m_itemTable.Add(new SignInItemTable(confCheckIn.reward6, confCheckIn.count6));
            m_itemTable.Add(new SignInItemTable(confCheckIn.reward7, confCheckIn.count7));
            return(true);
        }
Exemple #6
0
        public static bool GetConfig(long id, out ConfCheckIn config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_CheckIn", id);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        dic[id] = null;
                        config  = null;
                        return(false);
                    }
                    dic[id] = config;
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("CheckIn 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
Exemple #7
0
 public static void Register()
 {
     ConfAchievement.Init();
     ConfActiveDrop.Init();
     ConfActivityBase.Init();
     ConfAssetManifest.Init();
     Confbranchtask.Init();
     ConfBuilding.Init();
     ConfCartoonScene.Init();
     ConfChapter.Init();
     ConfCharge.Init();
     ConfChat.Init();
     ConfChatItem.Init();
     ConfCheckIn.Init();
     ConfCombineFormula.Init();
     ConfDemoScene.Init();
     ConfDropOut.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfDropOut2.Init();
     Confetl.Init();
     ConfEvent.Init();
     ConfEventAttribute.Init();
     ConfEventPhase.Init();
     Confexhibit.Init();
     ConfExpToLevel.Init();
     Conffailtips.Init();
     ConfFeedback.Init();
     ConfFind.Init();
     ConfFindClue.Init();
     ConfFindTypeIcon.Init();
     ConfGMCMD.Init();
     ConfGuid.Init();
     ConfGuidArt.Init();
     ConfGuidNew.Init();
     ConfGuidNewFunction.Init();
     Confinapppurchase.Init();
     ConfJigsawScene.Init();
     ConfKeyWords.Init();
     ConfLanguage.Init();
     ConfMsgCode.Init();
     ConfNode.Init();
     ConfNpc.Init();
     ConfOfficer.Init();
     ConfPath.Init();
     ConfPoliceRankIcon.Init();
     ConfProp.Init();
     ConfPropGift.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfPush.Init();
     ConfReasoning.Init();
     ConfScene.Init();
     ConfSceneDifficulty.Init();
     ConfSceneSpecial.Init();
     ConfServiceConfig.Init();
     ConfSkill.Init();
     ConfSkyEye.Init();
     ConfSound.Init();
     ConfTask.Init();
     ConfTitle.Init();
 }