Beispiel #1
0
        //================================================================
        //データ削除処理  
        //================================================================
        public bool remove(int id, ref string resErrMsg)
        {
            DateTime regDate = DateTime.Now;
            bool     result  = false;

            try
            {
                using (umekoudbDataContext dc = new umekoudbDataContext())
                {
                    using (System.Transactions.TransactionScope ts = new System.Transactions.TransactionScope())
                    {
                        var deleteItems = (from o in dc.GetTable <card_t>() where o.id == id select o);
                        if (deleteItems.Count() == 0)
                        {
                            resErrMsg = "削除しようとしたデータはすでに存在しませんでした";
                            return(false);
                        }
                        card_t deleteItem = deleteItems.Single();

                        //データ削除
                        dc.GetTable <card_t>().DeleteOnSubmit(deleteItem);
                        dc.SubmitChanges();
                        ts.Complete();
                    }
                }

                result = true;
            }
            catch (Exception e)
            {
                resErrMsg = e.Message;
                result    = false;
            }
            return(result);
        }
Beispiel #2
0
 public void setData(card_t pRaw)
 {
     this.raw = pRaw;
 }
Beispiel #3
0
 public CardContentData()
 {
     this.raw = new card_t();
 }
Beispiel #4
0
 partial void Deletecard_t(card_t instance);
Beispiel #5
0
 partial void Updatecard_t(card_t instance);
Beispiel #6
0
 partial void Insertcard_t(card_t instance);