public static DA.Student CreateStudent(DA.Major Major_Parameter, string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter) { DA.SampleDataContext context = new DA.SampleDataContext(); DA.Student obj = CreateStudent(context, Major_Parameter, SSN_Parameter, FirstName_Parameter, LastName_Parameter, Active_Parameter); context.SubmitChanges(); DA.Student.OnCacheNeedsRefresh(); return(obj); }
public static void DeleteStudent(DA.SampleDataContext context, int id) { DA.Student obj = GetByID(context, id); PerformPreDeleteLogic(context, obj); context.Students.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); }
public void DataBind(Student obj) { if (obj != null) { this.ObjectID = obj.ID; this.MajorField.SelectedValue = obj.MajorID.ToString(); this.SSNField.Text = obj.SSN; this.FirstNameField.Text = obj.FirstName; this.LastNameField.Text = obj.LastName; this.ActiveField.Checked = obj.Active; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); string idString = this.Request.QueryString["ID"]; int id; if (int.TryParse(idString, out id)) { this.Student = StudentLogic.GetByID(this.DataContext, id); if (!this.IsPostBack) this.EditControl.DataBind(this.Student); } }
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); }
public static DA.Student CreateStudent(DA.SampleDataContext context, DA.Major Major_Parameter, string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter) { DA.Student obj = new DA.Student(); obj.Major = Major_Parameter; obj.SSN = SSN_Parameter; obj.FirstName = FirstName_Parameter; obj.LastName = LastName_Parameter; obj.Active = Active_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Students.InsertOnSubmit(obj); PerformPostCreateLogic(context, obj); return(obj); }
public static Enrollment CreateEnrollment(Student Student_Parameter, Course Course_Parameter) { SampleObjectContext context = new SampleObjectContext(); Enrollment obj = CreateEnrollment(context, Student_Parameter, Course_Parameter); context.AcceptAllChanges(); Enrollment.OnCacheNeedsRefresh(); return obj; }
partial static void PerformPreDeleteLogic(SampleObjectContext context, Student obj) { if (obj.Enrollments != null) foreach (DataAccess.Enrollment enrollment in obj.Enrollments) EnrollmentLogic.DeleteEnrollment(context, enrollment.ID); }
public static DA.Student CreateStudent(DA.SampleDataContext context, DA.Major Major_Parameter, string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter) { DA.Student obj = new DA.Student(); obj.Major = Major_Parameter; obj.SSN = SSN_Parameter; obj.FirstName = FirstName_Parameter; obj.LastName = LastName_Parameter; obj.Active = Active_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Students.InsertOnSubmit(obj); PerformPostCreateLogic(context, obj); return obj; }
protected void ListControl_Edit(object sender, Student obj) { Response.Redirect(string.Format("Edit.aspx?ID={0}", obj.ID)); }
/// <summary>When implemented, validates that the object conforms to standard business rules using the supplied data context.</summary> partial static void Validate(SampleObjectContext context, Student obj);
/// <summary>When implemented, allows logic to be performed before the object is created using the supplied data context.</summary> static partial void PerformPreCreateLogic(DA.SampleDataContext context, DA.Student obj);
private void OnDelete(Student obj) { if (this.Delete != null) this.Delete(this, obj); }
private void OnEdit(Student obj) { if (this.Edit != null) this.Edit(this, obj); }
protected void EditControl_Saved(object sender, Student obj) { this.Response.Redirect("Default.aspx"); }
private void OnSaved(Student obj) { if (this.Saved != null) this.Saved(this, obj); }
public static DA.Student LoadStudentFromDataContext(this DA.Student obj, DA.SampleDataContext dataContext) { return(DA.Student.GetByID(dataContext, obj.ID)); }
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 Student CreateStudent(SampleObjectContext context, Major Major_Parameter, string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter) { Student obj = new Student(); obj.Major = Major_Parameter; obj.SSN = SSN_Parameter; obj.FirstName = FirstName_Parameter; obj.LastName = LastName_Parameter; obj.Active = Active_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Students.AddObject(obj); PerformPostCreateLogic(context, obj); return obj; }
/// <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, Student 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.Student 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, Student obj);
/// <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.Student obj);
protected void ListControl_Delete(object sender, Student obj) { StudentLogic.DeleteStudent(this.DataContext, obj.ID); this.DataContext.SubmitChanges(); BindList(); }