/// <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); }
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."; }
/// <summary> /// Deprecated Method for adding a new object to the EnrolLists EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEnrolLists(EnrolList enrolList) { base.AddObject("EnrolLists", enrolList); }