コード例 #1
0
 public bool Update(HomestayHostFamilyMember obj)
 {
     try
     {
         _db.SubmitChanges();
     }
     catch (Exception ex)
     {
         Debug.Print(ex.Message);
         return(false);
     }
     return(true);
 }
コード例 #2
0
        public int Add(HomestayHostFamilyMember obj)
        {
            try
            {
                _db.HomestayHostFamilyMembers.InsertOnSubmit(obj);
                _db.SubmitChanges();
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message);
                return(-1);
            }

            return(_db.HomestayHostFamilyMembers.Max(x => x.FamilyMemberId));
        }