public void DataBind(Major obj) { if (obj != null) { this.ObjectID = obj.ID; this.NameField.Text = obj.Name; } }
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 DA.Major CreateMajor(string Name_Parameter) { DA.SampleDataContext context = new DA.SampleDataContext(); DA.Major obj = CreateMajor(context, Name_Parameter); context.SubmitChanges(); DA.Major.OnCacheNeedsRefresh(); return(obj); }
public static void DeleteMajor(DA.SampleDataContext context, int id) { DA.Major obj = GetByID(context, id); PerformPreDeleteLogic(context, obj); context.Majors.DeleteOnSubmit(obj); PerformPostDeleteLogic(context, 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.Major = MajorLogic.GetByID(this.DataContext, id); if (!this.IsPostBack) this.EditControl.DataBind(this.Major); } }
public static DA.Major CreateMajor(DA.SampleDataContext context, string Name_Parameter) { DA.Major obj = new DA.Major(); obj.Name = Name_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Majors.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); }
private void OnSaved(Major obj) { if (this.Saved != null) this.Saved(this, 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, Major obj);
protected void ListControl_Delete(object sender, Major obj) { MajorLogic.DeleteMajor(this.DataContext, obj.ID); this.DataContext.SubmitChanges(); BindList(); }
public static DA.Major LoadMajorFromDataContext(this DA.Major obj, DA.SampleDataContext dataContext) { return(DA.Major.GetByID(dataContext, obj.ID)); }
private void OnEdit(Major obj) { if (this.Edit != null) this.Edit(this, obj); }
protected void EditControl_Saved(object sender, Major obj) { this.Response.Redirect("Default.aspx"); }
protected void ListControl_Edit(object sender, Major obj) { Response.Redirect(string.Format("Edit.aspx?ID={0}", obj.ID)); }
/// <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.Major obj);
public static Major CreateMajor(SampleObjectContext context, string Name_Parameter) { Major obj = new Major(); obj.Name = Name_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Majors.AddObject(obj); PerformPostCreateLogic(context, obj); return 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, Major 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, Major 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.Major obj);
public static Student CreateStudent(Major Major_Parameter, string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter) { SampleObjectContext context = new SampleObjectContext(); Student obj = CreateStudent(context, Major_Parameter, SSN_Parameter, FirstName_Parameter, LastName_Parameter, Active_Parameter); context.AcceptAllChanges(); Student.OnCacheNeedsRefresh(); return 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.Major 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; }
public static DA.Major CreateMajor(DA.SampleDataContext context, string Name_Parameter) { DA.Major obj = new DA.Major(); obj.Name = Name_Parameter; Validate(context, obj); PerformPreCreateLogic(context, obj); context.Majors.InsertOnSubmit(obj); PerformPostCreateLogic(context, obj); return obj; }
private void OnDelete(Major obj) { if (this.Delete != null) this.Delete(this, obj); }