Beispiel #1
0
        /// <summary>
        /// 返却ボタン押下時のチェック
        /// </summary>
        private void ReturnCheckes()
        {
            // 未入力チェック
            if (string.IsNullOrEmpty(txtId.Text))
            {
                throw new InputException(GlobalDefine.ERROR_CODE[11].message, GlobalDefine.ERROR_CODE[11].code, txtId);
            }

            // 存在チェック
            IsExistBookId();

            // 書籍が貸出中か
            DBAdapter dba   = SingletonObject.GetDbAdapter();
            string    query = string.Format("SELECT * FROM BOOK_STATUS WHERE BOOK_ID = '{0}'", txtId.Text);

            if (dba.FindRecord(query))
            {
                query = string.Format("SELECT " +
                                      "* " +
                                      "FROM " +
                                      "(SELECT * FROM BOOK_STATUS WHERE BOOK_ID = '{0}') " +
                                      "WHERE " +
                                      "(LENDING_STATUS = 0)",
                                      txtId.Text);

                if (!dba.FindRecord(query))
                {
                    throw new InputException(GlobalDefine.ERROR_CODE[20].message, GlobalDefine.ERROR_CODE[20].code, txtId);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 書籍ID LostFocusチェック
        /// </summary>
        private void CheckTxtId()
        {
            // シングルクォーテーションチェック
            InputCheck.IsSingleQuotation(this.txtId);

            // 書籍IDが存在するか
            IsExistBookId();

            // 書籍が貸出中か
            DBAdapter dba   = SingletonObject.GetDbAdapter();
            string    query = string.Format("SELECT * FROM BOOK_STATUS WHERE BOOK_ID = '{0}'", txtId.Text);

            if (dba.FindRecord(query))
            {
                query = string.Format("SELECT " +
                                      "* " +
                                      "FROM " +
                                      "(SELECT * FROM BOOK_STATUS WHERE BOOK_ID = '{0}') " +
                                      "WHERE " +
                                      "(LENDING_STATUS = 0)",
                                      txtId.Text);

                if (!dba.FindRecord(query))
                {
                    throw new InputException(GlobalDefine.ERROR_CODE[20].message, GlobalDefine.ERROR_CODE[20].code, txtId);
                }
            }
        }
Beispiel #3
0
    private float GetProperWidth()
    {
        float retVal = 0;
        float max    = 0;
        float min    = 0;

        if (SingletonObject.getInstance <DeviceOrientationManager>().IsLandscape())
        {
            retVal = landscapePreferredSize.x;
            if (0 != landscapePreferredPercent.x)
            {
                retVal = Screen.width * landscapePreferredPercent.x / 100;
            }
            max    = landScapeMaxSize.x <= 0 ? retVal : landScapeMaxSize.x;
            min    = landscapeMinSize.x <= 0 ? retVal : landscapeMinSize.x;
            retVal = Mathf.Clamp(retVal, min, max);
        }
        else
        {
            retVal = potraitPreferredSize.x;
            if (0 != potraitPreferredPercent.x)
            {
                retVal = Screen.width * potraitPreferredPercent.x / 100;
            }
            max    = potraitMaxSize.x <= 0 ? retVal : potraitMaxSize.x;
            min    = potraitMinSize.x <= 0 ? retVal : potraitMinSize.x;
            retVal = Mathf.Clamp(retVal, min, max);
        }

        return(retVal);
    }
Beispiel #4
0
        public static void OnToggleClick(Toggle toggle, bool value)
        {
            if (!Main.enabled)
            {
                return;
            }
            if (value == false)
            {
                return;
            }
            string[] temp = toggle.name.Split(',');
            int      cost = int.Parse(temp[1]);

            Traverse.Create(BattleSystem.instance).Field("actorWeaponCost").SetValue(new int[6] {
                cost, cost, cost, cost, cost, cost
            });
            for (int i = 0; i < 6; i++)
            {
                SingletonObject.getInstance <DynamicSetSprite>().SetImageSprite(BattleSystem.instance.actorWeaponCostIcon[i], "gongFaCostSprites", new int[]
                {
                    int.Parse(DateFile.instance.attackTypDate[cost][98])
                });
                //BattleSystem.instance.actorWeaponCostIcon[i].sprite = GetSprites.instance.gongFaCostSprites[DateFile.instance.ParseInt(DateFile.instance.attackTypDate[cost][98])];
                TweenSettingsExtensions.SetEase <Tweener>(ShortcutExtensions.DOScale(BattleSystem.instance.actorWeaponCostIcon[i].GetComponent <RectTransform>(), new Vector3(2f, 2f, 1f), 0.1f), Ease.OutBack);
                TweenSettingsExtensions.SetEase <Tweener>(TweenSettingsExtensions.SetDelay <Tweener>(ShortcutExtensions.DOScale(BattleSystem.instance.actorWeaponCostIcon[i].GetComponent <RectTransform>(), new Vector3(1f, 1f, 1f), 0.3f), 0.1f), Ease.OutBack);
            }
        }
Beispiel #5
0
        public void TestMethod5()
        {
            DbQuery dc     = SingletonObject.GetDbQuery();
            bool    result = dc.IsAdminPassword("password");

            Assert.IsFalse(result);
        }
Beispiel #6
0
 /// <summary>
 /// OKボタン
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtPass.Text.Equals(txtPassConfirm.Text))
         {
             if (base.AskMessageBox(GlobalDefine.MESSAGE_PASSWORD_UPDATE))
             {
                 DBAdapter dba   = SingletonObject.GetDbAdapter();
                 string    query = string.Format("UPDATE SYSTEM_DEFINE_MASTER SET VALUE = '{0}' WHERE KEY = 'password'", txtPass.Text);
                 dba.nonExecSQL(query);
                 MessageBox.Show(GlobalDefine.MESSAGE_PASSWORD_CHANGE);
                 this.Close();
             }
         }
         else
         {
             throw new InputException(GlobalDefine.ERROR_CODE[8].message, GlobalDefine.ERROR_CODE[8].code);
         }
     }
     catch (InputException ex)
     {
         MessageBox.Show(ex.Message);
         txtPass.Clear();
         txtPassConfirm.Clear();
         txtPass.Focus();
     }
 }
        /// <summary>
        /// 削除ボタン
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            // エラーチェック
            DeleteCheck();

            // 画面時に保持した変数と入力された項目を比較して、MessageBoxに表示するメッセージを変更する
            string msg =
                textName.Text.Equals(this.tempCategoryName) ? GlobalDefine.MESSAGE_ASK_DELETE : GlobalDefine.MESSAGE_ASK_DELETE_CHANGE;

            // 確認メッセージ表示
            if (AskMessageBox(msg))
            {
                // 削除実行
                DBAdapter dba   = SingletonObject.GetDbAdapter();
                string    query = string.Format("DELETE FROM BOOK_GENRE_MASTER WHERE DIVISION_ID = '{0}'", this.textId.Text);
                dba.nonExecSQL(query);

                MessageBox.Show(GlobalDefine.MESSAGE_COMPLETE_DELETE);

                // 削除モードに変更(確認dialog出さずに、フォーム閉じる為)
                mode = MODE.DEL;
                this.Close();
            }

            return;
        }
Beispiel #8
0
        public void TestMethod2()
        {
            DbQuery dc     = SingletonObject.GetDbQuery();
            bool    result = dc.IsAdminPassword("admin");

            Assert.IsTrue(result);
        }
        /// <summary>
        /// 入力チェック用メソッド
        /// </summary>
        private void ErrorCheck()
        {
            // シングルクォーテーションが入っていたら(会社名)
            if (this.textName.Text.IndexOf('\'') >= 0)
            {
                throw new InputException(GlobalDefine.ERROR_CODE[0].message, GlobalDefine.ERROR_CODE[0].code, this.textName);
            }

            // 空文字チェック(会社名)
            if (string.IsNullOrEmpty(this.textName.Text))
            {
                throw new InputException(GlobalDefine.ERROR_CODE[1].message, GlobalDefine.ERROR_CODE[1].code, this.textName);
            }

            // 新規追加モードの場合、会社名が登録されているかどうか
            if (mode == MODE.ADD)
            {
                DBAdapter dba = SingletonObject.GetDbAdapter();
                string    str = string.Format("SELECT * FROM BOOK_GENRE_MASTER WHERE DIVISION_NAME = '{0}'", this.textName.Text);
                if (dba.FindRecord(str))
                {
                    throw new InputException(GlobalDefine.ERROR_CODE[3].message, GlobalDefine.ERROR_CODE[3].code, this.textName);
                }
            }
        }
Beispiel #10
0
        public static bool Load(UnityModManager.ModEntry modEntry)
        {
            CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.InvariantCulture;
            CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;

            Main.Logger = modEntry.Logger;

            var harmony = HarmonyInstance.Create(modEntry.Info.Id);

            harmony.PatchAll(Assembly.GetExecutingAssembly());

            Main.settings = Settings.Load <Settings>(modEntry);

            resBasePath = System.IO.Path.Combine(modEntry.Path, "resources");

            var dynamicSetSprite = SingletonObject.getInstance <DynamicSetSprite>();

            getSpritesInfoAsset = (GetSpritesInfoAsset)Traverse.Create(dynamicSetSprite).Field("gsInfoAsset").GetValue();

            modEntry.OnToggle  = Main.OnToggle;
            modEntry.OnGUI     = Main.OnGUI;
            modEntry.OnSaveGUI = Main.OnSaveGUI;

            return(true);
        }
Beispiel #11
0
        /// <summary>
        /// 返却ボタン
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnReturn_Click(object sender, EventArgs e)
        {
            ReturnCheckes();

            // 確認ダイアログを表示
            if (!AskMessageBox(GlobalDefine.MESSAGE_ASK_RETURN))
            {
                return;
            }

            // 貸出詳細テーブル更新
            DBAdapter dba   = SingletonObject.GetDbAdapter();
            string    query = string.Format("UPDATE LENDING_DETAIL SET RETURN_DATE = Datetime('{0}') " +
                                            "WHERE BOOK_ID = '{1}' AND LOAN_DATE = Datetime('{2}') AND SUB_NO = {3} ",
                                            dateReturn.Value.ToString("yyyy-MM-dd"),
                                            txtId.Text,
                                            dateLoan.Value.ToString("yyyy-MM-dd"),
                                            subNo);

            dba.nonExecSQL(query);

            // 貸出状態テーブル更新
            query = string.Format("UPDATE BOOK_STATUS SET LENDING_STATUS = 1 WHERE BOOK_ID = '{0}'", txtId.Text);
            dba.nonExecSQL(query);

            MessageBox.Show(GlobalDefine.MESSAGE_COMPLETE_REGISTRATION);

            InitDiag();
            txtId.Focus();
        }
Beispiel #12
0
    void LoadAllGuidPlayers()
    {
        playerList = new List <PlayerData>();
        string[] dirs           = Directory.GetDirectories(pathData, "", SearchOption.TopDirectoryOnly);
        string   playerFileName = DataType.Player.ToString() + dataFileExt;

        byte[]     buffer;
        FileHelper fileHelper = SingletonObject.getInstance <FileHelper>();

        for (int i = 0, max = dirs.Length; i < max; ++i)
        {
            string filePlayer = Path.Combine(pathData, string.Format("{0}/{1}", dirs[i], playerFileName));
            if (File.Exists(filePlayer))
            {
                buffer = fileHelper.ReadFile(filePlayer);
                PlayerData player = ProtoSerializer.ProtoDeSerialize <PlayerData>(buffer);
                if (null != player)
                {
                    playerList.Add(player);
                }
            }
        }
        if (playerList.Count > 1)
        {
            playerList.Sort((left, right) => { return((int)(left.lastLogin - right.lastLogin)); });
        }
        if (playerList.Count > 0)
        {
            curPlayer = playerList[playerList.Count - 1];
        }
    }
Beispiel #13
0
        private static bool GetItem_Prefix(ref int ___massageItemTyp, ref Transform ___itemHolder)
        {
            if (___massageItemTyp != int.MinValue)
            {
                return(true);
            }

            for (int i = 0; i < ___itemHolder.childCount; i++)
            {
                GameObject.Destroy(___itemHolder.GetChild(i).gameObject);
            }

            List <int> baseData      = new List <int>();
            int        TargetActorID = MessageEventManager.Instance.MainEventData[1];
            int        actorId       = DateFile.instance.MianActorID();

            if (RuntimeConfig.ChoiceEnvironment.Filter != null)
            {
                baseData = RuntimeConfig.ChoiceEnvironment.Filter.ToList();
                RuntimeConfig.ChoiceEnvironment.Filter = null;
            }
            else
            {
                baseData = new List <int>(DateFile.instance.GetItemSort(new List <int>(DateFile.instance.GetActorItems(RuntimeConfig.ChoiceEnvironment.GetWhoItem == 0 ? actorId : TargetActorID).Keys)));
            }

            for (int k = 0; k < baseData.Count; k++)
            {
                int num6 = baseData[k];
                if (int.Parse(DateFile.instance.GetItemDate(num6, 3)) != 1)
                {
                    continue;
                }
                int num7 = int.Parse(DateFile.instance.GetItemDate(num6, 5));

                GameObject gameObject = GameObject.Instantiate(UsefulPrefabs.instance.itemIconNoDrag, Vector3.zero, Quaternion.identity);
                gameObject.name = "Item," + num6;
                gameObject.transform.SetParent(___itemHolder, worldPositionStays: false);
                gameObject.GetComponent <Toggle>().group = ___itemHolder.GetComponent <ToggleGroup>();
                Image component = gameObject.transform.Find("ItemBack").GetComponent <Image>();
                SingletonObject.getInstance <DynamicSetSprite>().SetImageSprite(component, "itemBackSprites", int.Parse(DateFile.instance.GetItemDate(num6, 4)));
                component.color = DateFile.instance.LevelColor(int.Parse(DateFile.instance.GetItemDate(num6, 8)));
                if (int.Parse(DateFile.instance.GetItemDate(num6, 6)) > 0)
                {
                    gameObject.transform.Find("ItemNumberText").GetComponent <Text>().text = "×" + DateFile.instance.GetItemNumber(actorId, num6);
                }
                else
                {
                    int num8 = int.Parse(DateFile.instance.GetItemDate(num6, 901));
                    int num9 = int.Parse(DateFile.instance.GetItemDate(num6, 902));
                    gameObject.transform.Find("ItemNumberText").GetComponent <Text>().text = $"{DateFile.instance.Color3(num8, num9)}{num8}</color>/{num9}";
                }
                GameObject gameObject2 = gameObject.transform.Find("ItemIcon").gameObject;
                gameObject2.name = "ItemIcon," + num6;
                SingletonObject.getInstance <DynamicSetSprite>().SetImageSprite(gameObject2.GetComponent <Image>(), "itemSprites", int.Parse(DateFile.instance.GetItemDate(num6, 98)));
            }

            return(false);
        }
        public static void 绑定过月事件和图片(string turnEventImageName, Dictionary <int, string> turnEventDateValue,
                                     int turnEventIndex)
        {
            var dynamicSetSprite    = SingletonObject.getInstance <DynamicSetSprite>();
            var getSpritesInfoAsset =
                (GetSpritesInfoAsset)Traverse.Create(dynamicSetSprite).Field("gsInfoAsset").GetValue();

            int spriteId = 0;

            string spritePath = Path.Combine(Main.picpath, turnEventImageName);
            string spriteName = Path.GetFileNameWithoutExtension(spritePath);

            if (getSpritesInfoAsset.trunEventImage.Last() != spriteName)
            {
                GetSpritesInfoAsset.SingleSpritePathInfo spritePathInfo = new GetSpritesInfoAsset.SingleSpritePathInfo
                {
                    name = spriteName,
                    path = spritePath
                };
                getSpritesInfoAsset.singleSpritePathInfos.Add(spritePathInfo);
                Traverse.Create(getSpritesInfoAsset).Method("InitSingleSpritePathes").GetValue();

                getSpritesInfoAsset.trunEventImage =
                    getSpritesInfoAsset.trunEventImage.AddToArray(spriteName);

                var commonNameGroup =
                    (Dictionary <string, string[]>)Traverse.Create(getSpritesInfoAsset).Field("commonNameGroup")
                    .GetValue();
                commonNameGroup["trunEventImage"] = getSpritesInfoAsset.trunEventImage;
                spriteId = getSpritesInfoAsset.trunEventImage.Length - 1;
                Main.Logger.Log("加入过月事件图片:" + turnEventImageName + " 图片Id:" + spriteId);

                turnEventSpriteNameList.Add(spriteName);
                GayMaxSpriteCache[spriteName] = CreateSpriteFromImage(spritePath); //将外部图片载入缓存
            }

            if (spriteId == 0)
            {
                spriteId = getSpritesInfoAsset.trunEventImage.Length - 1;
            }

            if (turnEventDateValue.Keys.Contains(98))
            {
                turnEventDateValue[98] = spriteId.ToString();
            }
            else
            {
                Main.Logger.Log("加入过月事件失败");
            }


            int turnEventId = DateFile.instance.trunEventDate.Keys.Max() + 1;

            DateFile.instance.trunEventDate.Add(turnEventId, turnEventDateValue);
            Index.TurnEvenIndex[turnEventIndex] = turnEventId;

            Main.Logger.Log("加入过月事件:" + turnEventDateValue[0] + " 事件Id:" + turnEventId + " 图片Id:" +
                            turnEventDateValue[98]);
        }
        /// <summary>
        /// ユーザ名からユーザID取得
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        private string GetUserId(string userName)
        {
            DbQuery dc = SingletonObject.GetDbQuery();

            string[] data = dc.SelectUserId(userName);

            return((data == null) ? null : data[0]);
        }
        /// <summary>
        /// 分類名から分類ID取得
        /// </summary>
        /// <param name="categroyName"></param>
        /// <returns></returns>
        private string GetCategoryId(string categroyName)
        {
            DbQuery dc = SingletonObject.GetDbQuery();

            string[] data = dc.SelectGenreId(categroyName);

            return((data == null) ? null : data[0]);
        }
        /// <summary>
        /// ダイアログ初期化
        /// </summary>
        private void InitDialog()
        {
            DBAdapter dba = SingletonObject.GetDbAdapter();

            cmbCategory1.InitControl();
            cmbCategory2.InitControl();
            cmbCategory3.InitControl();
        }
Beispiel #18
0
        public static bool IsRegistered(string turnEventName)
        {
            var dynamicSetSprite    = SingletonObject.getInstance <DynamicSetSprite>();
            var getSpritesInfoAsset =
                (GetSpritesInfoAsset)Traverse.Create(dynamicSetSprite).Field("gsInfoAsset").GetValue();

            return(getSpritesInfoAsset.trunEventImage.Contains(turnEventName));
        }
    static void InitConfigFile()
    {
        ToolCommon.CreatePath(SingletonObject <GameConfig> .GetInst().ResourcePath);

        IOTempConfigFileInfo configFileInfo = new IOTempConfigFileInfo();

        IOHelper.SetData(DEFINE.IO_HELPER_TEMP_CONFIG_FILE_INFO, configFileInfo);
    }
Beispiel #20
0
 public HomeController(TransientObject transientObject1, TransientObject transientObject2, ScopedObject scopedObject1, ScopedObject scopedObject2, SingletonObject singletonObject1, SingletonObject singletonObject2)
 {
     this.transientObject1 = transientObject1;
     this.transientObject2 = transientObject2;
     this.scopedObject1    = scopedObject1;
     this.scopedObject2    = scopedObject2;
     this.singletonObject1 = singletonObject1;
     this.singletonObject2 = singletonObject2;
 }
    public static void InitTempLogs()
    {
        ToolCommon.CreatePath(SingletonObject <GameConfig> .GetInst().ResourcePath);

        //m_logList.Clear();
        IOTempConfigLogInfo configLogInfo = new IOTempConfigLogInfo();

        IOHelper.SetData(DEFINE.IO_HELPER_TEMP_CONFIG_LOG_INFO, configLogInfo);
    }
Beispiel #22
0
        /// <summary>
        /// 会社名から会社ID取得
        /// </summary>
        /// <param name="companyName"></param>
        /// <returns></returns>
        private string GetCompanyId(string companyName)
        {
            DBAdapter dba   = SingletonObject.GetDbAdapter();
            string    query = string.Format("SELECT COMPANY_ID FROM COMPANY_MASTER WHERE COMPANY_NAME='{0}'", companyName);

            string[] data = dba.GetRecord(query);

            return((data == null) ? null : data[0]);
        }
Beispiel #23
0
        public void CreateSingletonObject()
        {
            SingletonObject instance = SingletonObject.GetInstance();
            string          field    = instance.GetField();
            int             flag     = instance.GetFlag();

            Assert.AreEqual("field1", field);
            Assert.AreEqual(2, flag);
        }
Beispiel #24
0
    private static string GetFileLocalSave(string fileName)
    {
#if UNITY_EDITOR
        string path = SingletonObject <GameConfig> .GetInst().ResourcePath + fileName;
#else
        string path = Application.persistentDataPath + fileName;
#endif

        return(path);
    }
        static public DataTable GetAllData()
        {
            DataTable dt = new DataTable();

            string query = "SELECT * FROM BOOK_GENRE_MASTER;";

            dt = SingletonObject.GetDbAdapter().execSQL(query);

            return(dt);
        }
        public void Test()
        {
            // The client code.
            var s1 = SingletonObject.GetInstance();
            var s2 = SingletonObject.GetInstance();

            _testOutputHelper.WriteLine(s1 == s2
                ? "Singleton works, both variables contain the same instance."
                : "Singleton failed, variables contain different instances.");
        }
Beispiel #27
0
 public static void CheckUpdate(UnityModManager.ModEntry modEntry)
 {
     status = Status.checkUpdateing;
     if (!UnityModManager.HasNetworkConnection())
     {
         status = Status.networkError;
         return;
     }
     SingletonObject.getInstance <YieldHelper>().StartYield(HasNewerVersion(modEntry, checkUpdateUrl));
 }
        // 削除チェック用のメソッド
        private void DeleteCheck()
        {
            DBAdapter dba = SingletonObject.GetDbAdapter();
            string    str = string.Format("SELECT * FROM USER_MASTER WHERE COMPANY_ID = '{0}' AND RETIREMENT_FLAG = 0", this.textId.Text);

            if (dba.FindRecord(str))
            {
                throw new InputException(GlobalDefine.ERROR_CODE[4].message, GlobalDefine.ERROR_CODE[4].code, this.textId);
            }
        }
Beispiel #29
0
        /// <summary>
        /// 書籍IDの存在チェック
        /// </summary>
        private void IsExistBookId()
        {
            // 書籍IDが存在するか
            DBAdapter dba   = SingletonObject.GetDbAdapter();
            string    query = string.Format("SELECT * FROM BOOK_MASTER WHERE BOOK_ID = '{0}'", txtId.Text);

            if (!dba.FindRecord(query))
            {
                throw new InputException(GlobalDefine.ERROR_CODE[11].message, GlobalDefine.ERROR_CODE[11].code, txtId);
            }
        }
Beispiel #30
0
        /// <summary>
        /// 执行存档读取操作
        /// </summary>
        public static void DoLoad(int dataId)
        {
            OnLoad = true;
            // 防止UI活动生成新的SingletonObject实例
            UIDate.instance.gameObject.SetActive(false);
            // 来自DateFile.BackToStartMenu()方法,载入存档前清空,防止载入存档时载入奇书数据时卡档
            SingletonObject.ClearInstances();
            // 释放资源
            SubSystems.OnUnloadGameData();

            MainMenu.instance.SetLoadIndex(dataId);
        }