public pageInfo pageCount() //计算总页数 { pageInfo pi = new pageInfo(); pi.totalcount = bllnewsinfo.GetRecordCount("");//获取数据总条数 pi.pagesize = int.Parse(ConfigurationManager.AppSettings["pagesize"]); //int pagecount = 总条数%每页条数 ==0 ? 总条数/每页条数 :总条数/每页条数 +1 pi.pagecount = pi.totalcount % pi.pagesize == 0 ? pi.totalcount / pi.pagesize : pi.totalcount / pi.pagesize + 1; return(pi); }
public ActionResult FilteredComplaints() { ViewBag.RoleEntityValue = RoleEntityValue; ViewBag.UserRole = UserRoles.First(); ViewBag.UserId = UserId.ToString(); pageInfo _pageInfo = new pageInfo() { title = "Filtered Complaints" }; _pageInfo.LayoutPage = ""; return(View(_pageInfo)); }
public ActionResult ComplianceReport(string reportType) { //Save the Report Type in ViewBag. It will be stored in the Hidden field on the Page ViewBag.ReportType = reportType; ViewBag.RoleEntityValue = RoleEntityValue; ViewBag.UserRole = UserRoles.First(); pageInfo _pageInfo = new pageInfo() { title = "Report " + reportType }; _pageInfo.LayoutPage = ""; return(View("Report" + reportType, _pageInfo)); }
protected void Page_Load(object sender, EventArgs e) { //计算总页数 pi = pageCount(); if (Request.QueryString["page"] == null) { pi.pageindex = 1; } else { pi.pageindex = int.Parse(Request.QueryString["page"]); } typetable = blltypeinfo.GetList(pi.pagesize, pi.pageindex, "").Tables[0]; }
protected void Page_Load(object sender, EventArgs e) { usertable = blluser.GetAllList().Tables[0];//用户表 //计算总页数 pi = pageCount(); if (Request.QueryString["page"] == null) { pi.pageindex = 1; } else { pi.pageindex = int.Parse(Request.QueryString["page"]); } newstable = bllnewsinfo.GetList(pi.pagesize, pi.pageindex, "").Tables[0];//新闻表 }
public ActionResult Index(int?workspaceId, int?moduleId, int?pageMenuId) { workspaceId = workspaceId ?? 0; moduleId = moduleId ?? 0; pageMenuId = pageMenuId ?? 0; pageInfo p = new pageInfo() { title = "Mined System Compliance Tracking Tool", currentWorkspaceId = workspaceId.Value, currentModuleId = moduleId.Value, currentPageMenuId = pageMenuId.Value }; return(View("Index", p)); }
rr2.BLL.newsInfo bllnewsinfo = new rr2.BLL.newsInfo();//实例化业务逻辑,以便抽取数据到newsinfotable protected void Page_Load(object sender, EventArgs e) { //计算总页数 pi = pageCount(); if (Request.QueryString["page"] == null) { pi.pageindex = 1; } else { pi.pageindex = int.Parse(Request.QueryString["page"]); } newsinfotable = bllnewsinfo.GetList(pi.pagesize, pi.pageindex, "").Tables[0]; //控件显示页数 for (int i = 1; i <= pi.pagecount; i++) { DropDownList1.Items.Add(i.ToString()); } }
public ActionResult ajaxPageLinks(int page = 1, string source = "%", string sort = "date") { int count = (from item in db.GetTable <rss>() where SqlMethods.Like(item.source, source) select item) .Count(); int pageSize = 10; IEnumerable <rss> currentNews = rssQuery(sort, source, page, pageSize, db); pageInfo pageInfo = new pageInfo { pageNumber = page, pageSize = pageSize, totalItems = count }; indexViewModel ivm = new indexViewModel { pageInfo = pageInfo, rssList = currentNews }; ViewBag.source = source; ViewBag.sort = sort; return(PartialView(ivm)); }
public static pageInfo pageStart(NewEATradosCtx ctx, CourseIds crsId, string pageId, string eaPath) { //notifikace o zacatku zpracovani pageId-stranky (obsazen v fileName) // english1/grammar/sec01/G01.htm => q:\LMNet2\WebApps\EduAuthorNew\english1\grammar\sec01\App_LocalResources\g01.htm var res = new pageInfo() { id = pageId, EAPath = eaPath, courseId = crsId }; ctx.pages.Add(res);//, fileName = @"q:\LMNet2\WebApps\EduAuthorNew\" + pageId }); return res; }
//nacte vsechna .resx static Dictionary<Langs, Dictionary<string, string>> loadAllResx(pageInfo pg) { Dictionary<Langs, Dictionary<string, string>> res = new Dictionary<Langs, Dictionary<string, string>>(); Dictionary<string, string> lngRes; string prefix = @"d:\LMCom\rew\EduAuthorNew\" + pg.EAPath.Replace('/', '\\'); prefix = Path.GetDirectoryName(prefix) + "\\App_LocalResources\\" + Path.GetFileName(prefix); foreach (Langs lng in new Langs[] { Langs.no }.Concat(AllLocs)) { var fn = prefix + (lng == Langs.no ? null : "." + (lng == Langs.sp_sp ? Langs.es_es : lng).ToString().Replace('_', '-')) + ".resx"; try { if (pg.courseId == CourseIds.EnglishE || !File.Exists(fn)) //lngRes = def == null ? null : new Dictionary<string, string>(def); lngRes = null; else { lngRes = new Dictionary<string, string>(); string f = CSLocalize.transFinal(File.ReadAllText(fn)); XElement root = XElement.Parse(f); foreach (var el in root.Descendants("data")) try { lngRes.Add(el.AttributeValue("name"), el.ElementValue("value")); } catch (Exception e) { throw new Exception(el.AttributeValue("name"), e); } } switch (lng) { case Langs.no: res[Langs.cs_cz] = lngRes; break; case Langs.cs_cz: break; default: res[lng] = lngRes; break; } //if (lng == Langs.no) def = lngRes; } catch (Exception e) { throw new Exception(fn, e); } } //Dopln chybejici resx a chybejici stringy Dictionary<string, string> def = res.ContainsKey(Langs.en_gb) ? res[Langs.en_gb] : null; foreach (var kv in res.ToArray()) { if (kv.Value == null) res[kv.Key] = def; //neexistuje RESX soubor else if (def != null) { //existuje RESX soubor ale muze obsahovat neprelozene stringy foreach (var tr in kv.Value.Where(kvv => kvv.Value == "###TRANS TODO###" && def.ContainsKey(kvv.Key)).ToArray()) kv.Value[tr.Key] = def[tr.Key]; //neprelozeny string } } //loc byl predvyplnen => obohat jim res if (pg.loc != null) { if (res.First().Value == null) res = pg.loc; //zadny preklad, pouzij predvyplneny loc else foreach (var kv in res.Where(k => pg.loc.ContainsKey(k.Key))) //preklad => obohat o loc foreach (var lkv in pg.loc[kv.Key]) kv.Value[lkv.Key] = lkv.Value; } return res; }