예제 #1
0
        protected void ProgramCoursesGridView_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow agvrow = ProgramCoursesGridView.Rows[ProgramCoursesGridView.SelectedIndex];

            //try
            //{
            ProgramCoursesController sysmgr = new ProgramCoursesController();
            ProgramCourses           info   = sysmgr.ProgramCourse_Find(int.Parse(agvrow.Cells[1].Text));

            updateView(info);


            //}
        }
예제 #2
0
        protected void Select_Click(object sender, EventArgs e)
        {
            //use the program and course to find programcourse
            //fill individual web controls with the programcourse record

            //test if set info has any records
            //  info.Count() == 0 bad else good
            if (CoursesList.SelectedIndex == 0)
            {
                errormsgs.Add("Select a courses.");
                LoadMessageDisplay(errormsgs, "alert a alert-info");
            }
            //once you have made your call to get your record
            //info[0] is tyhe first record
            // ProgramCourseID.Text = info[0].ProgramCourseId;
            else
            {
                try
                {
                    ProgramCoursesController sysmgr = new ProgramCoursesController();
                    List <ProgramCourses>    info   = sysmgr.ProgramCourses_FindByProgramAndCourse(int.Parse(ProgramList.SelectedValue), CoursesList.SelectedValue);
                    if (info.Count == 0)
                    {
                        errormsgs.Add("No data found for the Program");
                        LoadMessageDisplay(errormsgs, "alert alertt-info");
                        ProgramCoursesGridView.DataSource = null;
                        ProgramCoursesGridView.DataBind();
                    }
                    else
                    {
                        info.Sort((x, y) => x.ProgramCourseID.CompareTo(y.ProgramCourseID));
                        ProgramCoursesGridView.DataSource = info;
                        ProgramCoursesGridView.DataBind();
                    }
                }
                catch (Exception ex)
                {
                    errormsgs.Add(GetInnerException(ex).ToString());
                    LoadMessageDisplay(errormsgs, "alert alert-danger");
                }
            }
        }