示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int                   id   = int.Parse(textid.Text);
            string                name = textname.Text;
            PayrollDatabase       pd   = new sytpayrolldatabase();
            ChangeNameTransaction emp  = new ChangeNameTransaction(id, name, pd);

            emp.Execute();
        }
示例#2
0
        public void TestChangeNameTransaction()
        {
            int empId           = 2;
            AddHourlyEmployee t = new AddHourlyEmployee(empId, "Bill", "Home", 15.25, database);

            t.Execute();
            ChangeNameTransaction cnt = new ChangeNameTransaction(empId, "Bob", database);

            cnt.Execute();
            Employee e = database.GetEmployee(empId);

            Assert.IsNotNull(e);
            Assert.AreEqual("Bob", e.Name);
        }