public void NewBankerBooking()
        {
            BankerBooking booking = new BankerBooking(bankerBookingDal);

            booking.setTitle(1);
            booking.setFirstName("John");
            booking.setSurname("Due");
            booking.setContactNo("0700000000");
            booking.setEmailAddress("*****@*****.**");
            booking.setCompany("Store");
            booking.setExistingClient(true);
            booking.setQuery("Banking");
            booking.add(new List <BankFormsDal.dto.LeadComsMethodDto>()
            {
                new BankFormsDal.dto.LeadComsMethodDto()
                {
                    comsMethodId = 1
                }
            });
            booking.setProvisionalTime(1);
            booking.setProvisionalDate(DateTime.Now.AddDays(2));

            booking.save();

            Assert.AreNotEqual(0, booking.getId(), "Saved booking id cannot be zero");
        }
Пример #2
0
        private void loadBankerBookingForm(BankerBooking bankerBooking, object sender, EventArgs e)
        {
            bankerBooking.setTitle(Convert.ToInt32(titleInput.SelectedValue));
            bankerBooking.setFirstName(firstNameInput.Text);
            bankerBooking.setSurname(surnameInput.Text);

            bankerBooking.setContactNo(contactNoInput.Text);
            bankerBooking.setEmailAddress(emailAddressInput.Text);

            bankerBooking.setCompany(companyInput.Text);

            bankerBooking.setExistingClient(existingClientInput.Checked);
            bankerBooking.setBankingRegion(Convert.ToInt32(regionInput.SelectedValue));
            bankerBooking.setProvisionalDate(provisionalDateInput.SelectedDate);
            bankerBooking.setProvisionalTime(Convert.ToInt32(provisionalTimeInput.SelectedValue));
            bankerBooking.setQuery(queryInput.Text);

            List <LeadComsMethodDto> comsMethods = new List <LeadComsMethodDto>();


            foreach (ListItem selected in comsInput.Items)
            {
                if (selected.Selected)
                {
                    var comsMethod = new LeadComsMethodDto()
                    {
                        comsMethodId = Convert.ToInt32(selected.Value)
                    };
                    comsMethods.Add(comsMethod);
                }
            }

            bankerBooking.add(comsMethods);
        }