当前位置: 首页>>代码示例>>C#>>正文


C# DBFunctions.getstudenoffercourses方法代码示例

本文整理汇总了C#中DBFunctions.getstudenoffercourses方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.getstudenoffercourses方法的具体用法?C# DBFunctions.getstudenoffercourses怎么用?C# DBFunctions.getstudenoffercourses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBFunctions的用法示例。


在下文中一共展示了DBFunctions.getstudenoffercourses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getcourses

    public void getcourses()
    {
        DatabaseFunctions d = new DatabaseFunctions();
        int User = d.GetCandidateID(Userid);
        int candidate = User;
        DBFunctions db = new DBFunctions();

        List<OfferedCourses_tbl> courses = db.getstudenoffercourses(candidate);
        Heading.Text = "<b class='heading'>Offered Courses for Programme " + db.getstudentprogram(candidate).ProgramName + "</b><br><br>";
        foreach (var c in courses)
        {
            Enroll_Course ec = c.Courses_tbl.Enroll_Course.Where(x => x.Uid == candidate).FirstOrDefault();
            if (ec == null) 
            {
                coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' id='Check_"+c.CourseID+"'+ class='btn btn-primary enroll' data-courseid='" + c.CourseID + "' data-credithours='"+c.Courses_tbl.Credit_Hours+"' >Enroll</a></td></tr>";
            }
            else
            {
                if (ec.Status == 0)
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' class='btn btn-info' data-courseid='" + c.CourseID + "' >Pending </a></td></tr>";
                else if (ec.Status == 1)
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' class='btn btn-default' data-courseid='" + c.CourseID + "' >Already Enrolled </a></td></tr>";
                else if (ec.Status == -1)
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' class='btn btn-danger' data-courseid='" + c.CourseID + "' >Rejected </a></td></tr>";
                else if (ec.Status == 3) //status=3 for fail course
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' id='Check_" + c.CourseID + "'+ class='btn btn-danger enroll' data-courseid='" + c.CourseID + "' data-credithours='" + c.Courses_tbl.Credit_Hours + "' >ReEnroll</a></td></tr>";
            }
        }

    
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:31,代码来源:EnrollCourse.aspx.cs

示例2: dropdownstatus_SelectedIndexChanged

    protected void dropdownstatus_SelectedIndexChanged(object sender, EventArgs e)
    {
        int flag = -1;
        int candidate = uid;
        coursetablelbl.Text = "";
        DBFunctions db = new DBFunctions();

        List<OfferedCourses_tbl> courses = db.getstudenoffercourses(candidate);
        Heading.Text = "<b class='heading'>Offered Courses for Programme " + db.getstudentprogram(candidate).ProgramName + "</b><br><br>";
        if (dropdownstatus.SelectedItem.Text == "All")
        {
            flag = 1;

            getcourses();
            return;
        }
        foreach (var c in courses)
        {
            Enroll_Course ec = c.Courses_tbl.Enroll_Course.Where(x => x.Uid == candidate).FirstOrDefault();
            if (dropdownstatus.SelectedItem.Text == "New")
            {
                flag = 1;
                if (ec == null) //status=3 for fail course
                {
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' class='btn btn-primary enroll' data-courseid='" + c.CourseID + "' >Enroll</a></td></tr>";
                }
            }
                
            else if (ec!=null && ec.Status == int.Parse(dropdownstatus.SelectedValue))
            {
                flag = 1;
                if (ec.Status == 0)
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' class='btn btn-info' data-courseid='" + c.CourseID + "' >Pending </a></td></tr>";
                else if (ec.Status == 1)
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' class='btn btn-default' data-courseid='" + c.CourseID + "' >Already Enrolled </a></td></tr>";
                else if (ec.Status == -1)
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' class='btn btn-danger' data-courseid='" + c.CourseID + "' >Rejected </a></td></tr>";
                else if (ec.Status == 3) //status=3 for fail course
                    coursetablelbl.Text += "<tr><td>" + c.Courses_tbl.Course + "</td><td>" + c.Courses_tbl.Marks + "</td><td>" + c.Courses_tbl.Fee + "</td><td>" + c.Courses_tbl.Credit_Hours + "</td><td>" + c.Courses_tbl.CourseCode + "</td><td><a href='#0' class='btn btn-danger enroll' data-courseid='" + c.CourseID + "' >ReEnroll</a></td></tr>";

            }
        }
        if (flag == -1)
        {
            coursetablelbl.Text = "<tr><td colspan=6>There is no " + dropdownstatus.SelectedItem.Text + " Couese(s)</td></tr>";
        }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:47,代码来源:EnrollCourse.aspx.cs


注:本文中的DBFunctions.getstudenoffercourses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。