本文整理汇总了C#中DBFunctions.getemployee_count方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.getemployee_count方法的具体用法?C# DBFunctions.getemployee_count怎么用?C# DBFunctions.getemployee_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBFunctions
的用法示例。
在下文中一共展示了DBFunctions.getemployee_count方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: loademployees
private void loademployees()
{
int pageStart = 1;
int pageEnd = 10;
if (Request.QueryString.ToString().Contains("page"))
{
page = Convert.ToInt32(Request.QueryString["page"].ToString());
pageEnd = pageSize * page;
pageStart = (pageEnd - pageSize) + 1;
}
literalStart.Text = pageStart.ToString();
literalEnd.Text = pageEnd.ToString();
DBFunctions db = new DBFunctions();
List<Employee_tbl> employees = new List<Employee_tbl>();
if (Request.QueryString["dept"] == null || Request.QueryString["dept"]=="All")
{
employees = db.getallemployee(page - 1, pageSize, 0);
pageEnd = db.getemployee_count(0);
}
else
{
int deptid = int.Parse(Request.QueryString["dept"]);
employees = db.getallemployee(page - 1, pageSize, deptid);
pageEnd = db.getemployee_count(deptid);
DropDowndepartment.SelectedValue = deptid.ToString();
}
if (pageEnd > 10)
{
literalTotal.Text = pageEnd.ToString();
int pagett = 0;
pagett = Convert.ToInt16(literalEnd.Text);
if (pagett > pageEnd)
{
literalEnd.Text = pageEnd.ToString();
}
}
else
{
if (pageEnd == 0)
{
literalStart.Text = "";
}
literalTotal.Text = pageEnd.ToString();
literalEnd.Text = pageEnd.ToString();
}
string tmpUrl = string.Empty;
tmpUrl = "ManageEmployees.aspx?" + Request.QueryString.ToString();
if (tmpUrl.Contains("?page"))
{
tmpUrl = tmpUrl.Remove(tmpUrl.IndexOf("?page"));
}
StringBuilder listingString = new StringBuilder();
renderemployees(employees);
setpaging(pageEnd);
}
示例3: loadleavrequests
private void loadleavrequests()
{
int pageStart = 1;
int pageEnd = 10;
if (Request.QueryString.ToString().Contains("page"))
{
page = Convert.ToInt32(Request.QueryString["page"].ToString());
pageEnd = pageSize * page;
pageStart = (pageEnd - pageSize) + 1;
}
literalStart.Text = pageStart.ToString();
literalEnd.Text = pageEnd.ToString();
DBFunctions db = new DBFunctions();
int status = 0;
List<Leave> leaves = new List<Leave>();
if (Request.QueryString["status"] == null || Request.QueryString["status"] == "0")
{
leaves = db.getleaverequests(page - 1, pageSize, status);
pageEnd = db.getleaves_count(0);
}
else if(Request.QueryString["status"] == "All")
{
leaves = db.getleaverequests(page - 1, pageSize, 5);
pageEnd = db.getemployee_count(status);
DropDownstatus.SelectedValue = "All";
}
else
{
status = int.Parse(Request.QueryString["status"]);
leaves = db.getleaverequests(page - 1, pageSize, status);
pageEnd = db.getemployee_count(status);
DropDownstatus.SelectedValue = status.ToString();
}
if (pageEnd > 10)
{
literalTotal.Text = pageEnd.ToString();
int pagett = 0;
pagett = Convert.ToInt16(literalEnd.Text);
if (pagett > pageEnd)
{
literalEnd.Text = pageEnd.ToString();
}
}
else
{
if (pageEnd == 0)
{
literalStart.Text = "";
}
literalTotal.Text = pageEnd.ToString();
literalEnd.Text = pageEnd.ToString();
}
string tmpUrl = string.Empty;
tmpUrl = "ViewLeaveRequests.aspx?" + Request.QueryString.ToString();
if (tmpUrl.Contains("?page"))
{
tmpUrl = tmpUrl.Remove(tmpUrl.IndexOf("?page"));
}
StringBuilder listingString = new StringBuilder();
rendeleaves(leaves);
setpaging(pageEnd);
}
示例4: DropDowndepartment_SelectedIndexChanged
protected void DropDowndepartment_SelectedIndexChanged(object sender, EventArgs e)
{
DBFunctions db = new DBFunctions();
List<Employee_tbl> emp=new List<Employee_tbl>();
int pageStart = 1;
int pageEnd = 10;
if (DropDowndepartment.SelectedValue != "All")
{
int deptid = int.Parse(DropDowndepartment.SelectedValue);
emp = db.getallemployee(0, 10,deptid);
renderemployees(emp);
pageEnd = db.getemployee_count(deptid);
}
else
{
emp = db.getallemployee(0, 10,0);
renderemployees(emp);
pageEnd = db.getemployee_count(0);
}
//if (Request.QueryString.ToString().Contains("page"))
//{
//page = Convert.ToInt32(Request.QueryString["page"].ToString());
// pageEnd = pageSize * page;
int total = pageEnd;
pageStart = (pageSize * page - pageSize) + 1;
// pageEnd = db.getemployee_count(0);
//}
literalStart.Text = pageStart.ToString();
if (pageEnd > 10)
{
pageEnd = pageSize * page;
}
literalEnd.Text = pageEnd.ToString();
literalTotal.Text = total.ToString();
setpaging(total);
}