示例#1
0
        public void CaneSaveAppointment()
        {
            Todo.Business.Appointment appointment = new Todo.Business.Appointment();
            appointment.Description = "Test";
            appointment.StartDate   = DateTime.Now;
            appointment.Priority    = 1;
            appointment.EndDate     = DateTime.Now.AddDays(3);

            _appointmentrepo.Save(appointment);

            Appointment a1 = _appointmentrepo.GetSingleById(1);
        }
示例#2
0
        public void CaneSaveAppointmentWith2Contacts()
        {
            Todo.Business.Appointment appointment = new Todo.Business.Appointment();
            appointment.Description = "Test";
            appointment.StartDate   = DateTime.Now;
            appointment.Priority    = 1;
            appointment.EndDate     = DateTime.Now.AddDays(3);

            Todo.Business.Contact contact1 = new Todo.Business.Contact();
            contact1.Address        = "Test";
            contact1.AreaCode       = "Test";
            contact1.City           = "Test";
            contact1.Company        = "Test";
            contact1.Department     = "Test";
            contact1.FirstName      = "Test";
            contact1.Gender         = "Test";
            contact1.isBusiness     = true;
            contact1.LandlineNumber = "Test";
            contact1.Lastname       = "Test";
            contact1.MobileNumber   = "Test";
            _contactrepo.Save(contact1);

            Todo.Business.Contact contact2 = new Todo.Business.Contact();
            contact2.Address        = "Test2";
            contact2.AreaCode       = "Test2";
            contact2.City           = "Test2";
            contact2.Company        = "Test2";
            contact2.Department     = "Test2";
            contact2.FirstName      = "Test2";
            contact2.Gender         = "Test2";
            contact2.isBusiness     = true;
            contact2.LandlineNumber = "Test2";
            contact2.Lastname       = "Test2";
            contact2.MobileNumber   = "Test2";
            _contactrepo.Save(contact2);

            Contact c1 = _contactrepo.GetSingleById(1);
            Contact c2 = _contactrepo.GetSingleById(2);

            appointment.Contacts = new List <Contact>();
            appointment.Contacts.Add(c1);
            appointment.Contacts.Add(c2);

            _appointmentrepo.Save(appointment);
        }