コード例 #1
0
        public bool deleteRecord(Customer customer)
        {
            bool result = false;

            try
            {
                var record = _tsmEntity.tbl_customers.Single(s => s.short_name == customer.Short_name);
                _tsmEntity.tbl_customers.Remove(record);
                _tsmEntity.SaveChanges();
                result = true;
                return(result);
            }
            catch { return(result); }
        }
コード例 #2
0
        public bool deleteRecord(User user)
        {
            bool result = false;

            try
            {
                var record = _tsmEntity.tbl_users.Single(s => s.user_name == user.User_name);
                _tsmEntity.tbl_users.Remove(record);
                _tsmEntity.SaveChanges();
                result = true;
                return(result);
            }
            catch { return(result); }
        }