本文整理汇总了C#中DBFunctions.getprogramslist方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.getprogramslist方法的具体用法?C# DBFunctions.getprogramslist怎么用?C# DBFunctions.getprogramslist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBFunctions
的用法示例。
在下文中一共展示了DBFunctions.getprogramslist方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: binddata
private void binddata()
{
DBFunctions db = new DBFunctions();
Programtxt.DataSource = db.getprogramslist();
Programtxt.DataValueField = "ID";
Programtxt.DataTextField = "ProgramName";
Programtxt.DataBind();
Sectiontxt.DataSource = db.getformSectionlist();
Sectiontxt.DataTextField = "Section";
Sectiontxt.DataValueField = "ID";
Sectiontxt.DataBind();
Datatype dt=new Datatype();
Datatypetxt.DataSource = dt.datatypelist;
Datatypetxt.DataTextField = "type";
Datatypetxt.DataValueField = "type";
Datatypetxt.DataBind();
Controltxt.DataSource = dt.controllist;
//Controltxt.DataSource = dt.datatypelist;
Controltxt.DataTextField = "type";
Controltxt.DataValueField = "type";
Controltxt.DataBind();
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["admin"] == null)
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
if (!IsPostBack)
{
DBFunctions db = new DBFunctions();
Programlist.DataSource= db.getprogramslist();
Programlist.DataTextField = "ProgramName";
Programlist.DataValueField = "ID";
Programlist.DataBind();
Batchlist.DataSource = db.getactivebatchlist();
Batchlist.DataTextField = "BatchYear";
Batchlist.DataValueField = "ID";
Batchlist.DataBind();
}
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagname = Path.GetFileName(Request.PhysicalPath);
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["admin"] != null)
{
if (!IsPostBack)
{
DBFunctions db = new DBFunctions();
Dropdownprogramme.Items.Add(new System.Web.UI.WebControls.ListItem("All Programmes", "All"));
Dropdownprogramme.DataSource = db.getprogramslist();
Dropdownprogramme.DataTextField = "ProgramName";
Dropdownprogramme.DataValueField = "ID";
Dropdownprogramme.DataBind();
if (Request.QueryString["page"] != null)
{
page = int.Parse(Request.QueryString["page"]);
}
var applicants = db.getapplicantlist(page - 1, pagesize);
loadcandidates(applicants);
}
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string action = Request.QueryString["action"];
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["admin"] != null)
{
if (Request.QueryString["Courseid"] != null)
{
id = int.Parse(Request.QueryString["Courseid"]);
if (!IsPostBack)
{
DBFunctions db = new DBFunctions();
if (action == "update")
{
checkbocprogamlist.DataSource = db.getprogramslist();
checkbocprogamlist.DataValueField = "ID";
checkbocprogamlist.DataTextField = "ProgramName";
checkbocprogamlist.DataBind();
foreach(ListItem item in checkbocprogamlist.Items)
{
var check=db.getprogramcours(int.Parse(item.Value),id);
if (check != null)
{
item.Selected = true;
}
}
Courses_tbl course = db.getcourses(id);
coursename.Text = course.Course;
Feetxt.Text = course.Fee;
Markstxt.Text = course.Marks;
CourseCode.Text = course.CourseCode;
CreditHours.Text = course.Credit_Hours.ToString();
}
else
{
}
}
}
else
{
Response.Redirect("ManageCourses.aspx");
}
}
else
{
if(id!=-1)
Response.Redirect("Login.aspx?Redirecturl=" + pagename + "?Courseid="+id+"&action=update");
else
Response.Redirect("Login.aspx?Redirecturl="+pagename);
}
}
示例5: setprogrammes
private void setprogrammes()
{
DBFunctions db = new DBFunctions();
DropDownProgram.DataSource = db.getprogramslist();
DropDownProgram.DataTextField = "ProgramName";
DropDownProgram.DataValueField = "ID";
DropDownProgram.DataBind();
}
示例6: setprogrammes
private void setprogrammes()
{
DBFunctions db = new DBFunctions();
if(DropDownDept.SelectedValue=="")
{
DropDownprogramme.DataSource = null;
DropDownprogramme.DataTextField = "";
DropDownprogramme.DataValueField = "";
return;
}
int deptid =int.Parse(DropDownDept.SelectedValue);
DropDownprogramme.DataSource= db.getprogramslist().Where(x=>x.DeptID==deptid);
DropDownprogramme.DataTextField = "ProgramName";
DropDownprogramme.DataValueField = "ID";
DropDownprogramme.DataBind();
}
示例7: DropDowndepartment_SelectedIndexChanged
protected void DropDowndepartment_SelectedIndexChanged(object sender, EventArgs e)
{
DBFunctions db = new DBFunctions();
if(DropDowndepartment.SelectedValue==""){
return;
}
int deptid=int.Parse(DropDowndepartment.SelectedValue);
var programs = db.getprogramslist().Where(x => x.DeptID == deptid).ToList();
Program_tbl prgrm=new Program_tbl{ProgramName="Select Programme"};
programs.Add(prgrm);
DropDownprogramme.DataSource = programs.OrderBy(x=>x.ID);
DropDownprogramme.DataTextField = "ProgramName";
DropDownprogramme.DataValueField = "ID";
DropDownprogramme.DataBind();
DropDownteacher.DataSource = db.getallemployee(0, db.getemployee_count(deptid), deptid);
DropDownteacher.DataTextField = "Name";
DropDownteacher.DataValueField = "ID";
DropDownteacher.DataBind();
}
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["admin"] != null)
{
DBFunctions db = new DBFunctions();
List<Program_tbl> programs = db.getprogramslist();
foreach (Program_tbl prg in programs)
{
programstbl.Text += "<tr><td>" + prg.ProgramName + "</td><td>" + prg.ProgramType + "</td><td>" + prg.Department_tbl.Department + "</td><td>" + prg.ApplicationFee + "</td><td>" + prg.AcceptenceFee + "</td><td>";
if (prg.Enable == true)
{
programstbl.Text += "<a href='#0' class='btn btn-danger btn-action Disable' data-id=" + prg.ID + ">Disable</a> ";
}
else
{
programstbl.Text += "<a href='#0' class='btn btn-primary btn-action Enable' data-id=" + prg.ID + ">Enable</a> ";
}
programstbl.Text += "<a href='#0' class='btn btn-primary btn-action update' data-id=" + prg.ID + ">Update</a></td></tr>";
}
DropDownDept.DataSource = db.getalldepartments();
ListItem item = new ListItem();
item.Text = "Select Department";
item.Value = "";
DropDownDept.Items.Add(item);
DropDownDept.DataTextField = "Department";
DropDownDept.DataValueField = "ID";
DropDownDept.DataBind();
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}
示例9: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["userid"] != null)
{
DBFunctions db = new DBFunctions();
if (!IsPostBack)
{
DropDownprogram.DataSource = db.getprogramslist();
DropDownprogram.Items.Add("--Select Programme--");
DropDownprogram.DataTextField = "ProgramName";
DropDownprogram.DataValueField = "ID";
DropDownprogram.DataBind();
}
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}
示例10: Page_Load
//.........这里部分代码省略.........
literalEnd.Text = pageEnd.ToString();
}
string tmpUrl = string.Empty;
tmpUrl = "ManageCourses.aspx?" + Request.QueryString.ToString();
if (tmpUrl.Contains("?page"))
{
tmpUrl = tmpUrl.Remove(tmpUrl.IndexOf("?page"));
}
StringBuilder listingString = new StringBuilder();
if (ds != null)
{
loadCourse(ds);
}
if (pageEnd > 10)
{
StringBuilder paging = new StringBuilder();
int counterPage = 1;
int totalPages = 1;
totalPages = (pageEnd / 10) + 1;
string urlMain = string.Empty;
urlMain = Request.Url.ToString();
if (urlMain.Contains("?page"))
{
urlMain = urlMain.Remove(urlMain.IndexOf("?page"));
}
for (int i = 1; i <= totalPages; i++)
{
string newPageString = string.Empty;
if (i == 1)
{
newPageString = "<li><a aria-label=\"First\" href=\"" + urlMain + "\" ><<</a></li>";
if (page == i)
{
newPageString += "<li><a style=\"color:#000000;background: #f0f0f0;\" href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
}
else
{
newPageString += "<li><a href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
}
}
else if (i == totalPages)
{
if (page == i)
{
newPageString += "<li><a style=\"color:#000000;background: #f0f0f0;\" href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
}
else
{
newPageString += "<li><a href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
}
newPageString += "<li><a aria-label=\"Last\" href=\"" + urlMain + "?page=" + totalPages + "\" >>></a></li>";
}
else
{
if (page == i)
{
newPageString += "<li><a style=\"color:#000000;background: #f0f0f0;\" href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
}
else
{
newPageString += "<li><a href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
}
}
counterPage++;
paging.Append(newPageString);
}
literalPaging.Text = paging.ToString();
}
CheckBoxPrgramlist.DataSource = db.getprogramslist();
CheckBoxPrgramlist.DataTextField = "ProgramName";
CheckBoxPrgramlist.DataValueField = "ID";
CheckBoxPrgramlist.DataBind();
}
if (IsPostBack)
{
nameDiv.Attributes.Add("class","show");
}
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}