您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > 客户关系管理系统详细设计(更新)
客户关系管理应用软件详细说明书项目名称:客户关系系统管理项目编号:模块名称:CRMManage(组织管理)模块编号:编写人员:第三组编写日期:2009-3-27审批人员:审批日期:该文档主要是类所需要的方法的定义及接口的定义和抽象工厂的创建。类所需的方法(DAL)客户信息1.得到所有的客户信息publicListClientgetAllClient(){ListClientclients=newListClient();Returnclients;创建一个客户实体类的集合对象,保存得到的客户信息,并把集合的对象作为返回值返回}2.得到指定的客户信息(根据客户的id)PublicintgetClientInfoByID(intcid){定义一个变量Clientclient=newClient();为客户的信息赋值创建一个客户实体类的对象,并返回这个对象定义一个局部变量cid,为其赋值,并把得到的id传入的下一层中}3.根据客户编号得到客户信息PublicClientgetClientInfoByCNumber(stringcnumber){Clientclient=newClient();为客户的信息赋值创建一个客户实体类的对象,并返回这个对象定义变量得到客户信息,为其赋值,并把得到的客户编号传入到下一层中}4.根据客户姓名得到客户信息PublicClientgetClientInfoByCName(stringcname){Clientclient=newClient();为客户的信息赋值创建一个客户实体类的对象,并返回这个对象定义变量得到客户信息,为其赋值,并把得到的客户编号传入到下一层中}5.根据客户加入时间得到客户信息PublicClientgetClientInfoByCTime(datetimectime){Clientclient=newClient();为客户的信息赋值创建一个客户实体类的对象,并返回这个对象定义变量得到客户信息,为其赋值,并把得到的客户编号传入到下一层中}6.根据客户ID修改客户信息PublicvoidModifyClientInfoByID(Clientclient){创建SqlConnection对象创建SqlCommand对象,并传入sql语句或者是存储过程和SqlConnection的对象。用SqlCommand对象.CommandType=CommandType.StoredProcedure;导入命名空间usingSystem.Data;并为参数赋值本句作用:指明调用的是存储过程(传入Sql语句时省略该句)打开数据连接用SqlCommand对象.ExecuteNonQuery();执行结果关闭数据库连接。释放资源。}7.插入客户信息PublicintAddClientInfo(Clientclient){Intnumber;定义一个变量得到新增客户的ID创建SqlConnection对象创建SqlCommand对象,并传入sql语句或者是存储过程和SqlConnection的对象,为参数赋值:SqlCommand对象.Parameters.Add(“参数名”,SqlDbType.参数的数据类性[数据长度,根据数据类型而定]).value=client.与参数对应的客户属性。打开数据库的连接。number=Convert.ToInt32(SqlCommand对象.ExecuteScalar());关闭数据库连接。释放资源。Returnnumber;}8.根据ID删除客户信息PublicvoidDeteClientInfo(intcid){Using(SqlConnectionconn=DBHelper.conn())DBHelper连接数据库的辅助类SqlCommandobjCommand=newSqlCommand(存储过程或Sql语句,conn);objCommand.CommandType=CommandType.StoredProcedure;//指明是存储过程(传入Sql语句时该句省略)objCommand.Parameters.Add(“参数名”,SqlDbType.数据类型[数据长度]).value=cid;打开数据库连接。objCommand.ExecuteNonQuery();执行结果关闭数据库连接。释放资源。}客户类型信息9.得到所有的客户类型PublicListClientTypegetAllClientType(){ListClientTypeclientTypes=newListClientType();ReturnclientTypes;}10.得到指定的客户类型PublicClientTypegetClientTypeByID(intctid){创建实体类的对象Using(SqlConnectionconn=DBHelper.conn()){Using(SqlConnectionconn=DBHelper.conn())DBHelper连接数据库的辅助类SqlCommandobjCommand=newSqlCommand(存储过程或Sql语句,conn);objCommand.CommandType=CommandType.StoredProcedure;//指明是存储过程(传入Sql语句时该句省略)objCommand.Parameters.Add(“参数名”,SqlDbType.数据类型[数据长度]).value=cid;打开数据库连接。Using(SqlDateReaderobjReader=objCommand.ExecuteReader(CommandBehavior.CloseConnection))}{If(objReader.Read()){实体类对象.对应属性=Convert.对应数据类型(objReader[对应的字段]);}关闭dateReader;释放资源;}返回实体类对象}11.插入客户类型PublicintinsertClientType(ClientTypeclientType){Intnumber;定义一个变量得到新增客户的ID创建SqlConnection对象创建SqlCommand对象,并传入sql语句或者是存储过程和SqlConnection的对象,为参数赋值:SqlCommand对象.Parameters.Add(“参数名”,SqlDbType.参数的数据类性[数据长度,根据数据类型而定]).value=client.与参数对应的客户属性。打开数据库的连接。number=Convert.ToInt32(SqlCommand对象.ExecuteScalar());关闭数据库连接。释放资源。Returnnumber;}12.根据ID修改客户类型信息PublicvoidupdateClientType(intctid){创建SqlConnection对象创建SqlCommand对象,并传入sql语句或者是存储过程和SqlConnection的对象,用SqlCommand对象.CommandType=CommandType.StoredProcedure;导入命名空间usingSystem.Data;并为参数赋值本句作用:指明调用的是存储过程(传入Sql语句时省略该句)打开数据连接用SqlCommand对象.ExecuteNonQuery();执行结果关闭数据库连接。释放资源。}13.删除客户类型PublicvoiddeleClientType(intctid){Using(SqlConnectionconn=DBHelper.conn())DBHelper连接数据库的辅助类SqlCommandobjCommand=newSqlCommand(存储过程或Sql语句,conn);objCommand.CommandType=CommandType.StoredProcedure;//指明是存储过程(传入Sql语句时该句省略)objCommand.Parameters.Add(“参数名”,SqlDbType.数据类型[数据长度]).value=cid;打开数据库连接。objCommand.ExecuteNonQuery();执行结果关闭数据库连接。释放资源。}客户阶段信息14.得到所有客户的阶段PublicListClientPhasegetAllClientPhase(){ListClientPhaseclientPhases=newListClientPhase();returnclientPhases;}15.得到指定的客户阶段PublicClientPhasegetClientPhaseByID(intcptid){Clientclient=newClient();为客户的信息赋值创建一个客户实体类的对象,并返回这个对象定义变量得到客户信息,为其赋值,并把得到的客户编号传入到下一层中}16.插入客户阶段PublicintinsertClientPhase(ClientPhaseclientPhase){Intnumber;定义一个变量得到新增客户的ID创建SqlConnection对象创建SqlCommand对象,并传入sql语句或者是存储过程和SqlConnection的对象,为参数赋值:SqlCommand对象.Parameters.Add(“参数名”,SqlDbType.参数的数据类性[数据长度,根据数据类型而定]).value=client.与参数对应的客户属性。打开数据库的连接。number=Convert.ToInt32(SqlCommand对象.ExecuteScalar());关闭数据库连接。释放资源。Returnnumber;}17.根据ID修改客户阶段信PublicvoidupdateClientPhase(intcptid){创建SqlConnection对象创建SqlCommand对象,并传入sql语句或者是存储过程和SqlConnection的对象,用SqlCommand对象.CommandType=CommandType.StoredProcedure;导入命名空间usingSystem.Data;并为参数赋值本句作用:指明调用的是存储过程(传入Sql语句时省略该句)打开数据连接用SqlCommand对象.ExecuteNonQuery();执行结果关闭数据库连接。释放资源。}18.删除客户阶段信息PublicvoiddeletClientPhase(intcptid){Using(SqlConnectionconn=DBHelper.conn())DBHelper连接数据库的辅助类SqlCommandobjCommand=newSqlCommand(存储过程或Sql语句,conn);objCommand.CommandType=CommandType.StoredProcedure;//指明是存储过程(传入Sql语句时该句省略)objCommand.Parameters.Add(“参数名”,SqlDbType.数据类型[数据长度]).value=cid;打开数据库连接。objCommand.ExecuteNonQuery();执行结果关闭数据库连接。释放资源。}客户级别信息19.得到所有的客户级别PublicListClientLevelgetAllClientLevel(){ListClientLevelclientLevels=newListClientLevel();ReturnclientLevels;}20.得到指定的客户级别PublicstringgetClientLevelByID(intcltid){}21.插入客户级别PublicintinsertClientLeve(ClientLevelclientLevel){Intnumber;定义一个变量得到新增客户的ID创建SqlConnection对象创建Sql
本文标题:客户关系管理系统详细设计(更新)
链接地址:https://www.777doc.com/doc-2461293 .html