コード例 #1
0
    /// <summary>
    /// 店舗テーブルから全件取得
    /// </summary>
    /// <returns></returns>
    public List <ShopMasterData> SelectShopMaster()
    {
        // 以下は実際に使用する時の使い方の例
        MyDatabase db = MyDatabase.Instance;

        // データベースのテーブルを取得
        ShopMasterTable shopMasterTable = db.GetShopMasterTable();

        return(shopMasterTable.SelectAll());
    }
コード例 #2
0
 private void CreateDbTables()
 {
     mDummyMasterTable                 = new DummyMasterTable(ref mDb);
     mDummyCaptureTable                = new DummyCaptureTable(ref mDb);
     m_ShopMasterTable                 = new ShopMasterTable(ref mDb);
     m_InvestmentTransactionTable      = new InvestmentTransactionTable(ref mDb);
     m_AmusumentMachineMasterTable     = new AmusumentMachineMasterTable(ref mDb);
     m_SelectJoinTable                 = new SelectJoinTable(ref mDb);
     m_AmusumentMachineRankMasterTable = new AmusumentMachineRankMasterTable(ref mDb);
 }
コード例 #3
0
    /// <summary>
    /// 店舗テーブルから1件取得
    /// </summary>
    /// <param name="id">shop id</param>
    /// <returns></returns>
    public ShopMasterData SelectShopMaster(int id)
    {
        // 以下は実際に使用する時の使い方の例
        MyDatabase db = MyDatabase.Instance;

        // データベースのテーブルを取得
        ShopMasterTable shopMasterTable = db.GetShopMasterTable();

        return(shopMasterTable.SelectFromPrimaryKey <int>(new Dictionary <string, string> {
            { ShopMasterTable.COL_ID, "" }
        })[0]);
    }
コード例 #4
0
    /// <summary>
    /// 店舗テーブルの登録/更新
    /// </summary>
    /// <param name="id">主キー</param>
    /// <param name="name">店舗名</param>
    /// <returns></returns>
    public bool InsertUpdateShopMaster(int id, string name)
    {
        // 以下は実際に使用する時の使い方の例
        MyDatabase db = MyDatabase.Instance;

        // データベースのテーブルを取得
        ShopMasterTable shopMasterTable = db.GetShopMasterTable();

        ShopMasterData shopMasterData = shopMasterTable.SelectFromPrimaryKey <int>(new Dictionary <string, string>()
        {
            { ShopMasterTable.COL_ID, id.ToString() }
        })[0];

        // InsertまたはUpdate
        // ※同一の主キーのデータがあればUpdate、無ければInsertとなる
        shopMasterData.id       = id;
        shopMasterData.ShopName = name;

        shopMasterTable.Update(shopMasterData);
        return(true);
    }