本文整理汇总了C#中DBFunctions.addprogrammecourse方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.addprogrammecourse方法的具体用法?C# DBFunctions.addprogrammecourse怎么用?C# DBFunctions.addprogrammecourse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBFunctions
的用法示例。
在下文中一共展示了DBFunctions.addprogrammecourse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnupdatecourse_Click
protected void btnupdatecourse_Click(object sender, EventArgs e)
{
DBFunctions db = new DBFunctions();
//Program_tbl prgram = new Program_tbl { ID = id, ProgramName = ProgrammeNametxt.Text, SecondChoice = int.Parse(dropdownSecondChoise.SelectedValue), HasCampus = int.Parse(dropdownCampus.SelectedValue), ApplicationFee = txtApplicationFee.Text, FormNumber = txtFormNum.Text, ProgrameType = dropdownPrograms.SelectedValue, HasJambData = int.Parse(dropdownJamb.SelectedValue), HasBioDataSection = int.Parse(dropdownBioData.SelectedValue), HasPreviousRecord = int.Parse(dropdownPreviousRecord.SelectedValue), HasCBTSchedule = int.Parse(dropdownCbtSchedule.SelectedValue), HasOlevelResult = int.Parse(dropdownOlevel.SelectedValue), Enable = true, DeptID = int.Parse(DropDownDept.SelectedValue), CutoffPoints = Cuttofpointstxt.Text, DateCreated = DateTime.Now.Date, AcceptenceFee = txtAcceptenceFee.Text, FormCh = txtFormCh.Text };
Courses_tbl course = new Courses_tbl { ID = int.Parse(Request.QueryString["Courseid"]), Course = coursename.Text, Fee = Feetxt.Text, Marks = Markstxt.Text, CourseCode = CourseCode.Text, Credit_Hours = int.Parse(CreditHours.Text) };
db.updatecourse(course);
db.clearprogramcourses(int.Parse(Request.QueryString["Courseid"]));
foreach (ListItem item in checkbocprogamlist.Items)
{
if (item.Selected)
{
ProgrammeCourses_tbl programcourse = new ProgrammeCourses_tbl { CourseID = int.Parse(Request.QueryString["Courseid"]), ProgramID = int.Parse(item.Value) };
db.addprogrammecourse(programcourse);
}
}
Response.Redirect("ManageCourses.aspx");
}
示例2: btnaddprogramme_Click
protected void btnaddprogramme_Click(object sender, EventArgs e)
{
DBFunctions db = new DBFunctions();
var checkcourse= db.getcourselist().Where(x => x.CourseCode == CourseCode.Text).FirstOrDefault();
if (checkcourse == null)
{
//Program_tbl prgram = new Program_tbl { ProgramName = ProgrammeNametxt.Text, SecondChoice = int.Parse(dropdownSecondChoise.SelectedValue), HasCampus = int.Parse(dropdownCampus.SelectedValue), ApplicationFee = txtApplicationFee.Text, FormNumber = txtFormCh.Text, ProgrameType = dropdownPrograms.SelectedValue, HasJambData = int.Parse(dropdownJamb.SelectedValue), HasBioDataSection = int.Parse(dropdownBioData.SelectedValue), HasPreviousRecord = int.Parse(dropdownPreviousRecord.SelectedValue), HasCBTSchedule = int.Parse(dropdownCbtSchedule.SelectedValue), HasOlevelResult = int.Parse(dropdownOlevel.SelectedValue), Enable = true, DeptID = int.Parse(DropDownDept.SelectedValue), CutoffPoints = Cuttofpointstxt.Text, DateCreated = DateTime.Now.Date, AcceptenceFee = txtAcceptenceFee.Text, FormCh = txtFormCh.Text };
Courses_tbl course = new Courses_tbl { Course = coursename.Text, Fee = Feetxt.Text, Marks = Markstxt.Text, Credit_Hours = int.Parse(CreditHours.Text), CourseCode = CourseCode.Text };
int cid = db.addcourse(course);
foreach (ListItem chck in CheckBoxPrgramlist.Items)
{
if (chck.Selected)
{
ProgrammeCourses_tbl prgcrs = new ProgrammeCourses_tbl { ProgramID = int.Parse(chck.Value), CourseID = cid };
db.addprogrammecourse(prgcrs);
}
}
messagae.Text = "Course Successfully Added";
messagae.Visible = true;
// Response.Redirect("ManageCourses.aspx");
}
else
{
messagae.Text = "Course Code Already Exist";
messagae.Visible = true;
}
}