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"); }
private void submitForm(object sender, EventArgs e) { log4net.ILog logger = log4net.LogManager.GetLogger(typeof(_Default)); BankerBooking bankerBooking = new BankerBooking(_bankerBookingDal); try { loadBankerBookingForm(bankerBooking, sender, e); } catch (Exception ex) { logger.Error("Failed to load banker booking form", ex); displayUIError("Failed to load booking form"); } try { bankerBooking.save(); Response.Redirect("SuccessfulSubmit.aspx"); } catch (Exception ex) { logger.Error("Failed to save banker booking form", ex); displayUIError("Failed to save banker booking form"); } }