本文整理汇总了C#中PageModel类的典型用法代码示例。如果您正苦于以下问题:C# PageModel类的具体用法?C# PageModel怎么用?C# PageModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PageModel类属于命名空间,在下文中一共展示了PageModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddItems
public ActionResult AddItems(string ids,string propValues, string title, string itemcode, string catid, int type = 0, int p = 1)
{
var page = new PageModel<GoodsDetail>();
var req =
YunClient.Instance.Execute(
new GetItemsRequest
{
Ids=ids,
PropIds = propValues,
Operation = "PropIds:and",
ItemTitle = title,
ItemState = 1,
ShopCatIds = catid,
PageNum = p,
PageSize = 5,
Fields = "Id",
Sorts = "IdDesc",
SaleType = type,
IsDelete = 0,
}, Member.Token);
var idss = req.Items.Select(e => (int)e.Id).ToList();
var d = Commodity.Gets(1,5,idss);
page.CurrentPage = p;
page.Items = d;
page.TotalItems = req.TotalItem;
page.ItemsPerPage = 5;
return PartialView(page);
}
开发者ID:icgyun,项目名称:Maigao,代码行数:28,代码来源:PromotionController.cs
示例2: GetWord
public async Task<PageModel<WordResult>> GetWord(GetWord input)
{
input.SearchKey=input.SearchKey ?? string.Empty;
var result = new PageModel<WordResult>();
var currIndex= input.Index - 1;
var models = WordRepository.GetAll().
Where(s=>s.Content.Contains(input.SearchKey)||s.Title.Contains(input.SearchKey)).
OrderByDescending(t => t.CreationTime).
Skip(currIndex*input.PageCount).Take(input.PageCount).ToList();
if (!ListHelp.CheckList(models))
{
return result;
}
var reg = new Regex(@"<[^>]*>");
models.ForEach(s => result.Data.Add(new WordResult
{
Id = s.Id,
Description = StringHelp.TakeEllipsisSting(reg.Replace(s.Content, string.Empty), 220)+"...",
Title = s.Title
}));
if (!string.IsNullOrEmpty(input.SearchKey))
{
result.TotalCount = models.Count;
}
else
{
result.TotalCount = await WordRepository.LongCountAsync();
}
result.Index = input.Index;
return result;
}
开发者ID:Tzns,项目名称:WealthlawProject,代码行数:31,代码来源:ManagementService.cs
示例3: ItemList
public ActionResult ItemList(int id = 0, int p = 1)
{
ViewData["Categorys"] =
YunClient.Instance.Execute(new GetShopItemCategorysRequest
{
Display = 1,
ShopId = GlobeInfo.InitiatedShopId
}).Categorys;
var req =
YunClient.Instance.Execute(new GetItemsRequest
{
Fields = "id,pictures,picture,itemtitle,itemshopcats,subtitle",
PageNum = p,
PageSize = 10,
ItemState = 1,
IsDelete = 0,
ShopCatIds = id > 0 ? id.ToString() : ""
});
var page = new PageModel<Yun.Item.GoodsDetail>
{
Items = req.Items,
CurrentPage = p,
TotalItems = req.TotalItem
};
return View(page);
}
开发者ID:summer-breeze,项目名称:CaLight,代码行数:30,代码来源:HomeController.cs
示例4: GetModel
public static PageModel GetModel(int PageID)
{
PageModel model = null;
DataTable dt = PageDataAccess.Get(PageID);
if (dt.Rows.Count > 0)
{
DataRow row = dt.Rows[0];
model = new PageModel();
model.PageID = Convert.ToInt32(row["pageid"]);
model.PageName = Convert.ToString(row["pagename"]);
model.PageTitle = Convert.ToString(row["pagetitle"]);
model.Category = Convert.ToInt32(row["category"]);
model.Author = Convert.ToString(row["author"]);
model.CreateTime = Convert.ToDateTime(row["createtime"]);
model.LastModify = Convert.ToString(row["lastmodify"]);
model.TempatePath = Convert.ToString(row["templatepath"]);
model.PhysicalPath = Convert.ToString(row["physicalpath"]);
model.UpdateTime = Convert.ToDateTime(row["updatetime"]);
model.SelfClassid = Convert.ToInt32(row["selfclassid"]);
model.ExtendPageInfo = Convert.ToString(row["extendpageinfo"]);
}
return model;
}
开发者ID:ViniciusConsultor,项目名称:noname-netshop,代码行数:26,代码来源:PageControler.cs
示例5: Index
/// <summary>
/// 普通用户列表
/// </summary>
/// <param name="email"></param>
/// <param name="mobile"></param>
/// <param name="nick"></param>
/// <param name="minregtime"></param>
/// <param name="maxregtime"></param>
/// <param name="minmoney"></param>
/// <param name="maxmoney"></param>
/// <param name="minscore"></param>
/// <param name="maxscore"></param>
/// <param name="minprepaid"></param>
/// <param name="maxprepaid"></param>
/// <param name="p"></param>
/// <returns></returns>
public ActionResult Index(string email, string mobile, string nick, DateTime? minregtime, DateTime? maxregtime,
double? minmoney,
double? maxmoney, long? minscore, long? maxscore, double minprepaid = 0, double maxprepaid = 0, int p = 1)
{
var page = new PageModel<UserDetail>();
var req = YunClient.Instance.Execute(new FindUsersRequest
{
Email = email,
Mobile = mobile,
Nick = nick,
MinMoney = minmoney,
MaxMoney = maxmoney,
MinScore = minscore,
MaxScore = maxscore,
MinRegTime = minregtime,
MaxRegTime = maxregtime,
PageNum = p,
PageSize = 20,
MinPrepaidCard = minprepaid,
MaxPrepaidCard = maxprepaid
});
page.Items = req.Users;
page.CurrentPage = p;
page.TotalItems = req.TotalItem;
return View(page);
}
开发者ID:summer-breeze,项目名称:DingZanSeaFood,代码行数:44,代码来源:MemberController.cs
示例6: Button_Add_Click
protected void Button_Add_Click(object sender, EventArgs e)
{
string ErrorMessage = String.Empty;
if (String.IsNullOrEmpty(TextBox_PageName.Text)) ErrorMessage += "页面名称不能为空\\n";
if (String.IsNullOrEmpty(TextBox_PageTitle.Text)) ErrorMessage += "页面标题不能为空\\n";
if (!String.IsNullOrEmpty(ErrorMessage)) MessageBox.Show(this, ErrorMessage);
PageModel page = new PageModel();
page.PageName = TextBox_PageName.Text;
page.PageTitle = TextBox_PageTitle.Text + "_帮助中心_鼎鼎商城";
page.Category = (int)PageCategory.HelpCenter;
page.PhysicalPath = String.Format(Element.NameRule, page.PageName);
page.TempatePath = DropDownList_Template.SelectedValue;
page.Author = "";
page.LastModify = "";
page.CreateTime = DateTime.Now;
page.UpdateTime = page.CreateTime;
page.SelfClassid = 0;
page.ExtendPageInfo = "";
PageControler.Insert(page);
MessageBox.Show(this, "添加成功!");
}
开发者ID:ViniciusConsultor,项目名称:noname-netshop,代码行数:26,代码来源:Add.aspx.cs
示例7: Reload
private void Reload(bool clearCache)
{
DataContext = null;
if (ImageCache == null)
{
return;
}
ImageCache.Clear();
DataContext = new PageModel(ImageCache);
}
开发者ID:kaaelhaa,项目名称:WindowsPhoneFan.dk-app,代码行数:10,代码来源:ImageCachePage.xaml.cs
示例8: ReadLayout
private string ReadLayout()
{
var pageModel = new PageModel() { ActiveMenuIndex = 2, DisplayName = "configuration", IsLogin = true };
byte[] layout = EmbeddedResource.GetView(layOutViewName);
string ly = System.Text.Encoding.UTF8.GetString(layout);
string spageModel = "pageModel=" + JsonConvert.SerializeObject(pageModel);
string host = ContextHelper.GetHostUrl();
string content = ly.Replace("@[email protected]", spageModel).Replace("@[email protected]", host);
return content;
}
开发者ID:felix-tien,项目名称:TechLab,代码行数:10,代码来源:AttributeConfigBeanRenderer.cs
示例9: TagList
public ActionResult TagList(int p = 1)
{
var page = new PageModel<Yun.Archive.Tag>();
var req = YunClient.Instance.Execute(new GetTagsRequest { PageNum = p, PageSize = 40 }, Token);
page.Items = req.Tags;
page.CurrentPage = p;
page.TotalItems = req.TotalItem;
return View(page);
}
开发者ID:summer-breeze,项目名称:DingZanSeaFood,代码行数:11,代码来源:ArticleController.cs
示例10: Edit
public ActionResult Edit(PageModel pageModel)
{
var dynamicPage = new DynamicPageDto();
dynamicPage.InjectFrom(pageModel);
var result = _adminPageService.SavePage(CurrentProfile.ClientId, dynamicPage, pageModel.IsHomePage);
if (result.IsValid)
{
return RedirectToAction("Index");
}
ModelState.AddModelError(string.Empty, result.ValidationSummaryToString());
return View(pageModel);
}
开发者ID:hpinio,项目名称:BuncisMVC,代码行数:12,代码来源:AdminPagesController.cs
示例11: Index
public ActionResult Index(int p = 1)
{
var page = new PageModel<Yun.Marketing.CashCouponDomain>();
var req = YunClient.Instance.Execute(new FindCashCouponRequest {PageSize = 20, PageNum = p});
page.Items = req.CashCoupons;
page.CurrentPage = p;
page.TotalItems = req.TotalItem;
return View(page);
}
开发者ID:summer-breeze,项目名称:CaLight,代码行数:12,代码来源:CashCouponController.cs
示例12: Create_Should_Validate_Title
public void Create_Should_Validate_Title()
{
dynamic data = new ExpandoObject();
data.Id = "id";
data.Title = null; // <-- it should catch this
var repository = new Mock();
var model = new PageModel();
model.Repository = repository;
model.Create(data);
Assert.IsTrue(model.HasError);
}
开发者ID:yysun,项目名称:Rabbit,代码行数:12,代码来源:PageModelTest.cs
示例13: Index
// GET: Admin/Home
public ActionResult Index(int pageIndex = 0, int pageSize = 10)
{
var data = new PageModel<SubjectInfoModel>();
var list = _subjectinfoInfoService.GetList(pageIndex, pageSize);
if (list != null)
{
data = list.ToModel<SubjectInfo, SubjectInfoModel>();
data.Data.AddRange(list.Select(o => o.ToAdminModel()));
}
return View(data);
}
开发者ID:jerviscui,项目名称:NerveBinaryWeChat,代码行数:14,代码来源:HomeController.cs
示例14: Create_Should_Validate_New_Title_Exists
public void Create_Should_Validate_New_Title_Exists()
{
dynamic data = new ExpandoObject();
data.Id = null;
data.Title = "new title";
var repository = new Mock();
repository.Setup("Exists", new object[] { "new title" }, true); // <-- it should catch this
var model = new PageModel();
model.Repository = repository;
model.Create(data);
Assert.IsTrue(model.HasError);
repository.Verify();
}
开发者ID:yysun,项目名称:Rabbit,代码行数:13,代码来源:PageModelTest.cs
示例15: Index
//
// GET: /Admin/Refund/
public ActionResult Index(string nick, DateTime? mincreatetime, DateTime? maxcreatetime,
int orderid=0, int p = 1)
{
var page = new PageModel<RefundDetailModel>();
var req = YunClient.Instance.Execute(new GetSellerRefundsRequest
{
MinCreateTime = mincreatetime,
MaxCreateTime = maxcreatetime,
Nick = nick,
OrderId = orderid,
PageSize = 20,
PageNum = p
}, Member.Token);
var Integral = YunShop.Core.DataProvider.GlobeInfo.GetIntegralRequest();
var list = (from refund in req.Refunds
let trade = YunClient.Instance.Execute(new GetTradeRequest
{
Id = refund.TradeId
}, Member.Token).Trade
where trade.Orders.Any(e => e.Id == refund.OrderId)
let order = trade.Orders.First(e => e.Id == refund.OrderId)
select new RefundDetailModel
{
Id = refund.Id,
OrderId = refund.Id,
RefundId = refund.RefundId,
TradeId = refund.TradeId,
Reason = refund.Reason,
CreateTime = refund.CreateTime,
EndTime = refund.EndTime,
Status = refund.Status,
Balance = refund.Balance,
Online = refund.Online,
ItemTitle = order.ItemTitle,
Nick = trade.Nick,
Quantity = order.Quantity,
Fare = trade.Fare,
PrepaidCard=refund.PrepaidCard,
Price = order.Price,
SFMoney =trade.TotalFunds.ToString(),
Thumb = order.Thumb,
SkuNames = order.SkuNames,
Money = order.Money,
ItemId=order.ItemId,
}).ToList();
page.CurrentPage = p;
page.Items = list;
page.TotalItems = req.TotalItem;
return View(page);
}
开发者ID:summer-breeze,项目名称:ChengGouHui,代码行数:54,代码来源:RefundController.cs
示例16: Index
public ActionResult Index()
{
PageModel page = new PageModel();
try
{
page = this._pageDataRepository.GetList(x => x.PageId == (int)Page.Food
&& x.StatusId == (int)StatusEnum.Active).FirstOrDefault();
}
catch (Exception ex)
{
ex.ExceptionValueTracker();
}
return View("Index.mobile", page);
}
开发者ID:sandipghosh,项目名称:NJFairground,代码行数:14,代码来源:FoodFinderController.cs
示例17: List_Should_Use_Paging
public void List_Should_Use_Paging()
{
var repository = new Mock();
repository.Setup("List", null);
var model = new PageModel();
model.Repository = repository;
model.List(2, 20);
Assert.AreEqual(2, model.Value.PageNo);
Assert.AreEqual(20,model.Value.PageSize);
repository.Verify();
}
开发者ID:yysun,项目名称:Rabbit,代码行数:14,代码来源:PageModelTest.cs
示例18: Results
public ActionResult Results(int subjectId, int pageIndex = 0, int pageSize = 10)
{
var data = new PageModel<SubjectResultModel>();
var list = _subjectResultService.GetResults(subjectId, pageIndex, pageSize);
ViewBag.SubjectId = subjectId;
if (list != null)
{
data = list.ToModel<SubjectResult, SubjectResultModel>();
data.Data.AddRange(list.Select(o => o.ToAdminModel()));
}
return View(data);
}
开发者ID:jerviscui,项目名称:NerveBinaryWeChat,代码行数:14,代码来源:HomeController.cs
示例19: Delete_Should_Call_Delete_To_Repository
public void Delete_Should_Call_Delete_To_Repository()
{
dynamic data = new ExpandoObject();
data.Id = "id";
var repository = new Mock();
repository.Setup("Delete", new object[] { It.Is<string>(item => item == "id") }, null);
var model = new PageModel();
model.Repository = repository;
model.Delete(data);
Assert.IsTrue(model.Value == null);
repository.Verify();
}
开发者ID:yysun,项目名称:Rabbit,代码行数:15,代码来源:PageModelTest.cs
示例20: ReadLayout
private string ReadLayout()
{
UserInfo user = Authorization.Instance.CurrentUser();
string userid = string.Empty;
if (user != null)
{
userid = user.UserID;
}
var pageModel = new PageModel() { ActiveMenuIndex = 2, DisplayName = userid, IsLogin = true };
byte[] layout = EmbeddedResource.GetView(layOutViewName);
string ly = System.Text.Encoding.UTF8.GetString(layout);
string spageModel = "pageModel=" + JsonConvert.SerializeObject(pageModel);
string host = ContextHelper.GetHostUrl();
string content = ly.Replace("@[email protected]", spageModel).Replace("@[email protected]", host);
return content;
}
开发者ID:felix-tien,项目名称:TechLab,代码行数:16,代码来源:AttributeConfigBeanRenderer.cs
注:本文中的PageModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论