try
                    {
                        using (TransactionScope tr = new TransactionScope())
                        {
                            int i = this.customermanager.addCustomer(customer);
                            int j = this.homestatusmanager.updateHomestatus(homestatus);
                            if ((i * j) > 0)
                            {
                                MessageBox.Show("记录插入成功!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                Empty();
                                tr.Complete();
                            }
                            else
                            {
                                MessageBox.Show("记录插入失败!联系管理员!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                Empty();
                            }
                            tr.Dispose();
                        }
                       
                    }
                    catch(Exception err)
                    {
                        MessageBox.Show("记录插入失败" +err.ToString(), "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }

posted on 2013-03-30 11:40  点滴汪洋  阅读(154)  评论(0)    收藏  举报