private void BindData() { int pageIndex = Request.QueryString["pageIndex"] != null?int.Parse(Request.QueryString["pageIndex"]) : 1; int pageSize = 10;//页面记录数 List <SignUp> list = new List <SignUp>(); //记录 int listCount = 0; //导航条 string strBar = string.Empty; //判断条件 if (Request.QueryString["type"] != null) { list = Entity.SignUp.Where(a => a.State != "待审").ToList(); //查询记录 if (string.IsNullOrEmpty(SreachWhere.Text)) { list = list.Where(a => true).ToList(); listCount = list.Count; list = list.OrderByDescending(a => a.ItemId).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } else { list = list.Where(a => a.SportsItem.Name.Contains(SreachWhere.Text) || a.SportsMan.Name.Contains(SreachWhere.Text)).ToList(); listCount = list.Count; list = list.OrderByDescending(a => a.ItemId).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } strBar = PageBar.GetPageBarType(pageIndex, listCount, pageSize); } else { list = Entity.SignUp.Where(a => a.State == "待审").ToList(); //查询记录 if (string.IsNullOrEmpty(SreachWhere.Text)) { list = list.Where(a => true).ToList(); listCount = list.Count; list = list.OrderByDescending(a => a.ItemId).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } else { list = list.Where(a => a.SportsItem.Name.Contains(SreachWhere.Text) || a.SportsMan.Name.Contains(SreachWhere.Text)).ToList(); listCount = list.Count; list = list.OrderByDescending(a => a.ItemId).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } listCount = Entity.SignUp.Where(a => a.State == "待审").Count(); strBar = PageBar.GetPageBar(pageIndex, listCount, pageSize); } //生成导航条 mPageBar = strBar; this.Repeater1.DataSource = list; this.Repeater1.DataBind(); }
private void ajaxGetAdminList() { string text = base.q("d1"); string text2 = base.q("d2"); string text3 = base.q("u"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); if (text.Trim().Length == 0) { text = this.StartTime; } if (text2.Trim().Length == 0) { text2 = this.EndTime; } if (Convert.ToDateTime(text) > Convert.ToDateTime(text2)) { text = text2; } string text4 = ""; if (text.Trim().Length > 0 && text2.Trim().Length > 0) { string text5 = text4; text4 = string.Concat(new string[] { text5, " STime >='", text, "' and STime <'", text2, "'" }); } this.doh.Reset(); this.doh.ConditionExpress = text4; int totalCount = this.doh.Count("V_AdminHistory"); string sql = SqlHelp.GetSql0("*", "V_AdminHistory", "Id", pageSize, num, "desc", text4); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"加载完成\",\"pagebar\" :\"", PageBar.GetPageBar(3, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
public void PageBar_GoToPreviousPage_Test_4() { using (var driver = new ChromeDriver()) { /* Initialization */ var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://tms.lionbridge.com/"); string projectTitle = "Qlik"; ProjectsPage testPage = new ProjectsPage(driver, projectTitle); testPage.ClickChosenProject(); ParticularProjectPage testProjectPage = new ParticularProjectPage(driver); testProjectPage.ProfileClick(driver); testProjectPage.ChangeItemsPerPageMin(driver); testProjectPage.StatusClick(driver); StatusPage testStatusPage = new StatusPage(driver); PageBar testPageBar = new PageBar(driver); testPageBar.GoToLastPage(driver); testPageBar = new PageBar(driver); /* Set of assertions */ Assert.AreEqual(testPageBar.GetLastPageNumber, testPageBar.GetCurrentPageNumber); Assert.AreEqual(0, testPageBar.PreviousPageIsNull); Assert.AreEqual(1, testPageBar.NextPageIsNull); testPageBar.GoToFirstPage(driver); testPageBar = new PageBar(driver); Assert.AreEqual(0, testPageBar.CurrentPageIsNull); Assert.AreEqual(1, testPageBar.CurrentPageIsFirst); Assert.AreEqual(0, testPageBar.CurrentPageIsLast); Assert.AreEqual(1, testPageBar.GetCurrentPageNumber); Assert.AreEqual(1, testPageBar.PreviousPageIsNull); Assert.AreEqual(0, testPageBar.NextPageIsNull); testPageBar.GoToPreviousPage(driver); testPageBar = new PageBar(driver); Assert.AreEqual(0, testPageBar.CurrentPageIsNull); Assert.AreEqual(1, testPageBar.CurrentPageIsFirst); Assert.AreEqual(0, testPageBar.CurrentPageIsLast); Assert.AreEqual(1, testPageBar.GetCurrentPageNumber); Assert.AreEqual(1, testPageBar.PreviousPageIsNull); Assert.AreEqual(0, testPageBar.NextPageIsNull); } }
public void Assignees_ParsingCorrectly_Test_6() { using (var driver = new ChromeDriver()) { /* Initialization */ Assignee auxiliaryAssignee; var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://tms.lionbridge.com/"); string projectTitle = ""; // Project Name ProjectsPage testPage = new ProjectsPage(driver, projectTitle); testPage.ClickChosenProject(); ParticularProjectPage testProjectPage = new ParticularProjectPage(driver); testProjectPage.StatusClick(driver); StatusPage testStatusPage = new StatusPage(driver); testStatusPage.AssigneesClick(driver); AssigneesPage assigneesPage = new AssigneesPage(driver); PageBar assigneesPageBar = new PageBar(driver); assigneesPageBar.ItemsPerPageSetMaximalValue(driver); assigneesPage = new AssigneesPage(driver); assigneesPage.ChosenActivityClick(driver, "InternalReview"); IReadOnlyCollection <IWebElement> r_LHObjects = driver.FindElements(By.ClassName("r_LH")); List <Assignee> assignees = new List <Assignee>(); foreach (IWebElement r_LH in r_LHObjects) { auxiliaryAssignee = new Assignee(r_LH); assignees.Add(auxiliaryAssignee); } /* Set of assertions */ Assert.AreNotEqual(0, assignees.Count); foreach (Assignee assignee in assignees) { Assert.IsFalse(assignee.AssigneeNameObjectIsNull); Assert.AreEqual(1, assignee.AssigneeNameObjectIsEnabled); Assert.AreEqual(0, assignee.AssigneeJobsNumberIsNull); Assert.AreEqual(true, assignee.IsParsingCorrect); Assert.AreNotEqual("", assignee.GetAssigneeName); Assert.AreNotEqual("", assignee.GetAssigneeJobsNumberString); Assert.AreNotEqual(0, assignee.GetAssingeeJobsNumberInt); } } }
private void ajaxGetYBList() { string text = base.q("keys"); string text2 = base.q("d1"); string text3 = base.q("d2"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); string text4 = ""; if (text2.Trim().Length == 0) { text2 = this.StartTime; } if (text3.Trim().Length == 0) { text3 = this.EndTime; } if (Convert.ToDateTime(text2) > Convert.ToDateTime(text3)) { text2 = text3; } if (text2.Trim().Length > 0 && text3.Trim().Length > 0) { string text5 = text4; text4 = string.Concat(new string[] { text5, " Convert(varchar(10),order_time,120) >='", text2, "' and Convert(varchar(10),order_time,120) <='", text3, "'" }); } this.doh.Reset(); this.doh.ConditionExpress = text4; int totalCount = this.doh.Count("Pay_YiBao_temp"); string sql = SqlHelp.GetSql0("ID,UserId,dbo.f_GetUserName(UserId) as UserName,order_no,order_amount,substring([order_time],1,4)+'-'+substring([order_time],5,2)+'-'+substring([order_time],7,2)+' '+substring([order_time],9,2)+':'+substring([order_time],11,2)+':'+substring([order_time],13,2) as order_time,trade_no,trade_status", "Pay_YiBao_temp", "Id", pageSize, num, "desc", text4); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(3, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
private void ajaxGetContractFHRecord() { string text = base.q("d1"); string text2 = base.q("d2"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); if (text.Trim().Length == 0) { text = this.StartTime; } if (text2.Trim().Length == 0) { text2 = this.EndTime; } if (Convert.ToDateTime(text) > Convert.ToDateTime(text2)) { text = text2; } string text3 = "AgentId=99 and dbo.f_GetUserCode(UserId) like '%," + this.AdminId + ",%'"; if (text.Trim().Length > 0 && text2.Trim().Length > 0) { string text4 = text3; text3 = string.Concat(new string[] { text4, " and STime >='", text, "' and STime <='", text2, "'" }); } this.doh.Reset(); this.doh.ConditionExpress = text3; int totalCount = this.doh.Count("V_AgentFHRecord"); string sql = SqlHelp.GetSql0("*", "V_AgentFHRecord a", "id", pageSize, num, "desc", text3); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(80, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
/* Methods */ public void SelectSingleJob(IWebDriver driver, int jobNumber) { if (AssigneesJobsListIsEmpty == false) { if (assigneesJobsList.ElementAt(jobNumber).JobsButtonIsEnabled == 1) { assigneePageBar = null; assigneesJobsList.ElementAt(jobNumber).AssigneeJobButtonClick(driver); assigneeJobMenu = new AssingeesOnClickJobsMenu(driver); } } }
public void SelectJob(IWebDriver driver, string jobName) { if (JobsListIsEmpty == false) { //if (jobsList.ElementAt(jobNumber).JobsButtonIsEnabled == 1) //{ jobsPageBar = null; jobsList.Find(x => x.GetJobsName.Equals(jobName)).JobButtonClick(driver); jobMenu = new JobsOnClickJobsMenu(driver); //} } }
private void ajaxGetListLottery() { string text = base.q("d1"); string text2 = base.q("d2"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); if (text.Trim().Length == 0) { text = Convert.ToDateTime(this.StartTime).ToString("yyyy-MM-dd"); } if (text2.Trim().Length == 0) { text2 = Convert.ToDateTime(this.EndTime).AddDays(1.0).ToString("yyyy-MM-dd"); } if (Convert.ToDateTime(text) > Convert.ToDateTime(text2)) { text = text2; } string text3 = ""; string text4 = string.Concat(new string[] { "STime >='", text, "' and STime <'", text2, "' and state>=2" }); this.doh.Reset(); this.doh.SqlCmd = "select LotteryId FROM [N_UserBet] where " + text4 + " group by LotteryId"; DataTable dataTable = this.doh.GetDataTable(); int count = dataTable.Rows.Count; text3 = text3 + " SELECT '99999' as rowNember,'9999' as [LotteryId],'全部合计' as [Title],\r\n cast(round(isnull(sum(Total*Times),0),4) as numeric(18,4)) as Bet ,isnull(sum(WinBonus),0) as Win,\r\n isnull(sum(num),0) as Num,isnull(sum(winnum),0) as WinNum,\r\n cast(round(CONVERT(float,isnull(sum(WinBonus),0))*100/CONVERT(float,isnull(sum(Total*Times),1)) ,4) as numeric(9,4)) as Per,\r\n isnull(sum(PointMoney),0) as Point,isnull(sum(-RealGet),0) as total FROM [N_UserBet] where " + text4; text3 += " union all "; text3 += SqlHelp.GetSqlRow("LotteryId,(select title from Sys_Lottery where Id=LotteryId) as Title,\r\n cast(round(isnull(sum(Total*Times),0),4) as numeric(18,4)) as Bet ,isnull(sum(WinBonus),0) as Win,\r\n isnull(sum(num),0) as Num,isnull(sum(winnum),0) as WinNum,\r\n cast(round(CONVERT(float,isnull(sum(WinBonus),0))*100/CONVERT(float,isnull(sum(Total*Times),1)) ,4) as numeric(9,4)) as Per,\r\n isnull(sum(PointMoney),0) as Point,isnull(sum(-RealGet),0) as total", "N_UserBet", "LotteryId", pageSize, num, "asc", text4, "LotteryId"); this.doh.Reset(); this.doh.SqlCmd = text3; DataTable dataTable2 = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(3, "js", 2, count, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable2), "}" }); dataTable2.Clear(); dataTable2.Dispose(); }
public void SelectJob(IWebDriver driver, int jobNumber) { if (JobsListIsEmpty == false) { //if (jobsList.ElementAt(jobNumber).JobsButtonIsEnabled == 1) //{ jobsPageBar = null; jobsList.ElementAt(jobNumber).JobButtonClick(driver); jobMenu = new JobsOnClickJobsMenu(driver); //} } }
public string PageList(int mode, int totalCount, int PSize, int currentPage, string[] FieldName, string[] FieldValue) { string str1 = HttpContext.Current.Request.ServerVariables["Script_Name"].ToString(); string str2 = ""; for (int index = 0; index < FieldName.Length; ++index) { str2 = str2 + FieldName[index].ToString() + "=" + FieldValue[index].ToString() + "&"; } string HttpN = str1 + "?" + str2 + "page=<#page#>"; return(PageBar.GetPageBar(mode, "html", 0, totalCount, PSize, currentPage, HttpN)); }
public void PageBar_ParsingCorrectly_Test_2() { using (var driver = new ChromeDriver()) { /* Initialization */ var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://tms.lionbridge.com/"); string projectTitle = "Qlik"; ProjectsPage testPage = new ProjectsPage(driver, projectTitle); testPage.ClickChosenProject(); ParticularProjectPage testProjectPage = new ParticularProjectPage(driver); testProjectPage.ProfileClick(driver); testProjectPage.ChangeItemsPerPageMin(driver); testProjectPage.StatusClick(driver); StatusPage testStatusPage = new StatusPage(driver); testStatusPage.ActivitiesFilterClick(driver); testStatusPage.ChosenActivityClick(driver, "Buffer_for_FreewayReview_H"); PageBar testPageBar = new PageBar(driver); /* Set of assertions */ Assert.IsFalse(testPageBar.PageBarContainerIsNull); Assert.AreEqual(1, testPageBar.PageBarContainerIsDisplayed); Assert.AreEqual(0, testPageBar.NumberOfAllItemsIsNull); Assert.AreEqual(1, testPageBar.NumberOfAllItemsIsDisplayed); Assert.IsTrue(testPageBar.IsParsingCorrect); Assert.IsTrue(testPageBar.GetNumberOfAllItems > 0); Assert.AreEqual(1, testPageBar.PageNavigationContainerIsNull); Assert.AreEqual(-1, testPageBar.CurrentPageIsFirst); Assert.AreEqual(-1, testPageBar.GetCurrentPageNumber); Assert.AreEqual(-1, testPageBar.CurrentPageIsLast); Assert.AreEqual(-1, testPageBar.GetLastPageNumber); Assert.AreEqual(-1, testPageBar.NextPageIsNull); Assert.AreEqual(-1, testPageBar.PreviousPageIsNull); } }
/* Methods */ public IWebElement GetJobElement(IWebDriver driver, string jobName) { if (JobsListIsEmpty == false) { //if (jobsList.ElementAt(jobNumber).JobsButtonIsEnabled == 1) //{ jobsPageBar = null; return(jobsList.Find(x => x.GetJobsName.Equals(jobName)).jobsName); //} } else { return(null); } }
private void BindData() { int pageIndex = Request.QueryString["pageIndex"] != null?int.Parse(Request.QueryString["pageIndex"]) : 1; int pageSize = 10;//页面记录数 List <SportsMan> list = new List <SportsMan>(); List <Rank> RankList = new List <Rank>(); list = Entity.SportsMan.Where(a => true).ToList(); foreach (var item in list) { Rank rank = new Rank(); rank.SportsMan = item; if (item.SignUp == null || item.SignUp.Count <= 0) { continue; } rank.FirstNum = item.SignUp.Where(a => a.FinalRanK == 1).Count(); rank.SecondNum = item.SignUp.Where(a => a.FinalRanK == 2).Count(); rank.ThirdNum = item.SignUp.Where(a => a.FinalRanK == 3).Count(); rank.AllNum = rank.FirstNum + rank.SecondNum + rank.ThirdNum; RankList.Add(rank); } int listCount = 0; //绑定记录 if (string.IsNullOrEmpty(SreachWhere.Text)) { RankList = RankList.Where(a => true).ToList(); listCount = RankList.Count; RankList = RankList.OrderByDescending(a => a.AllNum).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } else { RankList = RankList.Where(a => a.SportsMan.Name.Contains(SreachWhere.Text)).ToList(); listCount = RankList.Count; RankList = RankList.OrderByDescending(a => a.AllNum).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } string strBar = PageBar.GetPageBarType(pageIndex, listCount, pageSize); mPageBar = strBar; this.Repeater1.DataSource = RankList; this.Repeater1.DataBind(); }
public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("N_UserBank"); string sql0 = SqlHelp.GetSql0("row_number() over (order by Id asc) as rowid,'************'+substring(Payaccount,len(Payaccount)-3,4) as tPayaccount,substring(PayName,1,1)+'**' as tPayName,*", "N_UserBank", "Id", _pagesize, _thispage, "asc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}"; dataTable.Clear(); dataTable.Dispose(); } }
private void BindData() { int pageIndex = Request.QueryString["pageIndex"] != null?int.Parse(Request.QueryString["pageIndex"]) : 1; int pageSize = 5;//页面记录数 List <News> list = new List <News>(); list = Entity.News.Where(a => true).OrderByDescending(a => a.Id).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); int listCount = Entity.News.Where(a => true).Count(); //生成导航条 string strBar = PageBar.GetFrontPageBar(pageIndex, listCount, pageSize); mPageBar = strBar; this.Repeater1.DataSource = list; this.Repeater1.DataBind(); }
private void ajaxGetDetailByUserId() { string text = base.q("id"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); DataTable dataTable = new DataTable(); string text2; if (string.IsNullOrEmpty(text)) { text2 = "UcId=0"; } else { this.doh.Reset(); this.doh.SqlCmd = "select top 1 Id from [N_UserContract] where userid=" + text + " and type=1"; dataTable = this.doh.GetDataTable(); if (dataTable.Rows.Count > 0) { text2 = "UcId=" + dataTable.Rows[0]["Id"]; } else { text2 = "UcId=0"; } } this.doh.Reset(); this.doh.ConditionExpress = text2; int totalCount = this.doh.Count("N_UserContractDetail"); string sql = SqlHelp.GetSql0("*", "N_UserContractDetail", "id", pageSize, num, "desc", text2); this.doh.Reset(); this.doh.SqlCmd = sql; dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(3, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
private void ajaxGetSscList() { string text = base.q("type"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); if (string.IsNullOrEmpty(text)) { text = "1"; } this.doh.Reset(); this.doh.ConditionExpress = "Id=@UserId"; this.doh.AddConditionParameter("@UserId", this.AdminId); object field = this.doh.GetField("N_User", "Point"); if (text == "3") { this.doh.Reset(); this.doh.ConditionExpress = "Point=@Point"; this.doh.AddConditionParameter("@Point", field); field = this.doh.GetField("N_UserLevel", "DpPoint"); } string text2 = "flag=0 and LotteryId=" + text; this.doh.Reset(); this.doh.ConditionExpress = text2; int totalCount = this.doh.Count("Sys_PlaySmallType"); string sql = SqlHelp.GetSql0("row_number() over (order by Sort asc) as rowid,Convert(decimal(10,2),MinBonus+" + Convert.ToDecimal(field) + "*PosBonus*2) as ownMaxBonus,*,(select Title from Sys_PlayBigType where Id=a.Radio) as bigtitle", "Sys_PlaySmallType a", "Sort", pageSize, num, "asc", text2); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(6, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
/// <summary> /// 获取产品对象列表 /// </summary> private void GetList() { //检查PageIndex参数 string tempIndex = Tools.GetQueryString("p"); if (tempIndex == "") { tempIndex = "1"; } if (Tools.IsPositiveInt(tempIndex)) { PageIndex = Convert.ToInt32(tempIndex); try { CategoryID = Convert.ToInt32(Tools.GetQueryString("categoryid")); string CategoryIDList = BPC.GetChildCategoryIDListByID(Convert.ToInt32(CategoryID)); PInfoList = BPP.GetListByCategory(PageIndex, PageSize, out RecordTotal, CategoryIDList); } catch { PInfoList = BPP.GetList(PageIndex, PageSize, out RecordTotal); } MyPageBar = new PageBar(PageIndex, PageSize, RecordTotal, PageNumTotal, "p"); if (RecordTotal > 0) { if (PageIndex > MyPageBar.PageTotal) { ShowWindow(4, "系统提示", "分页参数错误,点击 \\\"确定\\\" 按钮返回", null, true); } else { PageBarHtml = MyPageBar.GetHTML(); } } } else { ShowWindow(4, "系统提示", "分页参数错误,点击 \\\"确定\\\" 按钮返回", null, true); } }
private void ajaxGetList() { string text = base.q("type"); string text2 = base.q("p"); string text3 = base.q("u"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); string text4 = "1=1"; if (!string.IsNullOrEmpty(text)) { text4 = text4 + " and type = " + text; } if (!string.IsNullOrEmpty(text2)) { text4 = text4 + " and dbo.f_GetUserName(ParentId) = '" + text2 + "'"; } if (!string.IsNullOrEmpty(text3)) { text4 = text4 + " and dbo.f_GetUserName(UserId) = '" + text3 + "'"; } this.doh.Reset(); this.doh.ConditionExpress = text4; int totalCount = this.doh.Count("N_UserContract"); string sql = SqlHelp.GetSql0("*,dbo.f_GetUserName(ParentId) as ParentName,dbo.f_GetUserName(UserId) as UserName", "N_UserContract", "id", pageSize, num, "desc", text4); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(3, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
private void BindData() { int pageIndex = Request.QueryString["pageIndex"] != null?int.Parse(Request.QueryString["pageIndex"]) : 1; int pageSize = 10;//页面记录数 var className = Entity.SportsMan.GroupBy(a => a.Class).ToList(); List <ClassRank> classRankList = new List <ClassRank>(); foreach (var item in className) { ClassRank classRank = new ClassRank(); classRank.ClassName = item.Key; var list = Entity.SignUp.Where(a => a.SportsMan.Class == item.Key); classRank.FirstNum = list.Where(a => a.FinalRanK == 1).Count(); classRank.SecondNum = list.Where(a => a.FinalRanK == 1).Count(); classRank.ThirdNum = list.Where(a => a.FinalRanK == 3).Count(); classRank.AllNum = classRank.FirstNum + classRank.SecondNum + classRank.ThirdNum; classRankList.Add(classRank); } int listCount = 0; //绑定记录 if (string.IsNullOrEmpty(SreachWhere.Text)) { classRankList = classRankList.Where(a => true).ToList(); listCount = classRankList.Count; classRankList = classRankList.OrderByDescending(a => a.AllNum).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } else { classRankList = classRankList.Where(a => a.ClassName.Contains(SreachWhere.Text)).ToList(); listCount = classRankList.Count; classRankList = classRankList.OrderByDescending(a => a.AllNum).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } string strBar = PageBar.GetPageBarType(pageIndex, listCount, pageSize); mPageBar = strBar; this.Repeater1.DataSource = classRankList; this.Repeater1.DataBind(); }
private void ajaxGetDelList() { string text = base.q("ucode"); string text2 = base.q("uname"); string text3 = base.q("id"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); string text4 = "isDel=1"; if (!string.IsNullOrEmpty(text3)) { text4 = text4 + " and ParentId=" + text3; } if (!string.IsNullOrEmpty(text2)) { text4 = text4 + " and (UserName LIKE '%" + text2 + "%')"; } if (!string.IsNullOrEmpty(text)) { text4 = text4 + " and len(UserCode) = " + text; } this.doh.Reset(); this.doh.ConditionExpress = text4; int totalCount = this.doh.Count("N_User"); string sql = SqlHelp.GetSql0("*", "V_User", "Id", pageSize, num, "asc", text4); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(3, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
private void ajaxGetUserBankAllList() { string text = base.q("u"); string text2 = base.q("payname"); string text3 = base.q("payaccount"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); string text4 = "1=1"; if (!string.IsNullOrEmpty(text)) { text4 = text4 + " and dbo.f_GetUserName(UserId) like '%" + text + "%'"; } if (!string.IsNullOrEmpty(text2)) { text4 = text4 + " and payname like '%" + text2 + "%'"; } if (!string.IsNullOrEmpty(text3)) { text4 = text4 + " and payaccount like '%" + text3 + "%'"; } this.doh.Reset(); this.doh.ConditionExpress = text4; int totalCount = this.doh.Count("N_UserBank"); string sql = SqlHelp.GetSql0("dbo.f_GetUserName(UserId) as username,*", "N_UserBank", "Id", pageSize, num, "asc", text4); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"加载完成\",\"pagebar\" :\"", PageBar.GetPageBar(3, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
/* Constructors */ public AssigneesAndJobs(IWebDriver driver) { if (driver.Url == "https://tms.lionbridge.com/") { var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); IReadOnlyCollection <IWebElement> auxiliaryCollection; Assignee auxiliaryAssignee; AssigneeJobs auxiliaryAssigneeJobs; auxiliaryCollection = driver.FindElements(By.ClassName("r_GH")); if (auxiliaryCollection.Count == 1) { assigneeResultsContainer = auxiliaryCollection.ElementAt(0); assigneePageBar = new PageBar(driver); auxiliaryCollection = driver.FindElements(By.ClassName("r_LH")); if (auxiliaryCollection.Count > 0) { foreach (IWebElement element in auxiliaryCollection) { auxiliaryAssignee = new Assignee(element); if (auxiliaryAssignee.IsParsingCorrect) { assigneesList.Add(auxiliaryAssignee); } } } auxiliaryCollection = driver.FindElements(By.ClassName("r_L")); if (auxiliaryCollection.Count > 0) { foreach (IWebElement element in auxiliaryCollection) { auxiliaryAssigneeJobs = new AssigneeJobs(element); /*if (auxiliaryAssigneeJobs.IsParsingCorrect)*/ assigneesJobsList.Add(auxiliaryAssigneeJobs); } } } } }
public void PreviousPageFor() { /* Test initialization */ IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("https://www.olx.pl/warszawa/q-lodowka/"); List <IWebElement> pageChangeBar = new List <IWebElement>(driver.FindElements(By.XPath("//*[@id=\"body-container\"]/div[3]/div/div[8]"))); PageBar pageBar = new PageBar(driver); /* Testing */ pageBar = pageBar.GoToLastPage(driver); for (int i = pageBar.PageList.LastPageNumber - 1; i > 0; i--) { pageBar = pageBar.GoToPreviousPage(driver); Assert.That(pageBar.PageList.FirstPageNumber, Is.EqualTo(1)); if (i != 1) { Assert.That(driver.Url, Is.EqualTo("https://www.olx.pl/warszawa/q-lodowka/?page=" + i.ToString())); Assert.That(pageBar.NextPrev.IsNext(), Is.True); Assert.That(pageBar.NextPrev.IsPrevious(), Is.True); } else { Assert.That(driver.Url, Is.EqualTo("https://www.olx.pl/warszawa/q-lodowka/")); Assert.That(pageBar.NextPrev.IsNext(), Is.True); Assert.That(pageBar.NextPrev.IsPrevious(), Is.False); } } /* Teard down */ driver.Quit(); }
public string PageList(int mode, int totalCount, int PSize, int currentPage, string[] FieldName, string[] FieldValue) { string str = HttpContext.Current.Request.ServerVariables["Script_Name"].ToString(); string text = ""; for (int i = 0; i < FieldName.Length; i++) { string text2 = text; text = string.Concat(new string[] { text2, FieldName[i].ToString(), "=", FieldValue[i].ToString(), "&" }); } string httpN = str + "?" + text + "page=<#page#>"; return(PageBar.GetPageBar(mode, "html", 0, totalCount, PSize, currentPage, httpN)); }
public void PageBar_ItemsPerPageClick_Test_3() { using (var driver = new ChromeDriver()) { /* Initialization */ var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://lionbridge.com/"); PageBar testPageBar = new PageBar(driver); /* Set of assertions */ Assert.IsFalse(testPageBar.IsParsingCorrect); Assert.AreEqual(-1, testPageBar.ItemsPerPageOptionsContainerIsDisplayed); testPageBar.ItemsPerPageClick(driver); Assert.AreEqual(-1, testPageBar.ItemsPerPageOptionsContainerIsDisplayed); } }
private void ajaxUserOfIpWarn() { string text = base.q("ip"); string text2 = base.q("uname"); int num = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num2 = base.Str2Int(base.q("flag"), 0); string text3 = "isDel=0 and Ip in(select Ip from N_User with(nolock) where isDel=0 group by Ip having count(Ip)>1)"; string fldName = "Id"; if (!string.IsNullOrEmpty(text2)) { text3 = text3 + " and UserName like '%" + text2.Trim() + "%'"; fldName = "UserName"; } if (!string.IsNullOrEmpty(text)) { text3 = text3 + " and ip like '%" + text.Trim() + "%'"; fldName = "Ip"; } this.doh.Reset(); this.doh.ConditionExpress = text3; int totalCount = this.doh.Count("V_User"); string sql = SqlHelp.GetSql0("*", "V_User", fldName, pageSize, num, "asc", text3); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(3, "js", 2, totalCount, pageSize, num, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "}" }); dataTable.Clear(); dataTable.Dispose(); }
private void BindData() { int pageIndex = Request.QueryString["pageIndex"] != null?int.Parse(Request.QueryString["pageIndex"]) : 1; int pageSize = 10;//页面记录数 List <SportsItem> list = new List <SportsItem>(); int listCount = 0; //总记录数 string strBar = string.Empty; //导航条 //裁判权限 if (Request.QueryString["type"] != null) { int RefereeId = Convert.ToInt32(Session["RefereeId"]); list = Entity.SportsItem.Where(a => a.RefereeId == RefereeId).ToList(); listCount = list.Count; strBar = PageBar.GetPageBarType(pageIndex, listCount, pageSize); } else { list = Entity.SportsItem.Where(a => true).ToList(); listCount = list.Count; strBar = PageBar.GetPageBar(pageIndex, listCount, pageSize); } //分页查询记录 if (string.IsNullOrEmpty(SreachWhere.Text)) { list = list.Where(a => true).OrderByDescending(a => a.Id).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } else { list = list.Where(a => a.Name.Contains(SreachWhere.Text)).OrderByDescending(a => a.Id).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } //生成导航条 mPageBar = strBar; this.Repeater1.DataSource = list; this.Repeater1.DataBind(); }
private void ajaxGetList() { string text = base.q("d1"); string text2 = base.q("u"); int num = base.Str2Int(base.q("gId"), 0); int num2 = base.Int_ThisPage(); int pageSize = base.Str2Int(base.q("pagesize"), 20); int num3 = base.Str2Int(base.q("flag"), 0); string text3 = "[Type]=" + num3; if (!string.IsNullOrEmpty(text)) { text3 = text3 + "and Convert(varchar(10),STime,120)='" + text + "'"; } if (!string.IsNullOrEmpty(text2)) { text3 = text3 + "and Title like '" + text2 + "%'"; } this.doh.Reset(); this.doh.ConditionExpress = text3; int totalCount = this.doh.Count("Sys_LotteryData"); string sql = SqlHelp.GetSql0("Id,Title,Number,NumberAll,Total,OpenTime,STime", "Sys_LotteryData", "STime", pageSize, num2, "desc", text3); this.doh.Reset(); this.doh.SqlCmd = sql; DataTable dataTable = this.doh.GetDataTable(); this._response = string.Concat(new string[] { "jsonpCallback({\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(num3, "js", 2, totalCount, pageSize, num2, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable), "})" }); dataTable.Clear(); dataTable.Dispose(); }