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