コード例 #1
0
    protected void ModifyStudentButton_Click(object sender, EventArgs e)
    {
        BCS RequestDirector = new BCS();

        Student EnrolledStudent = new Student();

        EnrolledStudent.StudentId = StudentIdTB.Text;
        EnrolledStudent.FirstName = FirstNameTextBox.Text;
        EnrolledStudent.LastName  = LastNameTextBox.Text;
        EnrolledStudent.Email     = EmailTextBox.Text;

        try
        {
            bool confirmation = RequestDirector.ModifyStudent(EnrolledStudent);
            if (confirmation)
            {
                MessageLabel.Text = ("Changed Successfully");
                Panel1.Visible    = false;
            }
            else
            {
                MessageLabel.Text = ("Change unsuccessful");
            }
        }
        catch (Exception ex)
        {
            MessageLabel.Text = "Change unsuccessful";
        }
    }
コード例 #2
0
        public void OnPostModifyStudent(string studentId, string firstName, string lastName, string email, string programList)
        {
            ModifiedStudent = new Student();

            ModifiedStudent.StudentId   = studentId;
            ModifiedStudent.FirstName   = firstName;
            ModifiedStudent.LastName    = lastName;
            ModifiedStudent.Email       = email;
            ModifiedStudent.ProgramCode = programList;

            Success = _requestDirector.ModifyStudent(ModifiedStudent);
            if (Success == true)
            {
                Message = "Student Update Successful";
            }
            else
            {
                Message = "Student Update failed";
            }
        }
コード例 #3
0
ファイル: FindStudent.cshtml.cs プロジェクト: ihugya1/BAIST
        public void OnPostEdit(string studentIDField)
        {
            if (ModelState.IsValid)
            {
                bool confirm = false;

                BCS RequestDirector = new BCS();

                Student modifyStudent = new Student()
                {
                    StudentID = studentIDField,
                    FirstName = FirstNameField,
                    LastName  = LastNameField,
                    Email     = EmailField
                };


                confirm = RequestDirector.ModifyStudent(modifyStudent);
                Message = $"Edit : {confirm}";
            }
        }
コード例 #4
0
        public void OnPost()
        {
            if (ModelState.IsValid)
            {
                bool    Confirmation;
                Student AcceptedStudent = new Student
                {
                    StudentID = StudentIDField,
                    FirstName = FirstNameField,
                    LastName  = LastNameField,
                    Email     = EmailField
                };
                BCS RequestDirector = new BCS();
                Confirmation = RequestDirector.ModifyStudent(AcceptedStudent);

                Message = $"Edit :{Confirmation} {AcceptedStudent.FirstName} {AcceptedStudent.LastName} {AcceptedStudent.StudentID}";
            }
            else
            {
                Message = $"Not Valid";
            }
        }