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 [email protected]

业务逻辑的代码:

 /// <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 [email protected]

业务逻辑:

   /// <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;
    }
}
时间: 2025-01-02 00:41:35

ERP合同管理(二十六)的相关文章

ERP合同管理二(二十七)

未审核表单列表显示: 1.用户登录后,根据登录用户加载审核流程表中属于当前登录用户的未审核表单.2.点击选中未审核表单跳转到指定审核流程页面 if (Request.QueryString["taskid"] != null && Request.QueryString["listid"] != null) { contractid = Request.QueryString["taskid"].ToString(); taskl

Powershell管理系列(二十六)PowerShell操作之批量导出&导入邮箱

-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750 项目中有时候做跨林邮箱迁移的时候,条件不成熟,比如安全考虑或者其他考虑,不能做双林信任,这样就提出了一个问题,历史邮件需要使用的话怎么办,一个简单高效的解决办法就是从源森林批量导出邮件为.pst文件,在批量导入到目的域森林,具体操作如下: 1.赋予管理账号邮件导入导出权限,命令如下: cls whoami New-Manageme

【管理心得之二十六】职场中的“武功”

场景再现==================={放学路上}同学A:最近<天龙八部>看没?我喜欢那里的虚竹,因为他武功最高.同学B:什么呀?才不是虚竹呢,是段誉武功最高.他不仅会"六脉神剑",还会"一阳指"和"北冥神功".同学A:虚竹厉害,他有天山童姥等三人最强内力,后期又习得"降龙十八掌".同学B:这些都没有"六脉神剑"厉害.同学A:..................同学B:...... ==

二十六、Jcreator使用初步

摘自http://blog.csdn.net/liujun13579/article/details/7751464 二十六.Jcreator使用初步 Jcreator是一个小巧灵活的Java开发工具,它可将Java的程序的编写.编译.运行和调试集成进自身的环境中直接进行开发,且无需进行环境变量的设定.我们可以直接在JCreator中编辑Java源文件,选择相应的菜单和点击对应的按钮就可以完成Java程序的编译.运行等工作,十分方便 由于Jcreator集成了编辑源文件.编译.运行调试为一体,所

马哥学习笔记二十六——MySQL主从复制

配置MySQL复制基本步骤: 一.master 1.启用二进制日志 log-bin = master-bin log-bin-index = master-bin.index 2.选择一个惟一server-id server-id = {0-2^32} 3.创建具有复制权限的用户 REPLICATION SLAVE REPLICATION CLIENT 二.slave 1.启用中继日志 relay-log = relay-log relay-log-index = 2.选择一个惟一的server

微软云计算介绍与实践(实践之二十六)

3.7.创建发售请求 小张同学刚刚创建完服务项目,现在急于发布他的第一个发售请求. 1.在System Center2012 Service Manager控制台,与库工作区中选择,展开导航树中选择服务目录>发售请求 2.任务的上下文窗格将更新,现在我们可以选择创建发售请求 3.创建发售请求向导将出现,选择下一步开始 4.在指定的信息页,填写如图资料 更多的信息可以参考如下地址: http://blogs.technet.com/b/servicemanager/archive/2011/11/

攻城狮在路上(叁)Linux(二十六)--- linux文件系统的特殊查看与操作

一.boot sector 与 super block的关系: 1.boot sector用于存放引导装载程序,占用1024个字节. 2.super block的大小也为1024字节. 3.若block大小为1k,则boot sector和super block各占一个block. 4.若block大于1K(2K/4K)时,则两者都位于第一个block中. 二.磁盘空间的浪费问题:暂不考虑. 三.利用GUN的parted命令进行分区行为: 因为fdisk不支持高于2TB的分区. 命令格式: pa

第一百二十六节,JavaScript,XPath操作xml节点

第一百二十六节,JavaScript,XPath操作xml节点 学习要点: 1.IE中的XPath 2.W3C中的XPath 3.XPath跨浏览器兼容 XPath是一种节点查找手段,对比之前使用标准DOM去查找XML中的节点方式,大大降低了查找难度,方便开发者使用.但是,DOM3级以前的标准并没有就XPath做出规范:直到DOM3在首次推荐到标准规范行列.大部分浏览器实现了这个标准,IE则以自己的方式实现了XPath. 一.IE中的XPath 在IE8及之前的浏览器,XPath是采用内置基于A

二十六:Struts2 和 spring整合

二十六:Struts2 和 spring整合 将项目名称为day29_02_struts2Spring下的scr目录下的Struts.xml文件拷贝到新项目的scr目录下 在新项目的WebRoot---->WEB-INF目录下新建一个目录lib,用于存放jar包(Struts2和spring整合所需jar包) 将项目名称为day29_02_struts2Spring,WebRoot---->WEB-INF下的lib目录下的所有jar包拷贝到新项目对应的位置,同时将spring的配置文件appl

企业搜索引擎开发之连接器connector(二十六)

连接器通过监视器对象DocumentSnapshotRepositoryMonitor从上文提到的仓库对象SnapshotRepository(数据库仓库为DBSnapshotRepository)中迭代获取数据 监视器类DocumentSnapshotRepositoryMonitor在其构造方法初始化相关成员变量,这些成员属性都是与数据获取及数据处理逻辑相关的对象 /** This connector instance's current traversal schedule. */ pri