コード例 #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);
        }
コード例 #2
0
 public void DataBind(Semester obj)
 {
     if (obj != null)
     {
         this.ObjectID = obj.ID;
         this.BeginField.SelectedDate = obj.Begin;
         this.EndField.SelectedDate = obj.End;
         this.NameField.Text = obj.Name;
     }
 }
コード例 #3
0
        public static DA.Semester CreateSemester(DateTime Begin_Parameter, DateTime End_Parameter, string Name_Parameter)
        {
            DA.SampleDataContext context = new DA.SampleDataContext();
            DA.Semester          obj     = CreateSemester(context, Begin_Parameter, End_Parameter, Name_Parameter);

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

            return(obj);
        }
コード例 #4
0
        public static void DeleteSemester(DA.SampleDataContext context, int id)
        {
            DA.Semester obj = GetByID(context, id);

            PerformPreDeleteLogic(context, obj);

            context.Semesters.DeleteOnSubmit(obj);

            PerformPostDeleteLogic(context, obj);
        }
コード例 #5
0
        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;
        }
コード例 #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.Semester = SemesterLogic.GetByID(this.DataContext, id);

                    if (!this.IsPostBack)
                        this.EditControl.DataBind(this.Semester);
                }
        }
コード例 #7
0
        public static DA.Semester CreateSemester(DA.SampleDataContext context, DateTime Begin_Parameter, DateTime End_Parameter, string Name_Parameter)
        {
            DA.Semester obj = new DA.Semester();

            obj.Begin = Begin_Parameter;
            obj.End   = End_Parameter;
            obj.Name  = Name_Parameter;

            Validate(context, obj);

            PerformPreCreateLogic(context, obj);

            context.Semesters.InsertOnSubmit(obj);

            PerformPostCreateLogic(context, obj);

            return(obj);
        }
コード例 #8
0
        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;
        }
コード例 #9
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);
        }
コード例 #10
0
 private void OnSaved(Semester obj)
 {
     if (this.Saved != null)
         this.Saved(this, obj);
 }
コード例 #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.Semester obj);
コード例 #12
0
        /// <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, Semester obj);
コード例 #13
0
        /// <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, Semester obj);
コード例 #14
0
        public static Semester CreateSemester(SampleObjectContext context, DateTime Begin_Parameter, DateTime End_Parameter, string Name_Parameter)
        {
            Semester obj = new Semester();

            obj.Begin = Begin_Parameter;
            obj.End = End_Parameter;
            obj.Name = Name_Parameter;

            Validate(context, obj);

            PerformPreCreateLogic(context, obj);

            context.Semesters.AddObject(obj);

            PerformPostCreateLogic(context, obj);

            return obj;
        }
コード例 #15
0
 private void OnDelete(Semester obj)
 {
     if (this.Delete != null)
         this.Delete(this, obj);
 }
コード例 #16
0
 private void OnEdit(Semester obj)
 {
     if (this.Edit != null)
         this.Edit(this, obj);
 }
コード例 #17
0
 public static DA.Semester LoadSemesterFromDataContext(this DA.Semester obj, DA.SampleDataContext dataContext)
 {
     return(DA.Semester.GetByID(dataContext, obj.ID));
 }
コード例 #18
0
        /// <summary>When implemented, validates that the object conforms to standard business rules using the supplied data context.</summary>
partial         static void Validate(SampleObjectContext context, Semester obj);
コード例 #19
0
        public static DA.Semester CreateSemester(DA.SampleDataContext context, DateTime Begin_Parameter, DateTime End_Parameter, string Name_Parameter)
        {
            DA.Semester obj = new DA.Semester();

            obj.Begin = Begin_Parameter;
            obj.End = End_Parameter;
            obj.Name = Name_Parameter;

            Validate(context, obj);

            PerformPreCreateLogic(context, obj);

            context.Semesters.InsertOnSubmit(obj);

            PerformPostCreateLogic(context, obj);

            return obj;
        }
コード例 #20
0
 protected void ListControl_Delete(object sender, Semester obj)
 {
     SemesterLogic.DeleteSemester(this.DataContext, obj.ID);
     this.DataContext.AcceptAllChanges();
     BindList();
 }
コード例 #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.Semester obj);
コード例 #22
0
 protected void ListControl_Edit(object sender, Semester obj)
 {
     Response.Redirect(string.Format("Edit.aspx?ID={0}", obj.ID));
 }
コード例 #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.Semester obj);
コード例 #24
0
 protected void EditControl_Saved(object sender, Semester obj)
 {
     this.Response.Redirect("Default.aspx");
 }