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 <侠客行>是当代作家金庸创作的长篇武侠小说,新版电视剧<侠客行>中,开篇有一段独白: “茫茫海外,传说有座侠客岛,岛上赏善罚恶二使,每隔十年 ...
随机推荐
- delphi Form属性设置 设置可实现窗体无最大化,并且不能拖大拖小
以下设置可实现窗体无最大化,并且不能拖大拖小BorderIcon 设为---biMax[False] biHelp [False]BorderStyle 设为---bsSingle 参考------- ...
- 模拟事件【JavaScript高级程序设计第三版】
事件,就是网页中某个特别值得关注的瞬间.事件经常由用户操作或通过其他浏览器功能来触发.但很少有人知道,也可以使用JavaScript 在任意时刻来触发特定的事件,而此时的事件就如同浏览器创建的事件一样 ...
- 后Hadoop时代的大数据技术思考:数据即服务
1. Hadoop 的神话正在破灭 IBM leads BigInsights for Hadoop out behind barn. Shots heard IBM has announced th ...
- 洛谷 P3629 [APIO2010]巡逻 解题报告
P3629 [APIO2010]巡逻 题目描述 在一个地区中有 n 个村庄,编号为 1, 2, ..., n.有 n – 1 条道路连接着这些村 庄,每条道路刚好连接两个村庄,从任何一个村庄,都可以通 ...
- 前端学习 -- Css -- display和Visibility
display 将一个内联元素变成块元素,通过display样式可以修改元素的类型.可选值: 1 inline:可以将一个元素作为内联元素显示. 2 block: 可以将一个元素设置块元素显示. 3 ...
- Libre 6008 「网络流 24 题」餐巾计划 (网络流,最小费用最大流)
Libre 6008 「网络流 24 题」餐巾计划 (网络流,最小费用最大流) Description 一个餐厅在相继的N天里,第i天需要Ri块餐巾(i=l,2,-,N).餐厅可以从三种途径获得餐巾. ...
- Qt QGraphicsItem 绕中心旋转、放缩
最近用到了QGraphicsItem,可以通过QGraphicsItemAnimation使其产生动画效果. QGraphicsItemAnimation自带了setPosAt().setRotati ...
- ssm框架junit简单测试_我写
第一步:导入相关jar包 主要是 junit包,和spring-test包 <dependecy> <groupId>junit</groupId> <art ...
- java基础基础总结----- Math(随机数)
前言:math类中感觉最好玩的应该就是随机数 代码: package com.day13.math; import java.util.Random; /** * 类说明 :Math * @autho ...
- python实现windows Service服务程序
python实现windows Service服务程序 win32serviceutil.ServiceFramework是封装得很好的Windows服务框架,本文通过继承它来实现. 通过SvcDoR ...