软件开发框架业务表单开发流程

软件开发框架业务表单开发流程,快速开发工具辅助开发。
软件开发框架流程

以物料采购订单为例讲解,产品系列:PurOrder物料采购:PurOrderDetail,物料采购从属于产品系列。(注意红色箭头自动生成代码处)

软件开发框架架构图


软件开发框架流程介绍:

1、需求分析,领域建模
PurOrderDetail.cs: \YunMFramework.Domain\Model\PurOrder
2、建立数据库表

/****** Object:  Table [dbo].[PurOrder]    Script Date: 08/25/2018 09:17:37 ******/
SET ANSI_NULLS ON
GO

/****** Please execute follow sql script in sqlserver management studio ******/
/****** Object:  Table [dbo].[tb_PurOrder]    Script Date: 2018/11/17 19:56:29 ******/
/****** Object:  Create the Main Table ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[tb_PurOrder](
 [Id] [int] IDENTITY(1,1) NOT NULL,
 [Code] [nvarchar] (50) Not Null,
 [PurDate] [datetime]  Not Null,
 [ProviderId] [int]  Null,
 [Used] [bit]  Not Null,
 [Payable] [int]  Null,
 [Paid] [int]  Null,
 [State] [bit]  Not Null,
 [PayType] [nvarchar] (100) Null,
 [Remark] [nvarchar] (300) Null,
 [Extend1] [nvarchar] (400) Null,
    [CreateAt] [datetime] NULL,
 [CreateBy] [nvarchar](max) NULL,
 [ModifyAt] [datetime] NULL,
 [ModifyBy] [nvarchar](max) NULL,
 CONSTRAINT [PK_dbo.tb_PurOrder] PRIMARY KEY CLUSTERED 
(
 [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[tb_PurOrder]  WITH CHECK ADD  CONSTRAINT [FK_dbo.tb_PurOrder_dbo.tb_Provider_ProviderId] FOREIGN KEY([ProviderId]) 
REFERENCES [dbo].[Provider] ([Id])
GO
ALTER TABLE [dbo].[tb_PurOrder] CHECK CONSTRAINT [FK_dbo.tb_PurOrder_dbo.tb_Provider_ProviderId]
GO
ALTER TABLE [dbo].[tb_PurOrder]  WITH CHECK ADD  CONSTRAINT [FK_dbo.tb_PurOrder_dbo.tb_PurOrder_Payable] FOREIGN KEY([Payable]) 
REFERENCES [dbo].[PurOrder] ([Id])
GO
ALTER TABLE [dbo].[tb_PurOrder] CHECK CONSTRAINT [FK_dbo.tb_PurOrder_dbo.tb_PurOrder_Payable]
GO

/****** Object:  Table [dbo].[PurOrderDetail]    Script Date: 08/25/2018 09:17:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[tb_PurOrderDetail](
 [Id] [int] IDENTITY(1,1) NOT NULL,
 [PurOrderID] int NULL,
 [InventoryId] [int]  Not Null,
 [InventoryName] [nvarchar] (100) Not Null,
 [OrderNum] [int]  Not Null,
 [Price] [decimal] (18,2) Null,
 [State] [bit]  Null,
    [CreateAt] [datetime] NULL,
 [CreateBy] [nvarchar](max) NULL,
 [ModifyAt] [datetime] NULL,
 [ModifyBy] [nvarchar](max) NULL,
CONSTRAINT [PK_dbo.tb_PurOrderDetail] PRIMARY KEY CLUSTERED 
(
 [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[tb_PurOrderDetail]  WITH CHECK ADD  CONSTRAINT [FK_dbo.tb_PurOrderDetail_dbo.tb_PurOrder_PurOrderID] FOREIGN KEY([PurOrderID])
REFERENCES [dbo].[tb_PurOrder] ([Id])
GO
ALTER TABLE [dbo].[tb_PurOrderDetail] CHECK CONSTRAINT [FK_dbo.tb_PurOrderDetail_dbo.tb_PurOrder_PurOrderID]
GO

ALTER TABLE [dbo].[tb_PurOrderDetail]  WITH CHECK ADD  CONSTRAINT [FK_dbo.tb_PurOrderDetail_dbo.Inventory_InventoryId] FOREIGN KEY([InventoryId]) 
REFERENCES [dbo].[Inventory] ([Id])
GO
ALTER TABLE [dbo].[tb_PurOrderDetail] CHECK CONSTRAINT [FK_dbo.tb_PurOrderDetail_dbo.tb_Inventory_InventoryId]
GO

3、建立视图模型(该步可省,可领域模型代替)

4、建立查询模型

PurOrderDetailQuery类 :\YunMFramework.Domain\QueryCondition\PurOrderQuery.cs  代码:
public class PurOrderQuery : OrderPagingQuery<PurOrder>
    {
        public PurOrderQuery()
        {
            //设定需要排序的字段
            this.OrderFieldStore.Add(t => t.Id, OrderType.Ascending);
        }
        
        public int? Id { get; set; }
        public string Code { get; set; }
        public DateTime? PurDate { get; set; }
        public int? ProviderId { get; set; }
        public bool? Used { get; set; }
        public int? Payable { get; set; }
    }

5、新建用户视图
PurOrder视图层: \ YunMFramework.Web.Site\Views\PurOrder

6、建立控制层
PurOrderController.cs:\ YunMFramework.Web.Site\Controllers

7、建立业务服务接口层
IPurOrderService:\ YunMFramework\YunMFramework.IServices 添加行为接口:
     
8、建立业务服务实现层
PurOrderService:\YunMFramework.Services实现接口行为函数

9、业务功能插入功能配置表

Data.init.sql:\YunMFramework.Web.Site\App_Data    SystemFunction中插入功能
insert into [SystemFunction](FunctionCode,FunctionName,GroupName,DisplayOrder) values('PurOrderManage','PurOrderManage','采购管理',1)
10、往站点功能地图中配置业务功能权限
<mvcSiteMapNode title="$resources:PurOrder.List" controller="PurOrder" action="Index" isMenu="true" sidebarMenu="true" sidebarIcon="" roles="PurOrderManage">
      <mvcSiteMapNode title="$resources:PurOrder.Create" controller="PurOrder" action="Create" roles="PurOrderManage"/>
      <mvcSiteMapNode title="$resources:PurOrder.Edit" controller="PurOrder" action="Edit" roles="PurOrderManage"/>
      <mvcSiteMapNode title="$resources:PurOrder.Details" controller="PurOrder" action="Detail" roles="PurOrderManage"/>
      <mvcSiteMapNode title="$PurOrder.Delete" controller="PurOrder" action="Delete" roles="PurOrderManage"/>
</mvcSiteMapNode>

上述代码都可以通过快速开发工具一键生成,请关注快速开发工具相关视频。
编译后F5运行。
软件开发框架业务表单开发流程,快速开发工具辅助开发。

标签: Web开发框架开发指南红宝书

网站&系统开发技术学习交流群:463167176

本站文章除注明转载外,均为本站原创或翻译,欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,共创和谐网络环境。
转载请注明:文章转载自:软件开发框架 » 软件开发框架业务表单开发流程
本文标题:软件开发框架业务表单开发流程
本文地址:http://www.hocode.com/OrgTec/Plugin/0022.html

相关文章: Web开发框架功能权限配置说明

电话
电话 18718672256

扫一扫
二维码