ERP合同管理(二十七)
需要实现的基本业务:
相关的用例图:
相关业务的封装:
相关的约定:
合同信息添加业务流程:
添加的存储过程
SET QUOTED_IDENTIFIER ON
SET ANSI_NULLS ON
GO ------------------------------------
--用途:增加一条记录
--项目名称:
--说明:
--时间:2011/11/11 22:07:38
------------------------------------
CREATE PROCEDURE [dbo].[BioCRMContract_ADD]
@ContractID int output,
@ContractName nvarchar(200),
@CustomerID int,
@CreateTime datetime,
@ContractSum money,
@SignTime datetime,
@EffectiveTime datetime,
@EndTime datetime,
@ContractType nvarchar(100),
@UserID int,
@ExecutiveState nvarchar(50),
@ContractDesc nvarchar(4000) AS
INSERT INTO [BioCRMContract](
[ContractName],[CustomerID],[CreateTime],[ContractSum],[SignTime],[EffectiveTime],[EndTime],[ContractType],[UserID],[ExecutiveState],[ContractDesc]
)VALUES(
@ContractName,@CustomerID,@CreateTime,@ContractSum,@SignTime,@EffectiveTime,@EndTime,@ContractType,@UserID,@ExecutiveState,@ContractDesc
)
SET @ContractID = @@IDENTITY
添加的业务:
/// <summary>
/// 添加一条合同信息对象并返回当前合同编号
/// </summary>
/// <param name="mode">BioCRMContract</param>
/// <returns>int</returns>
public int BioCRMContractadd(BioCRMContract model)
{
SqlParameter[] parameters = {
new SqlParameter("@ContractID", SqlDbType.Int,4),
new SqlParameter("@ContractName", SqlDbType.NVarChar,200),
new SqlParameter("@ContractNumber", SqlDbType.NVarChar,100),
new SqlParameter("@CustomerID", SqlDbType.Int,4),
new SqlParameter("@CreateTime", SqlDbType.DateTime),
new SqlParameter("@ContractSum", SqlDbType.Money,8),
new SqlParameter("@SignTime", SqlDbType.DateTime),
new SqlParameter("@EffectiveTime", SqlDbType.DateTime),
new SqlParameter("@EndTime", SqlDbType.DateTime),
new SqlParameter("@ContractType", SqlDbType.NVarChar,100),
new SqlParameter("@UserID", SqlDbType.Int,4),
new SqlParameter("@ExecutiveState", SqlDbType.NVarChar,50),
new SqlParameter("@ContractDesc", SqlDbType.NVarChar,4000),
new SqlParameter("@AssessorID", SqlDbType.Int,4)
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Value = model.ContractName;
parameters[2].Value = model.ContractNumber;
parameters[3].Value = model.CustomerID;
parameters[4].Value = model.CreateTime;
parameters[5].Value = model.ContractSum;
parameters[6].Value = model.SignTime;
parameters[7].Value = model.EffectiveTime;
parameters[8].Value = model.EndTime;
parameters[9].Value = model.ContractType;
parameters[10].Value = model.UserID;
parameters[11].Value = model.ExecutiveState;
parameters[12].Value = model.ContractDesc;
parameters[13].Value = model.AssessorID; int count= DataBaseHelper.ExcuteSqlReturnInt("BioCRMContract_ADD", CommandType.StoredProcedure, parameters);
if (count != 0)
{
return int.Parse(parameters[0].Value.ToString());
}
else
{
return 0;
}
}
修改的存储过程:
CREATE PROCEDURE [dbo].[BioCRMContract_Update]
@ContractID int,
@ContractName nvarchar(200),
@CustomerID int,
@CreateTime datetime,
@ContractSum money,
@SignTime datetime,
@EffectiveTime datetime,
@EndTime datetime,
@ContractType nvarchar(100),
@UserID int,
@ExecutiveState nvarchar(50),
@ContractDesc nvarchar(4000),
@AssessorAuditing bit,
@DeleteState bit
AS
UPDATE [BioCRMContract] SET
[ContractName] = @ContractName,[CustomerID] = @CustomerID,[CreateTime] = @CreateTime,[ContractSum] = @ContractSum,[SignTime] = @SignTime,[EffectiveTime] = @EffectiveTime,[EndTime] = @EndTime,[ContractType] = @ContractType,[UserID] = @UserID,[ExecutiveState] = @ExecutiveState,[ContractDesc] = @ContractDesc,AssessorAuditing = @AssessorAuditing,[DeleteState] = @DeleteState
WHERE ContractID=@ContractID
业务逻辑的代码:
/// <summary>
/// 修改一条合同信息对象
/// </summary>
/// <param name="mode">BioCRMContract</param>
/// <returns>int</returns>
public int BioCRMContractaUpdate(BioCRMContract model)
{
SqlParameter[] parameters = {
new SqlParameter("@ContractID", SqlDbType.Int,4),
new SqlParameter("@ContractName", SqlDbType.NVarChar,200),
new SqlParameter("@ContractNumber", SqlDbType.NVarChar,100),
new SqlParameter("@CustomerID", SqlDbType.Int,4),
new SqlParameter("@CreateTime", SqlDbType.DateTime),
new SqlParameter("@ContractSum", SqlDbType.Money,8),
new SqlParameter("@SignTime", SqlDbType.DateTime),
new SqlParameter("@EffectiveTime", SqlDbType.DateTime),
new SqlParameter("@EndTime", SqlDbType.DateTime),
new SqlParameter("@ContractType", SqlDbType.NVarChar,100),
new SqlParameter("@UserID", SqlDbType.Int,4),
new SqlParameter("@ExecutiveState", SqlDbType.NVarChar,50),
new SqlParameter("@ContractDesc", SqlDbType.NVarChar,4000),
new SqlParameter("@AssessorID", SqlDbType.Int,4),
new SqlParameter("@DeleteState", SqlDbType.Bit,1)};
parameters[0].Value =model.ContractID;
parameters[1].Value = model.ContractName;
parameters[2].Value = model.ContractNumber;
parameters[3].Value = model.CustomerID;
parameters[4].Value = model.CreateTime;
parameters[5].Value = model.ContractSum;
parameters[6].Value = model.SignTime;
parameters[7].Value = model.EffectiveTime;
parameters[8].Value = model.EndTime;
parameters[9].Value = model.ContractType;
parameters[10].Value = model.UserID;
parameters[11].Value = model.ExecutiveState;
parameters[12].Value = model.ContractDesc;
parameters[13].Value = model.AssessorID;
parameters[14].Value = model.DeleteState; int count = DataBaseHelper.ExcuteSqlReturnInt("BioCRMContract_Update", CommandType.StoredProcedure, parameters);
if (count != 0)
{
return int.Parse(parameters[0].Value.ToString());
}
else
{
return 0;
}
}
合同对象添加的存储过程:
CREATE PROCEDURE [dbo].[BioErpCRMContractDocument_ADD]
@DocumentID int,
@ContractID int
AS
INSERT INTO [BioErpCRMContractDocument](
[DocumentID],[ContractID]
)VALUES(
@DocumentID,@ContractID
)
添加的代码:
/// <summary>
/// 合同文档对象添加
/// </summary>
/// <param name="document">CRMContractDocument</param>
/// <returns>int</returns>
public int CRMContractDocumentADD(CRMContractDocument document)
{
SqlParameter[] parameters = {
new SqlParameter("@DocumentID", SqlDbType.Int,4),
new SqlParameter("@ContractID", SqlDbType.Int,4)
}; parameters[0].Value = document.DocumentID;
parameters[1].Value = document.ContractID;
return DataBaseHelper.ExcuteSqlReturnInt("BioErpCRMContractDocument_ADD", CommandType.StoredProcedure, parameters);
}
文档修改的记录:
CREATE PROCEDURE BioErpCRMContractDocument_Update
@AccessoryID int,
@DocumentID int,
@ContractID int,
@DeleteState bit
AS
UPDATE [BioErpCRMContractDocument] SET
[DocumentID] = @DocumentID,[ContractID] = @ContractID,[DeleteState] = @DeleteState
WHERE AccessoryID=@AccessoryID
业务逻辑:
/// <summary>
/// 合同文档对象修改
/// </summary>
/// <param name="document">CRMContractDocument</param>
/// <returns>int</returns>
public int CRMContractDocumentUpdate(CRMContractDocument model)
{
SqlParameter[] parameters = {
new SqlParameter("@AccessoryID", SqlDbType.Int,4),
new SqlParameter("@DocumentID", SqlDbType.Int,4),
new SqlParameter("@ContractID", SqlDbType.Int,4),
new SqlParameter("@DeleteState", SqlDbType.Bit,1)};
parameters[0].Value = model.AccessoryID;
parameters[1].Value = model.DocumentID;
parameters[2].Value = model.ContractID;
parameters[3].Value = model.DeleteState;
return DataBaseHelper.ExcuteSqlReturnInt("BioErpCRMContractDocument_Update", CommandType.StoredProcedure, parameters);
}
任务流程表中添加的存储过程:
CREATE PROCEDURE TaskListRecord_ADD
@Subject nvarchar(100),
@TaskID int,
@TaskTableID int,
@Transmitter int,
@Accepter int,
@Pass int,
@AuditingSate int,
@Mind nvarchar(500),
@FirstSumitTime datetime,
@FirstTransmitter int,
@FirstAccepter int,
@DepartMentId int,
@SumitTime datetime AS
INSERT INTO [TaskListRecord](
[Subject],[TaskID],[TaskTableID],[Transmitter],[Accepter],[Pass],[AuditingSate],[Mind],[FirstSumitTime],[FirstTransmitter],[FirstAccepter],[DepartMentId],[SumitTime]
)VALUES(
@Subject,@TaskID,@TaskTableID,@Transmitter,@Accepter,@Pass,@AuditingSate,@Mind,@FirstSumitTime,@FirstTransmitter,@FirstAccepter,@DepartMentId,@SumitTime
)
写在共用类中的业务:
/// <summary>
/// 向任务流程表添加一条记录
/// </summary>
/// <param name="record">TaskListRecord</param>
/// <returns>int</returns>
public int TaskListRecordAdd(TaskListRecord model)
{
SqlParameter[] parameters = {
new SqlParameter("@Subject", SqlDbType.NVarChar,100),
new SqlParameter("@TaskID", SqlDbType.Int,4),
new SqlParameter("@TaskTableID", SqlDbType.Int,4),
new SqlParameter("@Transmitter", SqlDbType.Int,4),
new SqlParameter("@Accepter", SqlDbType.Int,4),
new SqlParameter("@Pass", SqlDbType.Int,4),
new SqlParameter("@AuditingSate", SqlDbType.Int,4),
new SqlParameter("@Mind", SqlDbType.NVarChar,500),
new SqlParameter("@FirstSumitTime", SqlDbType.DateTime),
new SqlParameter("@FirstTransmitter", SqlDbType.Int,4),
new SqlParameter("@FirstAccepter", SqlDbType.Int,4),
new SqlParameter("@DepartMentId", SqlDbType.Int,4),
new SqlParameter("@SumitTime", SqlDbType.DateTime)}; parameters[0].Value = model.Subject;
parameters[1].Value = model.TaskID;
parameters[2].Value = model.TaskTableID;
parameters[3].Value = model.Transmitter;
parameters[4].Value = model.Accepter;
parameters[5].Value = model.Pass;
parameters[6].Value = model.AuditingSate;
parameters[7].Value = model.Mind;
parameters[8].Value = model.FirstSumitTime;
parameters[9].Value = model.FirstTransmitter;
parameters[10].Value = model.FirstAccepter;
parameters[11].Value = model.DepartMentId;
parameters[12].Value = model.SumitTime; return DataBaseHelper.ExcuteSqlReturnInt("TaskListRecord_ADD", CommandType.StoredProcedure, parameters); }
前端页面用到的CSS样式:
.Inupttable{ width:100%; border:solid 1px; border-collapse:collapse; }
.Inupttable td{ border:solid 1px ; height:30px;}
.Inupttable input{ width:80px; border:none; border-bottom:solid #000 1px; background-color:transparent;}
.Inupttable textarea{border:none; border-bottom:solid #000 1px; background-color:transparent;}
.Inupttable select{border:none; border-bottom:solid #000 1px; background-color:#eee;}
.Inupttable option{ background-color:#eee;}
.Inupttable .btnchoose{background-color:#FFAA00; width:50px;}
部门下拉的列表:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DepartMentListSelect.aspx.cs" Inherits="BioErpWeb.PersonList.DepartMentListSelect" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title> </head>
<body>
<form id="form1" runat="server">
<div>
<select multiple="multiple" id="sltUserList" style=" width:80px; height:270px; margin:0px;">
<%=this.GetUserList%>
</select>
</div>
</form>
</body>
</html>
显示的后台:
public string GetUserList
{
get {
string strHtml = "";
if (Request.QueryString["DepartmentName"] == null)
{
DataSet ds = SqlComm.GetDataByCondition("Department", "top 10 DepartmentId,DepartmentName", " 1=1 order by DisplayOrder");
foreach (DataRow dr in ds.Tables[0].Rows)
{
strHtml += "<option value='" + dr["DepartmentId"] + "'>" + dr["DepartmentName"] + "</option>";
} }
else
{
DataSet ds = SqlComm.GetDataByCondition("Department", "top 10 DepartmentId,DepartmentName", " DepartmentName like '" + Request.QueryString["DepartmentName"].ToString() + "%' order by DisplayOrder");
foreach (DataRow dr in ds.Tables[0].Rows)
{
strHtml += "<option value='" + dr["DepartmentId"] + "'>" + dr["DepartmentName"] + "</option>";
}
} return strHtml;
}
}
部门显示的前端:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DepartMentList.aspx.cs" Inherits="BioErpWeb.PersonList.DepartMentList" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function search() {
if (document.getElementById("txtSearchName").value == "") {
alert("请输入员工姓名");
return;
}
document.getElementById("PersonIframeList").src = "DepartMentListSelect.aspx?DepartmentName=" + encodeURIComponent(document.getElementById("txtSearchName").value); } function choose() {
window.returnValue = PersonIframeList.document.getElementById("sltUserList").value;
window.close();
}
</script>
<style type="text/css">
.style1
{
width: 157px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style=" width:310px; ">
<tr>
<td class="style1">部门名称
</td>
<td>
<input id="txtSearchName" name="txtSearchName" type="text" size="10" maxlength="10"/> <input type="button" value="查询" onclick="search()" />
</td>
</tr>
<tr>
<td class="style1">
<iframe width="120px" id="PersonIframeList" frameborder=0 src="DepartMentListSelect.aspx" height="310px" > </iframe>
</td>
<td style=" vertical-align:bottom; padding-bottom:20px;">
<input type="button" value="选择" onclick="choose()"/>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
客户选择的js:
//客户选择对话框
function showCustomerDialog3() {
var re = showModalDialog("../../PersonList/CustomerList.aspx", "", "dialogWidth=320px;dialogHeight=350px");
var obj = window.event.srcElement;
var td = obj.parentNode;
var txts = td.getElementsByTagName('input');
if (re == null || re == "") { if (txts[0].value == "" || txts[0].value == null) {
txts[0].value = "请选择";
}
}
else {
txts[0].value = re;
}
}
ERP合同管理(二十七)的更多相关文章
- ERP合同管理二(三十)
未审核表单列表显示: 1.用户登录后,根据登录用户加载审核流程表中属于当前登录用户的未审核表单.2.点击选中未审核表单跳转到指定审核流程页面 if (Request.QueryString[" ...
- ERP合同管理流程查询(三十一)
根据任务表编号,及相关表单编号获取当前流程表的编号: CREATE FUNCTION [dbo].[FN_GetDynamicId] ( @tasktableid INT, @taskid INT ) ...
- ERP合同审核流程处理(二十九)
合同审批流程: 前端的代码: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind=" ...
- ERP订单管理的操作与设计--开源软件诞生19
赤龙ERP订单模块讲解--第19篇 用日志记录"开源软件"的诞生 [点亮星标]----祈盼着一个鼓励 博主开源地址: 码云:https://gitee.com/redragon/r ...
- BPM合同管理解决方案分享
一.方案概述合同是组织与组织间所订协议的法律 表现形式,体现着双方对于合作在法律和道德上的承诺.然而,大多数企业的合同管理都或多或少存在合同审批过程不规范.签订草率.审批权责不清.合同执行跟踪难.合同 ...
- 转:二十七、Java图形化界面设计——容器(JFrame)
转:http://blog.csdn.net/liujun13579/article/details/7756729 二十七.Java图形化界面设计——容器(JFrame) 程序是为了方便用户使用的, ...
- 二十七、Java图形化界面设计——容器(JFrame)
摘自http://blog.csdn.net/liujun13579/article/details/7756729 二十七.Java图形化界面设计--容器(JFrame) 程序是为了方便用户使用的, ...
- VMware vSphere 服务器虚拟化之二十七桌面虚拟化之View中使用Thinapp软件虚拟化
VMware vSphere 服务器虚拟化之二十七桌面虚拟化之View中使用Thinapp软件虚拟化 VMware ThinApp 应用程序虚拟化软件是无代理解决方案,通过将应用程序隔离并封装为EXE ...
- 访问者模式 Visitor 行为型 设计模式(二十七)
访问者模式 Visitor <侠客行>是当代作家金庸创作的长篇武侠小说,新版电视剧<侠客行>中,开篇有一段独白: “茫茫海外,传说有座侠客岛,岛上赏善罚恶二使,每隔十年 ...
随机推荐
- Ubuntu17安装MySql5.7
安装: sudo apt-get update sudo apt-get install mysql-server 配置远程访问: vi /etc/mysql/mysql.conf.d/mysqld. ...
- MT【100】经典计数之分配问题
注意:此讲适合联赛一试学生,以及参加清华北大等名校的自主招生的学生. 经典计数之分配问题:把n个球放进k个盒子.考虑分配方法有三类:1.无限制 2.每个盒子至多一个(f 单的)3.每个盒子至少一个(f ...
- MT【86】两个绝对值之和最大
分析:这里只需要注意到$(|x|+|y|)_{max}=max\{|x+y|,|x-y|\}$,所以只需求$max\{|20a|,|14b|\}$ 进而变成熟悉的反解系数问题.容易知道最大值为$a=2 ...
- 【BZOJ1028】[JSOI2007]麻将(贪心)
[BZOJ1028][JSOI2007]麻将(贪心) 题面 BZOJ 洛谷 题解 感觉好久没打过麻将了,似乎都快不会打了. 这个数据范围看着就觉得是\(O(n^2m)\). 那么就枚举听哪张牌,然后枚 ...
- 【CF912E】Prime Game(meet in the middle)
[CF912E]Prime Game(meet in the middle) 题面 CF 懒得翻译了. 题解 一眼题. \(meet\ in\ the\ middle\)分别爆算所有可行的两组质数,然 ...
- Goodbye My Old Days
几天前的CTT的胸牌上印着熟悉的初中学校的名字,回想起自己早已废弃的博客,不禁感慨万分.如你所见,一位名叫supy的菜鸡OIer曾经小心翼翼地写下一篇篇文章来装点这个地方,时间是初二的ZJOID1直到 ...
- CF1110D Jongmah(DP)
题目链接:CF原网 洛谷 题目大意:有 $n$ 个数,每个都不超过 $m$.一个三元组 $(a,b,c)$ 是合法的当且仅当 $a=b=c$ 或者 $a+1=b=c-1$.每个数只能用一次.问最多能 ...
- JavaScript -- 标签 , Break 和 Continue 语句
break 语句用于跳出循环. continue 用于跳过循环中的一个迭代. 标签引用,break 语句可用于跳出任何 JavaScript 代码块. demo: <!DOCTYPE html& ...
- 浅谈使用NIO,AIO的感受
花了十多天的时间把原来的WEB服务由BIO(阻塞IO)模式改写成NIO(非阻塞IO)模式,然后在xp机子上用ab测试并发性能,确实提升了30%左右的并发性能,测试完成后,当时感觉还是挺满意的.几天前在 ...
- SQL Server深入理解“锁”机制
相比于 SQL Server 2005(比如快照隔离和改进的锁与死锁监视),SQL Server 2008 并没有在锁的行为和特性上做出任何重大改变.SQL Server 2008 引入的一个主要新特 ...