<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. idea中怎么查找替换数据?

    快捷键全局查询所有:crtl+shift+F 快捷键全局替换所有:crtl+shift+R 1.crtl+f crtl+r 快捷键全局查询所有:crtl+shift+F 快捷键全局替换所有:crtl+ ...

  2. uniapp离线打包安卓未配置appkey或配置错误

    按照这4步检查都没问题 1.查看签名文件是否配置到了主APP的build.gradle. signingConfigs { config { keyAlias 'newPt' keyPassword ...

  3. 27_wbpack_自定义Plugin

    Tapable 要想学会自定义Plugin就要先了解Tapable这个库 在我们的wbpack中有两个非常重要的两个类Compiler和Compilation 他们是通过注入插件的方式,来监听webp ...

  4. Android 杂项

    1. String to InputStream new ByteArrayInputStream(str.getBytes());

  5. PyTorch之初级使用

    使用流程①. 数据准备; ②. 模型确立; ③. 损失函数确立; ④. 优化器确立; ⑤. 模型训练及保存 模块介绍Part Ⅰ: 数据准备torch.utils.data.Dataset torch ...

  6. ssh远程执行命令无法使用awk的问题

    ssh执行远程命令,当使用到awk的时候总是报错,而sed和grep都没有问题 awk不支持远程执行.最近经过测试找到了解决此问题的方法. 举例:ssh 目标IP " awk '{print ...

  7. 数据表主键设置自增后插入数据的mabatis写法

    研究出两种写法,因为画蛇添足修改了好久. 下面写两种正确的. <insert id="Insert" parameterType="com.aged.www.Poj ...

  8. VSCode+EIDE开发CH32V系列RISC-V MCU

    VSCode+EIDE开发CH32V系列RISC-V MCU 1. VS Code Visual Studion Code (VS Code),是一款由微软开发且跨平台的免费源代码编辑器.该软件支持语 ...

  9. 通过系统函数分配内存sbrk/sbrk

    #include <unistd.h> #include <stdio.h> int main(void) { printf("================brk ...

  10. Cesium 结合Echarts绘制航线图

    <template> <div id="cesiumContainer"></div> </template> <script ...