Beispiel #1
0
        /// <summary>
        /// Create a new EnrolList object.
        /// </summary>
        /// <param name="enrolID">Initial value of the EnrolID property.</param>
        /// <param name="firstName">Initial value of the FirstName property.</param>
        /// <param name="lastName">Initial value of the LastName property.</param>
        /// <param name="courseName">Initial value of the CourseName property.</param>
        /// <param name="enquiryDate">Initial value of the EnquiryDate property.</param>
        /// <param name="email">Initial value of the Email property.</param>
        public static EnrolList CreateEnrolList(global::System.Int32 enrolID, global::System.String firstName, global::System.String lastName, global::System.String courseName, global::System.DateTime enquiryDate, global::System.String email)
        {
            EnrolList enrolList = new EnrolList();

            enrolList.EnrolID     = enrolID;
            enrolList.FirstName   = firstName;
            enrolList.LastName    = lastName;
            enrolList.CourseName  = courseName;
            enrolList.EnquiryDate = enquiryDate;
            enrolList.Email       = email;
            return(enrolList);
        }
Beispiel #2
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            ASPNETDBEntities enrol = new ASPNETDBEntities();
            EnrolList        el    = new EnrolList();

            el.FirstName   = FirstNameTextBox.Text;
            el.LastName    = LastNameTextBox.Text;
            el.Email       = EmailTextBox.Text;
            el.CourseName  = CourseListDropDownList.SelectedItem.Text;
            el.EnquiryDate = DateTime.Now;

            enrol.EnrolLists.AddObject(el);
            enrol.SaveChanges();

            EnrolSuccessfulLabel.Text = "Thank you for submitting your details. We will be in touch shortly.";
        }
Beispiel #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EnrolLists EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEnrolLists(EnrolList enrolList)
 {
     base.AddObject("EnrolLists", enrolList);
 }