<h2>商品列表</h2>

<a id="a">导出列表</a>

<table class="table table-bordered">
<thead>
<tr>
<td>商品图片</td>
<td>商品名称</td>
<td>商品颜色</td>
<td>商品尺码</td>
<td>商品价格</td>
<td>操作</td>
</tr>
</thead>
<tbody id="tb"></tbody>
</table>

<table class="table table-bordered">
<tr>
<td><input id="Button1" type="button" value="首页" onclick="first()" /></td>
<td><input id="Button1" type="button" value="上一页" onclick="prev()" /></td>
<td><input id="Button1" type="button" value="下一页" onclick="next()" /></td>
<td><input id="Button1" type="button" value="尾页" onclick="last()" /></td>
</tr>
</table>

<script>
var index1 = 0; //获得当前页
var pagecount = 0;
function load(index) {
daoshu();
index1 = index;
$.ajax({
url: "http://localhost:51518/api/Shop/GetGoods2",
data: { index: index, size: 2 },
type: "get",
dataType: "json",
success:
function (d) {
$("#tb").empty();
$(d.List).each(function () {
$("#tb").append(
'<tr>' +
'<td><img src="http://localhost:51518' + this.GImg + '" width="80" height="60" /></td>' +
'<td>' + this.GName + '</td>' +
'<td>' + this.GColor + '</td>' +
'<td>' + this.GSize + '</td>' +
'<td>' + this.GPrice + '</td>' +
'<td><input id="Button1" type="button" value="删除" onclick="del(' + this.GId + ')" />&nbsp;<input id="Button1" type="button" value="修改" onclick="upt(' + this.GId + ')" /></td>' +
'</tr>'
)
})
pagecount = d.PageCount;
}
})
}
load(1);

function first() {
index1 = 1;
daoshu();
load(index1);
}
function prev() {
index1--;
if (index1 == 0) {
index1 = 1;
}
daoshu();
load(index1);
}
function next() {
index1++;
if (index1 > pagecount) {
index1 = pagecount;
}
daoshu();
load(index1);
}
function last() {
daoshu();
load(pagecount);
}

//删除
function del(id) {
var obj = {
GId: id
};
$.ajax({
url: "http://localhost:51518/api/Shop/DeleteGood",
data: obj,
type: "post",
dataType: "json",
success:
function (d) {
if (d > 0) {
alert('删除成功!');
load();
}
else {
alert('删除失败!');
}
}
})
}

//修改
function upt(id) {
location.href = "/Default/Update";
document.cookie = id;
}

//导出
function daoshu() {
$("#a").prop("href", "http://localhost:51518/api/Shop/Export1?index=" + index1);
}
</script>

Dapper显示的更多相关文章

  1. Dapper,大规模分布式系统的跟踪系统--转

    原文地址:http://bigbully.github.io/Dapper-translation/ 概述 当代的互联网的服务,通常都是用复杂的.大规模分布式集群来实现的.互联网应用构建在不同的软件模 ...

  2. Dapper学习 - Dapper.Rainbow(三) - Read

    前面已经介绍了新增/修改/删除了, 接下来介绍一下Rainbow的Read方法. 一.Read -- Rainbow原生 1. 先看测试代码 var conStr = ConfigurationMan ...

  3. Emit学习(4) - Dapper解析之数据对象映射(一)

    感觉好久没有写博客了, 这几天有点小忙, 接下来会更忙, 索性就先写一篇吧. 后面估计会有更长的一段时间不会更新博客了. 废话不多说, 先上菜. 一.示例 1. 先建类, 类的名称与读取的表名并没有什 ...

  4. Dapper ORM 用法—Net下无敌的ORM(转)

    假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.点击下载Dapper的优势:1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编译后 ...

  5. Dapper ORM 用法—Net下无敌的ORM

    假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.点击下载Dapper的优势:1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编译后 ...

  6. 【.NET框架】Dapper ORM 用法—Net下无敌的ORM

    假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.点击下载 Dapper的优势: 1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编 ...

  7. csharp:Dapper Sample

    You can find Dapper on Google Code here: http://code.google.com/p/dapper-dot-net/ and the GitHub dis ...

  8. Dapper ORM 用法

    假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.Dapper的优势:1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编译后就40K ...

  9. Dapper基础用法

    假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.点击下载Dapper的优势:1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编译后 ...

  10. ASP.NET Core:使用Dapper和SwaggerUI来丰富你的系统框架

    一.概述 1.用VS2017创建如下图的几个.NET Standard类库,默认版本为1.4,你可以通过项目属性进行修改,最高支持到1.6,大概五月份左右会更新至2.0,API会翻倍,很期待! 排名分 ...

随机推荐

  1. Spring 事务传播属性

    Spring 事务相关 3 个 API 定义类 Spring 事务底层 API 定义主要有 PlatformTransactionManager.TransactionDefintion 和 Tran ...

  2. Pytorch实战学习(五):多分类问题

    <PyTorch深度学习实践>完结合集_哔哩哔哩_bilibili Softmax Classifer 1.二分类问题:糖尿病预测 2.多分类问题 MNIST Dataset:10个标签, ...

  3. (0321) 路科 视频 ,讲 uvm_pkg

    loading

  4. 活动 | Cloud Ace 受邀参加中国智造出海数字科技峰会

    [Cloud Ace 是谷歌云全球战略合作伙伴,拥有 200 多名工程师,也是谷歌最高级别合作伙伴,多次获得 Google Cloud 合作伙伴奖. 作为谷歌托管服务商,我们提供谷歌云.谷歌地图.谷歌 ...

  5. SPI主机Verilog代码实现

    前面已经提到过了SPI,在SPI从机的设计中已经讲过SPI的基本原理,这里就不再赘述.对于SPI的主机可以参考百度百科或则笔者前面写的SPI从机介绍的相关知识. 下面是SPI_master的代码 SP ...

  6. Kotlin源码分析 - 元编程(使用自身语言编写生成自身代码)

    Kotlin源码分析 Kotlin模块FIR分析发现,在生成fir tree的时候,kotlin使用了元编程的技术,以前看到这个技术还是在JastAdd上,使用jastadd语法去写代码,生成Java ...

  7. OC基础 - isMemberOfClass | isKindOfClass

    isMemberOfClass | isKindOfClass 1 - 猜想以下代码输出的结果 1 #import <Foundation/Foundation.h> 2 #import ...

  8. jabc连接数据库

    Java数据库连接,(Java Database Connectivity,简称JDBC)是Java语言中用来规范客户端程序如何来访问数据库的应用程序接口,提供了诸如查询和更新数据库中数据的方法.JD ...

  9. c++ 引用 指针。

    一.什么是引用(reference) ?已经存在的对象的另外一个名字. 引用有什么特别的? 1.引用在定义时,以&开头. 2.引用不是对象,只能绑定在对象上.所以必须在初始化的时候,指定引用绑 ...

  10. 《SAP MDM主数据管理》.pdf

    <SAP MDM主数据管理>.pdf 有需要的联系 wx :erpworld