Esempio n. 1
0
        public static DA.Course CreateCourse(DA.Semester Semester_Parameter, DA.Teacher Teacher_Parameter, string Number_Parameter, string Name_Parameter, DO.CourseStatus Status_Parameter)
        {
            DA.SampleDataContext context = new DA.SampleDataContext();
            DA.Course            obj     = CreateCourse(context, Semester_Parameter, Teacher_Parameter, Number_Parameter, Name_Parameter, Status_Parameter);

            context.SubmitChanges();
            DA.Course.OnCacheNeedsRefresh();

            return(obj);
        }
Esempio n. 2
0
        public static DA.Teacher CreateTeacher(string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter)
        {
            DA.SampleDataContext context = new DA.SampleDataContext();
            DA.Teacher           obj     = CreateTeacher(context, SSN_Parameter, FirstName_Parameter, LastName_Parameter, Active_Parameter);

            context.SubmitChanges();
            DA.Teacher.OnCacheNeedsRefresh();

            return(obj);
        }
Esempio n. 3
0
        public static void DeleteTeacher(DA.SampleDataContext context, int id)
        {
            DA.Teacher obj = GetByID(context, id);

            PerformPreDeleteLogic(context, obj);

            context.Teachers.DeleteOnSubmit(obj);

            PerformPostDeleteLogic(context, obj);
        }
        public static Course CreateCourse(Semester Semester_Parameter, Teacher Teacher_Parameter, string Number_Parameter, string Name_Parameter, CourseStatus Status_Parameter)
        {
            SampleObjectContext context = new SampleObjectContext();
            Course obj = CreateCourse(context, Semester_Parameter, Teacher_Parameter, Number_Parameter, Name_Parameter, Status_Parameter);

            context.AcceptAllChanges();
            Course.OnCacheNeedsRefresh();

            return obj;
        }
 public void DataBind(Teacher obj)
 {
     if (obj != null)
     {
         this.ObjectID = obj.ID;
         this.SSNField.Text = obj.SSN;
         this.FirstNameField.Text = obj.FirstName;
         this.LastNameField.Text = obj.LastName;
         this.ActiveField.Checked = obj.Active;
     }
 }
Esempio n. 6
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

                string idString = this.Request.QueryString["ID"];
                int id;

                if (int.TryParse(idString, out id))
                {
                    this.Teacher = TeacherLogic.GetByID(this.DataContext, id);

                    if (!this.IsPostBack)
                        this.EditControl.DataBind(this.Teacher);
                }
        }
Esempio n. 7
0
        public static DA.Teacher CreateTeacher(DA.SampleDataContext context, string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter)
        {
            DA.Teacher obj = new DA.Teacher();

            obj.SSN       = SSN_Parameter;
            obj.FirstName = FirstName_Parameter;
            obj.LastName  = LastName_Parameter;
            obj.Active    = Active_Parameter;

            Validate(context, obj);

            PerformPreCreateLogic(context, obj);

            context.Teachers.InsertOnSubmit(obj);

            PerformPostCreateLogic(context, obj);

            return(obj);
        }
        public static Course CreateCourse(SampleObjectContext context, Semester Semester_Parameter, Teacher Teacher_Parameter, string Number_Parameter, string Name_Parameter, CourseStatus Status_Parameter)
        {
            Course obj = new Course();

            obj.Semester = Semester_Parameter;
            obj.Teacher = Teacher_Parameter;
            obj.Number = Number_Parameter;
            obj.Name = Name_Parameter;
            obj.Status = Status_Parameter;

            Validate(context, obj);

            PerformPreCreateLogic(context, obj);

            context.Courses.AddObject(obj);

            PerformPostCreateLogic(context, obj);

            return obj;
        }
 protected void ListControl_Edit(object sender, Teacher obj)
 {
     Response.Redirect(string.Format("Edit.aspx?ID={0}", obj.ID));
 }
 protected void ListControl_Delete(object sender, Teacher obj)
 {
     TeacherLogic.DeleteTeacher(this.DataContext, obj.ID);
     this.DataContext.AcceptAllChanges();
     BindList();
 }
Esempio n. 11
0
 /// <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.Teacher obj);
        public static Teacher CreateTeacher(SampleObjectContext context, string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter)
        {
            Teacher obj = new Teacher();

            obj.SSN = SSN_Parameter;
            obj.FirstName = FirstName_Parameter;
            obj.LastName = LastName_Parameter;
            obj.Active = Active_Parameter;

            Validate(context, obj);

            PerformPreCreateLogic(context, obj);

            context.Teachers.AddObject(obj);

            PerformPostCreateLogic(context, obj);

            return obj;
        }
 private void OnSaved(Teacher obj)
 {
     if (this.Saved != null)
         this.Saved(this, obj);
 }
 private void OnEdit(Teacher obj)
 {
     if (this.Edit != null)
         this.Edit(this, obj);
 }
 private void OnDelete(Teacher obj)
 {
     if (this.Delete != null)
         this.Delete(this, obj);
 }
Esempio n. 16
0
        public static DA.Course CreateCourse(DA.SampleDataContext context, DA.Semester Semester_Parameter, DA.Teacher Teacher_Parameter, string Number_Parameter, string Name_Parameter, DO.CourseStatus Status_Parameter)
        {
            DA.Course obj = new DA.Course();

            obj.Semester = Semester_Parameter;
            obj.Teacher  = Teacher_Parameter;
            obj.Number   = Number_Parameter;
            obj.Name     = Name_Parameter;
            obj.Status   = Status_Parameter;

            Validate(context, obj);

            PerformPreCreateLogic(context, obj);

            context.Courses.InsertOnSubmit(obj);

            PerformPostCreateLogic(context, obj);

            return(obj);
        }
Esempio n. 17
0
 public static DA.Teacher LoadTeacherFromDataContext(this DA.Teacher obj, DA.SampleDataContext dataContext)
 {
     return(DA.Teacher.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, Teacher 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, Teacher 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, Teacher obj);
Esempio n. 21
0
 /// <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.Teacher obj);
        public static DA.Teacher CreateTeacher(DA.SampleDataContext context, string SSN_Parameter, string FirstName_Parameter, string LastName_Parameter, bool Active_Parameter)
        {
            DA.Teacher obj = new DA.Teacher();

            obj.SSN = SSN_Parameter;
            obj.FirstName = FirstName_Parameter;
            obj.LastName = LastName_Parameter;
            obj.Active = Active_Parameter;

            Validate(context, obj);

            PerformPreCreateLogic(context, obj);

            context.Teachers.InsertOnSubmit(obj);

            PerformPostCreateLogic(context, obj);

            return obj;
        }
Esempio n. 23
0
 /// <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.Teacher obj);
Esempio n. 24
0
 protected void EditControl_Saved(object sender, Teacher obj)
 {
     this.Response.Redirect("Default.aspx");
 }