本文整理汇总了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>";
}
}
}
示例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>";
}
}