Esempio n. 1
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_CardMasterTable            = new CardMasterTable(ref mDb);
 }
        /// <summary>
        /// 店舗テーブルから全件取得
        /// </summary>
        /// <returns></returns>
        public List <ShopMasterData> SelectShopMaster()
        {
            // 以下は実際に使用する時の使い方の例
            MyDatabase db = MyDatabase.Instance;

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

            return(shopMasterTable.SelectAll());
        }
        /// <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(id);

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

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