public void DataBind(Enrollment obj) { if (obj != null) { this.ObjectID = obj.ID; this.StudentField.SelectedValue = obj.StudentID.ToString(); this.CourseField.SelectedValue = obj.CourseID.ToString(); } }
public static void DeleteEnrollment(DA.SampleDataContext context, int id) { DA.Enrollment obj = GetByID(context, id); PerformPreDeleteLogic(context, obj); context.Enrollments.DeleteOnSubmit(obj); PerformPostDeleteLogic(context, obj); }
public static DA.Enrollment CreateEnrollment(DA.Student Student_Parameter, DA.Course Course_Parameter) { DA.SampleDataContext context = new DA.SampleDataContext(); DA.Enrollment obj = CreateEnrollment(context, Student_Parameter, Course_Parameter); context.SubmitChanges(); DA.Enrollment.OnCacheNeedsRefresh(); return(obj); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); string idString = this.Request.QueryString["ID"]; int id; if (int.TryParse(idString, out id)) { this.Enrollment = EnrollmentLogic.GetByID(this.DataContext, id); if (!this.IsPostBack) this.EditControl.DataBind(this.Enrollment); } }
public static DA.Enrollment CreateEnrollment(DA.SampleDataContext context, DA.Student Student_Parameter, DA.Course Course_Parameter) { DA.Enrollment obj = new DA.Enrollment(); obj.Student = Student_Parameter; obj.Course = Course_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Enrollments.InsertOnSubmit(obj); PerformPostCreateLogic(context, obj); return(obj); }
protected void ListControl_Delete(object sender, Enrollment obj) { EnrollmentLogic.DeleteEnrollment(this.DataContext, obj.ID); this.DataContext.SubmitChanges(); BindList(); }
protected void EditControl_Saved(object sender, Enrollment obj) { this.Response.Redirect("Default.aspx"); }
/// <summary>When implemented, allows logic to be performed after the object is deleted using the supplied data context.</summary> static partial void PerformPostDeleteLogic(DA.SampleDataContext context, DA.Enrollment obj);
/// <summary>When implemented, validates that the object conforms to standard business rules using the supplied data context.</summary> static partial void Validate(DA.SampleDataContext context, DA.Enrollment obj);
public static Enrollment CreateEnrollment(SampleObjectContext context, Student Student_Parameter, Course Course_Parameter) { Enrollment obj = new Enrollment(); obj.Student = Student_Parameter; obj.Course = Course_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Enrollments.AddObject(obj); PerformPostCreateLogic(context, obj); return obj; }
public static DA.Enrollment LoadEnrollmentFromDataContext(this DA.Enrollment obj, DA.SampleDataContext dataContext) { return(DA.Enrollment.GetByID(dataContext, obj.ID)); }
/// <summary>When implemented, allows logic to be performed after the object is created using the supplied data context.</summary> partial static void PerformPostCreateLogic(SampleObjectContext context, Enrollment obj);
protected void ListControl_Edit(object sender, Enrollment obj) { Response.Redirect(string.Format("Edit.aspx?ID={0}", obj.ID)); }
private void OnSaved(Enrollment obj) { if (this.Saved != null) this.Saved(this, obj); }
private void OnDelete(Enrollment obj) { if (this.Delete != null) this.Delete(this, obj); }
private void OnEdit(Enrollment obj) { if (this.Edit != null) this.Edit(this, obj); }
public static DA.Enrollment CreateEnrollment(DA.SampleDataContext context, DA.Student Student_Parameter, DA.Course Course_Parameter) { DA.Enrollment obj = new DA.Enrollment(); obj.Student = Student_Parameter; obj.Course = Course_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Enrollments.InsertOnSubmit(obj); PerformPostCreateLogic(context, obj); return obj; }
/// <summary>When implemented, validates that the object conforms to standard business rules using the supplied data context.</summary> partial static void Validate(SampleObjectContext context, Enrollment obj);
/// <summary>When implemented, allows logic to be performed before the object is deleted using the supplied data context.</summary> partial static void PerformPreDeleteLogic(SampleObjectContext context, Enrollment obj);