自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(28)
  • 收藏
  • 关注

原创 添加上传图片前台显示

<table style="border-collapse:separate; border-spacing:100px 20px;"> <tr> <td>名称:</td> <td> <input id="foodname" type="text" /> </td> </tr...

2020-08-12 19:18:43 92

原创 添加上传图片方法

private IWebHostEnvironment _hostEnvironment;public ValuesController1(IWebHostEnvironment hostEnvironment){_hostEnvironment = hostEnvironment;} [HttpPost] [Route("/ValuesController1/AddFood")] public int AddFood(string ff) { Fo.

2020-08-12 16:27:04 84

原创 导出帮助类

using NPOI.HSSF.UserModel;using NPOI.SS.UserModel;using NPOI.XSSF.UserModel;using System;using System.Collections.Generic;using System.Data;using System.IO;/// /// 注意修改命名空间/// namespace WebApplicationMVC{public static class NPOIExcelHelper{//

2020-07-10 08:26:02 61

原创 EF最新删除方法

public int Delete(int id){T t = new T();t = db.Set().Find(id);db.Set().Remove(t);return db.SaveChanges();}

2020-07-10 08:14:48 137

原创 MVC控制器导出

public ActionResult ExportFile(){//判断是否有数据if (Session[“StuList”]!=null&& (Session[“StuList”] as List).Any()){var stulist = Session[“StuList”] as List;var dt = new DataTable();var props = typeof(StudentInfo).GetProperties();//添加列dt.Columns.

2020-07-09 21:13:26 44

原创 MVC Dapper+缓存

1、MVC控制器using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace WebApplication37_MVC.Controllers{public class DefaultController : Controller{// GET: Defaultpublic ActionResult Index(){re.

2020-07-09 21:12:34 98

原创 Redis缓存+Dapper,API方法

1、Dapper DAL层方法using System;using System.Collections.Generic;using System.Data.SqlClient;using System.Linq;using System.Text;using System.Threading.Tasks;using Dapper;using Model;namespace DAL{public class UserDAL{//显示public List Show(){u.

2020-07-09 21:01:07 134

原创 导出API方法

[HttpGet]public int Export(string FileName=“123”){var users = user.GetUserInfos();var types = type.GetUTypes();List list = (from u in usersjoin t in types on u.TId equals t.TIdselect new AllModel(){UId = u.UId,UName = u.UName,UAge = u.UAge,TId

2020-07-08 20:48:33 115

原创 添加显示分页修改反填MVC

1、控制器using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace WebMVC2.Controllers{public class UserController : Controller{// GET: Userpublic ActionResult Index(){return View();}public .

2020-07-08 20:44:18 148

原创 上传和下载

1、//DAL层FileDAL类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Model;namespace DAL{public class FileDAL{/// /// 上传文件/// /// 文件模型/// public int OnLoad(FileInfo mod){str.

2020-07-08 14:12:46 63

原创 EF迁移+应用

1、//NewDal类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace DAL.EF_CodHelper{public class NewDal where T:class,new(){Model1 db = new Model1();public List Show(){return d.

2020-07-08 10:29:07 77

原创 dapper帮助类

using System;using System.Collections.Generic;using System.Configuration;using System.Data;using System.Data.Common;using System.Data.SqlClient;using System.Linq;using Dapper;namespace DAL{public class DapperHelper{/// /// 数据库连接字符串/// privat

2020-07-07 14:31:58 157

原创 使用MVC + CacheManager,调用Redis实现数据存储操作

1//FileOperation控制器using Day18ExamRedisMVC.Models;using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace Day18ExamRedisMVC.Controllers{public class FileOperationController : Controller{AP.

2020-07-05 20:44:35 104

原创 红包方法

控制台应用using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using ServiceStack.Redis;namespace testRedis{class Program{static void Main(string[] args){double totalAmount = 100;int num =

2020-06-30 19:56:17 97

原创 EF迁移创库+使用

using System;using System.Collections.Generic;using System.Data.Entity;using System.Linq;using System.Reflection;using System.Web;namespace G6.EFCode.DALS{public class EFHelper where T:class,new(){MyContext db = new MyContext();//实例化一个上下文对象///

2020-06-30 19:49:58 65

原创 分配权限前台ajax显示

@{Layout = null;}<meta name="viewport" content="width=device-width" /><title>Main</title><link href="~/Content/bootstrap.css" rel="stylesheet" /><script src="~/Content/jquery-3.3.1.js"></script><style>

2020-06-29 20:10:54 57

原创 分配权限MVC DAL+控制器

using System;using System.Collections.Generic;using System.Linq;using System.Web;using Day13ExamMVC.Models;namespace Day13ExamMVC.DAL{public class UserDAL{/// /// 列表显示/// /// public List ShowUserRole(){string sql = @“select u.UId,UName,RName

2020-06-29 20:06:16 38

原创 验证码

<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>图片验证码</title><canvas id="canvas" width="120" height="40"><.

2020-06-26 20:10:11 52

原创 二维码,条形码,显示页面

@{Layout = null;}<meta name="viewport" content="width=device-width" /><title>Index</title><script src="~/Scripts/jquery-3.4.1.min.js"></script><script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>

2020-06-26 18:58:24 59

原创 二维码,条形码MVC控制器

using System;using System.Collections.Generic;using System.Drawing;using System.IO;using System.Linq;using System.Web;using System.Web.Mvc;namespace G6.MVC.TwoCode.Controllers{public class CodeController : Controller{// GET: Codepublic ActionRe

2020-06-26 18:56:53 81

原创 发布邮件MVC

<meta charset="utf-8" /><link href="bootstrap-3.3.7/css/bootstrap.css" rel="stylesheet" /><script src="Scripts/jquery-3.4.1.min.js"></script><script src="Scripts/jquery.unobtrusive-ajax.min.js"></script><script&g.

2020-06-26 18:50:40 50

原创 发送邮件API控制器

using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.Http;using System.Threading.Tasks;using System.Web.Http;using G6.WeekTwo.Models;namespace G6.WeekTwo.Controllers{public class MailController : ApiCo

2020-06-26 18:42:36 81

原创 MVC反射

//G3.IDAL层using System;using System.Collections.Generic;using G6.Model;namespace G3.IDAL{public interface IUserDAL{int AddUser(T model) where T:class,new(); List<T> GetList<T>() where T : class, new();}}//DBConnectionusing Syst

2020-06-17 08:18:23 75

原创 MVC 添加、显示

2020-06-09 16:01:42 112

原创 存储过程分页

create proc PageShow(@where nvarchar(max),@pageindex int,@pagesize int,@totalpage int output,@totalNum int output)asbegindeclare @totalsql nvarchar(max)set @totalsql=‘select @totalNum=COUNT() from(select ROW_NUMBER() over(order by CId) num , f

2020-06-09 15:55:39 52

原创 MVC 显示

<script> var currentPage = 1; var totalPage = 1; $(function () { show(1); }); function show(page) { var obj = {}; obj.pageSize = 3; obj.currentPage = page; obj.yhfs = $("input[name='yhfs']:

2020-06-09 15:53:12 107

原创 MVC Ajax添加

<script> function Add() { var obj = {}; obj.mc = $("#mc").val(); obj.Fenlei = $("#fenlei").val(); obj.sytj = $("#sytj").val(); obj.sysjCheck = $("input[name='xz']:checked").val(); obj.sysjAdd = $("

2020-06-09 15:33:58 108

原创 API Linq分页显示,添加

using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.Http;using System.Web.Http;using DAL;using Models;namespace _1711B.Shopping.Controllers{public class ShoppingController : ApiController{ShoppingDA

2020-06-09 15:05:06 218

空空如也

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人 TA的粉丝

提示
确定要删除当前文章?
取消 删除