最简单的代码生成器,netcore平台,EF架构,smartsofthelp

news2024/9/25 21:30:24

1.dbhelper 原生SQL操作类

2.Model 实体层

3.EF dbfirst 生成entites 实体操作类

4.EF实体接口增删改查操作方法成员

5.UI 展示层

  1. SQL数据脚本

Model

/// <summary>

/// Model实体层

/// </summary>

namespace Smart.Model

{

/// <summary>

/// 数据实体层 T_Eventsmart 投屏事件

/// </summary>

public class T_Eventsmart

{

#region 成员变量和公共属性

/// <summary>

/// 事件编号

/// </summary>

public string Id

{set; get;}

/// <summary>

/// 事件名称

/// </summary>

public string Eventname

{set; get;}

/// <summary>

/// 优先程度

/// </summary>

public int Prioritylevel

{set; get;}

/// <summary>

/// 任务状态

/// </summary>

public int Taskstatus

{set; get;}

/// <summary>

/// 耗时/秒

/// </summary>

public int Timeconsuming

{set; get;}

/// <summary>

/// 循环方式

/// </summary>

public int Circulationmode

{set; get;}

/// <summary>

/// 备注

/// </summary>

public string Remark

{set; get;}

/// <summary>

/// 是否独占

/// </summary>

public int Flgcontinue

{set; get;}

/// <summary>

/// 排序

/// </summary>

public int Sort

{set; get;}

/// <summary>

/// 添加时间

/// </summary>

public string Intime

{set; get;}

/// <summary>

/// 修改时间

/// </summary>

public string Updatetime

{set; get;}

#endregion 成员变量和公共属性

}

}

entites 生成

1.NuGet 程序包安装 以下程序依赖,请注意版本号必须一致 (3.1.0 可以更改升级为更高版本,但必须一致)

Microsoft.EntityFrameworkCore 3.1.0

Microsoft.EntityFrameworkCore.Design 3.1.0

Microsoft.EntityFrameworkCore.Tools 3.1.0

Microsoft.EntityFrameworkCore.SqlServer 3.1.0

Microsoft.EntityFrameworkCore.SqlServerTools 3.1.0

2.生成实体类访问数据库模型 ORM

Scaffold-DbContext "server="服务器ip地址";uid="数据库用户名";pwd="数据库密码";database="数据库名称";Trusted_Connection=false;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entities

--(生成项目输出文件夹)

EFData 增删改查方法

#region 自动生成增删改查成员方法

/// <summary>

/// 增加一条实体数据

/// </summary>

public int AddT_Eventsmart()

{

Entities.DBContext db = new Entities.DBContext();

T_Eventsmart ModelT_Eventsmart = new T_Eventsmart();

ModelT_Eventsmart.id=@id;

ModelT_Eventsmart.eventname=@eventname;

ModelT_Eventsmart.prioritylevel=@prioritylevel;

ModelT_Eventsmart.taskstatus=@taskstatus;

ModelT_Eventsmart.timeconsuming=@timeconsuming;

ModelT_Eventsmart.circulationmode=@circulationmode;

ModelT_Eventsmart.remark=@remark;

ModelT_Eventsmart.flgcontinue=@flgcontinue;

ModelT_Eventsmart.sort=@sort;

ModelT_Eventsmart.intime=@intime;

ModelT_Eventsmart.updatetime=@updatetime;

db.T_Eventsmart.Add(ModelT_Eventsmart);

return db.SaveChanges();

}

/// <summary>

/// 修改一条实体数据

/// </summary>

public int UpdateT_Eventsmart()

{

Entities.DBContext db = new Entities.DBContext();

T_Eventsmart ModelT_Eventsmart = new T_Eventsmart();

ModelT_Eventsmart.id=@id;

ModelT_Eventsmart.eventname=@eventname;

ModelT_Eventsmart.prioritylevel=@prioritylevel;

ModelT_Eventsmart.taskstatus=@taskstatus;

ModelT_Eventsmart.timeconsuming=@timeconsuming;

ModelT_Eventsmart.circulationmode=@circulationmode;

ModelT_Eventsmart.remark=@remark;

ModelT_Eventsmart.flgcontinue=@flgcontinue;

ModelT_Eventsmart.sort=@sort;

ModelT_Eventsmart.intime=@intime;

ModelT_Eventsmart.updatetime=@updatetime;

db.T_Eventsmart.Update(ModelT_Eventsmart);

return db.SaveChanges();

}

/// <summary>

/// 删除一条实体数据

/// </summary>

public int DeleteT_Eventsmart()

{

Entities.DBContext db = new Entities.DBContext();

T_Eventsmart ModelT_Eventsmart = new T_Eventsmart();

ModelT_Eventsmart.id=@id;

ModelT_Eventsmart.eventname=@eventname;

ModelT_Eventsmart.prioritylevel=@prioritylevel;

ModelT_Eventsmart.taskstatus=@taskstatus;

ModelT_Eventsmart.timeconsuming=@timeconsuming;

ModelT_Eventsmart.circulationmode=@circulationmode;

ModelT_Eventsmart.remark=@remark;

ModelT_Eventsmart.flgcontinue=@flgcontinue;

ModelT_Eventsmart.sort=@sort;

ModelT_Eventsmart.intime=@intime;

ModelT_Eventsmart.updatetime=@updatetime;

db.T_Eventsmart.Remove(ModelT_Eventsmart);

return db.SaveChanges();

}

/// <summary>

///单个实体查询

/// </summary>

public List<T_Eventsmart>QueryT_Eventsmart()

{

Entities.DBContext db = new Entities.DBContext();;

return db.T_Eventsmart.where(p => p.id == @id).ToList();

//return db.T_Eventsmart.ToList();

}

#endregion 自动生成增删改查成员方法

UI

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>T_Eventsmart MUI</title>

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="apple-mobile-web-app-status-bar-style" content="black">

<link rel="stylesheet" href="css/mui.min.css">

</head>

<header class="mui-bar mui-bar-nav">

<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>

<h1 class="mui-title">标题栏</h1>

</header>

<div class="mui-content">

<div class="mui-input-group" id="userform">

<div class="mui-input-row">

<label>事件编号</label>

<input type = "text" class="mui-input-clear" id="id" name="id" placeholder="事件编号">

</div>

<div class="mui-input-row">

<label>事件名称</label>

<input type = "text" class="mui-input-clear" id="eventname" name="eventname" placeholder="事件名称">

</div>

<div class="mui-input-row">

<label>优先程度</label>

<input type = "text" class="mui-input-clear" id="prioritylevel" name="prioritylevel" placeholder="优先程度">

</div>

<div class="mui-input-row">

<label>任务状态</label>

<input type = "text" class="mui-input-clear" id="taskstatus" name="taskstatus" placeholder="任务状态">

</div>

<div class="mui-input-row">

<label>耗时/秒</label>

<input type = "text" class="mui-input-clear" id="timeconsuming" name="timeconsuming" placeholder="耗时/秒">

</div>

<div class="mui-input-row">

<label>循环方式</label>

<input type = "text" class="mui-input-clear" id="circulationmode" name="circulationmode" placeholder="循环方式">

</div>

<div class="mui-input-row">

<label>备注</label>

<input type = "text" class="mui-input-clear" id="remark" name="remark" placeholder="备注">

</div>

<div class="mui-input-row">

<label>是否独占</label>

<input type = "text" class="mui-input-clear" id="flgcontinue" name="flgcontinue" placeholder="是否独占">

</div>

<div class="mui-input-row">

<label>排序</label>

<input type = "text" class="mui-input-clear" id="sort" name="sort" placeholder="排序">

</div>

<div class="mui-input-row">

<label>添加时间</label>

<input type = "text" class="mui-input-clear" id="intime" name="intime" placeholder="添加时间">

</div>

<div class="mui-input-row">

<label>修改时间</label>

<input type = "text" class="mui-input-clear" id="updatetime" name="updatetime" placeholder="修改时间">

</div>

<div class="mui-button-row">

<button type ="button" class="mui-btn mui-btn-primary">确 认</button>

<button type ="button" class="mui-btn mui-btn-danger">取 消</button>

</div>

</div>

</div>

<script src ="js/mui.min.js"></script>

</body>

</html>

SQL数据脚本

--插入

insert into T_Eventsmart values ('@id','@eventname','@prioritylevel','@taskstatus','@timeconsuming','@circulationmode','@remark','@flgcontinue','@sort','@intime','@updatetime');

--修改

update T_Eventsmart set id='@id',eventname='@eventname',prioritylevel='@prioritylevel',taskstatus='@taskstatus',timeconsuming='@timeconsuming',circulationmode='@circulationmode',remark='@remark',flgcontinue='@flgcontinue',sort='@sort',intime='@intime',updatetime='@updatetime' where + strWhere ;

--删除

delete FROM T_Eventsmart where + strWhere ;

--查询

select id, eventname, prioritylevel, taskstatus, timeconsuming, circulationmode, remark, flgcontinue, sort, intime, updatetime FROM T_Eventsmart where + strWhere ;

--索引

ALTER TABLE T_Eventsmart ADD INDEX indexT_Eventsmart (id)

smartsofthelp 开发辅助工具 代码生成器下载地址

https://pan.baidu.com/s/1RzJq5rKEJWq5xGUIo7jYjw?pwd=8888

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/376349.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

珠海数据智能监控器+SaaS平台 轻松实现SMT生产管控

数据智能监控器 兼容市面上99%的SMT设备 直接读取设备生产数据与状态&#xff0c;如&#xff1a;计划产出、实际产出、累计产出、停机、节拍、线利用率、直通率、停产时间、工单状态、OEE…… 产品功能价值 ◎ OEE不达标报警&#xff0c;一手掌握生产效能 ◎ 首检/巡检/成…

研发人员最希望项目经理和PMO能够做什么?看完不要惊讶

作为项目经理和PMO你考虑过自己在其他人眼中的形象么&#xff1f;知道各个环节最希望你做什么吗&#xff1f;对于最常打交道的研发人员&#xff0c;你知道他们最希望你做什么吗&#xff1f; 如果不能了解其他环节对你的期望&#xff0c;你往往很难获得认同&#xff0c;为此&am…

Golang实现RabbitMQ中死信队列各个情况

下面这段教程针对是你已经有一些基本的MQ的知识&#xff0c;比如说能够很清楚的理解queue、exchange等概念&#xff0c;如果你还不是很理解&#xff0c;我建议你先访问官网查看基本的教程。 文章目录1、造成死信队列的主要原因2、操作逻辑图3、代码实战3.1 针对原因1&#xff1…

win10下Vue环境搭建(脚手架初始化+项目启动)教程(详解多图)

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录前言一、下载安装node.js二、node.js环境配置三、下载安装vue脚手架前言 初学Vue 搭环境快把我整死了QAQ 差点入门即入土 一、下载安装node.js ①下载地址&#x…

bug的创建和等级

1.如何合理的创建一个bug 创建bug的要素 &#xff1a;问题的版本&#xff0c;发现问题的环境&#xff0c;发现问题的步骤&#xff0c;预取结果&#xff0c;实际结果。 eg&#xff1a; 1.问题的版本&#xff1a;谷歌浏览器108版本 2.发现问题的环境&#xff1a;windows11家庭版…

算法训练营 day56 动态规划 最长递增子序列 最长连续递增序列 最长重复子数组

算法训练营 day56 动态规划 最长递增子序列 最长连续递增序列 最长重复子数组 最长递增子序列 300. 最长递增子序列 - 力扣&#xff08;LeetCode&#xff09; 给你一个整数数组 nums &#xff0c;找到其中最长严格递增子序列的长度。 子序列 是由数组派生而来的序列&#x…

如何理解API?API 是如何工作的?(5分钟诠释)

大家可能最近经常听到 API 这个概念&#xff0c;那什么是API&#xff0c;它又有什么特点和好处呢&#xff1f; wiki 百科镇楼 …[APIs are] a set of subroutine definitions, protocols, and tools for building application software. In general terms, it’s a set of cle…

Linux文件属性--软连接和硬链接

文章目录软链接硬链接软链接和硬链接的区别软链接 软链接&#xff08;Soft Link&#xff09;又叫符号链接&#xff08;Symbolic Link &#xff09;&#xff0c;是linux特殊文件的一种&#xff0c;文件类型为l,它的数据是它所链接的文件或目录的路径。软链接可以跨磁盘和 分区…

《数据库系统概论》学习笔记——第三章 关系数据库标准语言SQL

教材为数据库系统概论第五版&#xff08;王珊&#xff09; 最重量级的一章。从后续的学习&#xff0c;基本所有实验&#xff0c;大作业和考试都会涉及SQL&#xff0c;SQL实际上是有很多变化的&#xff0c;书上讲的只是最基本的&#xff08;做了大作业才知道SQL能有这么多变化&a…

移动端自动化测试(一)appium环境搭建

自动化测试有主要有两个分类&#xff0c;接口自动化和ui自动化&#xff0c;ui自动化呢又分移动端的和web端的&#xff0c;当然还有c/s架构的&#xff0c;这种桌面程序应用的自动化&#xff0c;使用QTP&#xff0c;只不过现在没人做了。 web自动化呢&#xff0c;现在基本上都是…

k8s 强制删除 namespace

k8s 强制删除 namespace1、命名空间查看资源2、删除k8s指定命名空间3、强制删除3.1、导出命名空间jsno3.2、使用kubectl代理3.3、代理测试3.4、使用http接口进行删除1、命名空间查看资源 kubectl api-resources -o name --verbslist --namespaced | xargs -n 1 kubectl get --…

jsp运动会管理系统论文

技术&#xff1a;Java、JSP等摘要&#xff1a;运动会作为各项体育运动的基础&#xff0c;具有广泛的群众性。每年一度的学校运动会声势浩 大&#xff0c;是提高、检验学生的健康水平&#xff0c;开展全民健身运动的有效途径。在规模上虽然不如大型运动会&#xff0c;但由于比赛…

【Python数据挖掘入门】2.2文本分析-中文分词(jieba库cut方法/自定义词典load_userdict/语料库分词)

中文分词就是将一个汉字序列切分成一个一个单独的词。例如&#xff1a; 另外还有停用词的概念&#xff0c;停用词是指在数据处理时&#xff0c;需要过滤掉的某些字或词。 一、jieba库 安装过程见&#xff1a;https://blog.csdn.net/momomuabc/article/details/128198306 ji…

Docker -- Docker底层原理深度剖析

概论 谈到Docker原理&#xff0c;我们先来三板斧。 Linux命名空间&#xff08;namespace&#xff09;控制组&#xff08;cgroups&#xff09;联合文件系统&#xff08;UnionFS&#xff09; 然后我们心中要明白一件事情&#xff1a; 容器是一种特殊的进程。容器技术的核心功能…

vue2 diff算法

diff是什么 diff 算法是一种通过同层的树节点进行比较的高效算法 其有两个特点&#xff1a; ♥比较只会在同层级进行, 不会跨层级比较 ♥在diff比较的过程中&#xff0c;循环从两边向中间比较 diff 算法的在很多场景下都有应用&#xff0c;在 vue 中&#xff0c;作用于虚拟 dom…

HTML#4超链接标签,列表标签,表格标签和布局标签

一. 超链接标签介绍<a> 定义超链接,用于连接到另一个资源herf: 指定访问资源的URLtarget: 指定打开资源的方式代码<!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>超链接标签</title> <…

ES6-ES13教程笔记(一)

课程目录 1、走入ES6 1.1、初识ES6 1.2 let声明变量与const声明常量 1、let声明 1、块级作用域&#xff0c;不会成为全局变量影响别人&#xff1b; 2、不允许重复声明&#xff1b; 3、变量不会提升&#xff1b;&#xff08;会存在暂时性死区&#xff09; 4、不与顶层对象挂…

模糊神经网络(FNN)的实现(Python,附源码及数据集)

文章目录一、理论基础1、模糊神经网络结构2、前向传播过程3、反向传播过程4、建模步骤二、模糊神经网络的实现1、训练过程&#xff08;FNN.py&#xff09;2、测试过程&#xff08;test.py&#xff09;3、测试结果4、参考源码及实验数据集一、理论基础 模糊神经网络&#xff08…

阿里大数据之路总结

一、数据采集 二、数据同步 2.1、数据同步方式&#xff1a; 数据同步的三种方式&#xff1a;直连方式、数据文件同步、数据库日志解析方式 关系型数据库的结构化数据&#xff1a;MYSQL、Oracle、DB2、SQL Server非关系型数据库的非结构化数据&#xff08;数据库表形式存储&am…

力扣Top100题之两数相加(Java解法)

0 题目描述 给你两个 非空 的链表&#xff0c;表示两个非负的整数。它们每位数字都是按照 逆序 的方式存储的&#xff0c;并且每个节点只能存储 一位 数字。 请你将两个数相加&#xff0c;并以相同形式返回一个表示和的链表。 你可以假设除了数字 0 之外&#xff0c;这两个数…