public virtual bool OperateStore(CInStoreMaterialDetail pInStoreMaterialDetail) { string[] sParams = { "InStockMaterialID", "BINID", "POID", "ItemCode", "WHID", "VendorID", "QuantityInBinSet", "PreserveQuantitySet", "MFG", "PartNo", "UnitPricePONatural", "UnitPricePOStandard", "Status", "Comment", "flag", "OperateHistory" }; object[] objParamValues = { pInStoreMaterialDetail.InStockMaterialID, pInStoreMaterialDetail.BINID, pInStoreMaterialDetail.POID, pInStoreMaterialDetail.ItemCode, pInStoreMaterialDetail.WHID, pInStoreMaterialDetail.VendorID, pInStoreMaterialDetail.QuantityInBinSet, pInStoreMaterialDetail.PreserveQuantitySet, pInStoreMaterialDetail.MFG, pInStoreMaterialDetail.PartNo, pInStoreMaterialDetail.UnitPricePONatural, pInStoreMaterialDetail.UnitPricePOStandard, pInStoreMaterialDetail.Status, pInStoreMaterialDetail.Comment, pInStoreMaterialDetail.StoreOperateType, pInStoreMaterialDetail.OperateHistory }; SqlDbType[] paramTypes = { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Real, SqlDbType.Real, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Money, SqlDbType.Money, SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.Int, SqlDbType.Bit }; return(pDataAcess.ExecuteSP("spOperateInStoreMaterialDetail", sParams, objParamValues, paramTypes)); }
public virtual bool OperateInterface(CInterfaceOfFinance pInterfaceOfFinance) { string[] sParams = { "Location", "ItemCode", "BinNo", "BillNo", "OperationType", "Quantity", "OperationDirection", "UnitPriceStandard", "Operater" }; object[] objParamValues = { pInterfaceOfFinance.Location, pInterfaceOfFinance.ItemCode, pInterfaceOfFinance.BinNo, pInterfaceOfFinance.BillNo, pInterfaceOfFinance.OperationType, pInterfaceOfFinance.Quantity, pInterfaceOfFinance.OperationDirection, pInterfaceOfFinance.UnitPriceStandard, pInterfaceOfFinance.Operater }; SqlDbType[] paramTypes = { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Real, SqlDbType.Int, SqlDbType.Money, SqlDbType.NVarChar }; return(pDataAcess.ExecuteSP("spInsertInterfaceOfFinance", sParams, objParamValues, paramTypes)); }
/// <summary> /// 此函数调用存储过程 spInsertUpdateSysMaterialIDConfig 并返回数据库中受影响的记录数 /// </summary> ///<param name="materialIDLength">变量 materialIDLength: 用于设置参数 '@MaterialIDLength' 给存储过程spInsertUpdateSysMaterialIDConfig </param> ///<param name="materialIDSegNumber">变量 materialIDSegNumber: 用于设置参数 '@MaterialIDSegNumber' 给存储过程spInsertUpdateSysMaterialIDConfig </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spInsertUpdateSysMaterialIDConfig ] 如下: /// <code> /// --endregion /// /// ///--region [dbo].[spInsertUpdateSysMaterialIDConfig] /// ///------------------------------------------------------------------------------------------------------------------------ ///-- Create by: Dou Zhi-Cheng ///-- Procedure Name: [dbo].[spInsertUpdateSysMaterialIDConfig] ///-- Date Generated: 2005年6月13日 ///------------------------------------------------------------------------------------------------------------------------ /// ///-- ///create procedure spInsertUpdateSysMaterialIDConfig /// @MaterialIDLength smallint, /// @MaterialIDSegNumber smallint ///as ///if exists (select * from SysMaterialIDConfig) ///begin /// update /// SysMaterialIDConfig /// set /// MaterialIDLength = @MaterialIDLength, /// MaterialIDSegNumber = @MaterialIDSegNumber ///end ///else ///begin /// insert into SysMaterialIDConfig(MaterialIDLength,MaterialIDSegNumber) /// values(@MaterialIDLength,@MaterialIDSegNumber) ///end /// /// /// </code> /// </remarks> public int InsertUpdateSysMaterialIDConfig(short materialIDLength, short materialIDSegNumber) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "MaterialIDLength", "MaterialIDSegNumber" }; object[] objParamValues = { materialIDLength, materialIDSegNumber }; SqlDbType[] paramTypes = { SqlDbType.SmallInt, SqlDbType.SmallInt }; pDataAccess.ExecuteSP("spInsertUpdateSysMaterialIDConfig", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spInsertUpdateSysMaterialIDConfig"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@MaterialIDLength", SqlDbType.SmallInt,0).Value=materialIDLength; // base.AddParameter("@MaterialIDSegNumber", SqlDbType.SmallInt,0).Value=materialIDSegNumber; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }
/// <summary> /// 此函数调用存储过程 spDeleteSysMaterialIDSegConfigsAll 并返回数据库中受影响的记录数 /// </summary> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spDeleteSysMaterialIDSegConfigsAll ] 如下: /// <code> /// --endregion /// /// /// ///--region [dbo].[spDeleteSysMaterialIDSegConfigsAll] /// ///------------------------------------------------------------------------------------------------------------------------ ///-- Create by: Dou Zhi-Cheng ///-- Procedure Name: [dbo].[spDeleteSysMaterialIDSegConfigsAll] ///-- Date Generated: 2005年6月13日 ///------------------------------------------------------------------------------------------------------------------------ /// ///-- ///create procedure spDeleteSysMaterialIDSegConfigsAll /// ///as ///if exists (select * from SysMaterialIDSegConfig) ///begin /// delete from SysMaterialIDSegConfig ///end /// /// </code> /// </remarks> public int DeleteSysMaterialIDSegConfigsAll() { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = {}; object[] objParamValues = {}; SqlDbType[] paramTypes = {}; pDataAccess.ExecuteSP("spDeleteSysMaterialIDSegConfigsAll", sParams, objParamValues, paramTypes); // //set the commandText // mCommandText = "spDeleteSysMaterialIDSegConfigsAll"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } return(0); }
/// <summary> /// 此函数调用存储过程 spInsertUpdateSysInitStatus 并返回数据库中受影响的记录数 /// </summary> ///<param name="initStatus">变量 initStatus: 用于设置参数 '@InitStatus' 给存储过程spInsertUpdateSysInitStatus </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spInsertUpdateSysInitStatus ] 如下: /// <code> /// --endregion /// /// ///--region [dbo].[spInsertUpdateSysInitStatus] /// ///------------------------------------------------------------------------------------------------------------------------ ///-- Create by: Dou Zhi-Cheng ///-- Procedure Name: [dbo].[spInsertUpdateSysInitStatus] ///-- Date Generated: 2005年6月13日 ///------------------------------------------------------------------------------------------------------------------------ /// ///-- ///create procedure spInsertUpdateSysInitStatus /// @InitStatus tinyint ///as ///if exists (select * from SysInitStatus) ///begin /// update /// SysInitStatus /// set /// InitStatus = @InitStatus ///end ///else ///begin /// insert into SysInitStatus(InitStatus) /// values(@InitStatus) ///end /// /// /// </code> /// </remarks> public int InsertUpdateSysInitStatus(byte initStatus, byte priceType) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "InitStatus", "PriceType" }; object[] objParamValues = { initStatus, priceType }; SqlDbType[] paramTypes = { SqlDbType.TinyInt, SqlDbType.TinyInt }; pDataAccess.ExecuteSP("spInsertUpdateSysInitStatus", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spInsertUpdateSysInitStatus"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@InitStatus", SqlDbType.TinyInt,0).Value=initStatus; // base.AddParameter("@MaterialConfigType", SqlDbType.TinyInt,0).Value=materialConfigType; // base.AddParameter("@PriceType", SqlDbType.TinyInt,0).Value=priceType; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }
/// <summary> /// 此函数调用存储过程 spInsertUpdateSysCurrency 并返回数据库中受影响的记录数 /// </summary> ///<param name="naturalCurrencyID">变量 naturalCurrencyID: 用于设置参数 '@NaturalCurrencyID' 给存储过程spInsertUpdateSysCurrency </param> ///<param name="standardCurrencyID">变量 standardCurrencyID: 用于设置参数 '@StandardCurrencyID' 给存储过程spInsertUpdateSysCurrency </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spInsertUpdateSysCurrency ] 如下: /// <code> /// --endregion /// /// ///--region [dbo].[spInsertUpdateSysCurrency] /// ///------------------------------------------------------------------------------------------------------------------------ ///-- Create by: Dou Zhi-Cheng ///-- Procedure Name: [dbo].[spInsertUpdateSysCurrency] ///-- Date Generated: 2005年6月13日 ///------------------------------------------------------------------------------------------------------------------------ /// ///create procedure spInsertUpdateSysCurrency /// @NaturalCurrencyID nvarchar(10), /// @StandardCurrencyID nvarchar(10) ///as ///if exists(select * from SysCurrency) ///begin ///update /// SysCurrency ///set /// NaturalCurrencyID=@NaturalCurrencyID, /// StandardCurrencyID=@StandardCurrencyID /// ///end ///else ///begin /// insert into /// SysCurrency(NaturalCurrencyID,StandardCurrencyID) /// values /// (@NaturalCurrencyID,@StandardCurrencyID) ///end /// /// /// </code> /// </remarks> public int InsertUpdateSysCurrency(string naturalCurrencyID, string standardCurrencyID) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "NaturalCurrencyID", "StandardCurrencyID" }; object[] objParamValues = { naturalCurrencyID, standardCurrencyID }; SqlDbType[] paramTypes = { SqlDbType.NVarChar, SqlDbType.NVarChar }; pDataAccess.ExecuteSP("spInsertUpdateSysCurrency", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spInsertUpdateSysCurrency"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@NaturalCurrencyID", SqlDbType.NVarChar,10).Value=naturalCurrencyID; // base.AddParameter("@StandardCurrencyID", SqlDbType.NVarChar,10).Value=standardCurrencyID; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }
/// <summary> /// 此函数调用存储过程 spDeleteEmployee 并返回数据库中受影响的记录数 /// </summary> ///<param name="employeeID">变量 employeeID: 用于设置参数 '@EmployeeID' 给存储过程spDeleteEmployee </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spDeleteEmployee ] 如下: /// <code> /// ///--region [dbo].[spDeleteEmployee] /// ///------------------------------------------------------------------------------------------------------------------------ ///-- Create by: Dou Zhi-Cheng ///-- Procedure Name: [dbo].[spDeleteEmployee] ///-- Date Generated: 2005年6月6日 ///------------------------------------------------------------------------------------------------------------------------ /// ///CREATE PROCEDURE [dbo].[spDeleteEmployee] /// @EmployeeID nvarchar(32) ///AS /// ///--SET NOCOUNT ON /// ///DELETE FROM [dbo].[Employee] ///WHERE /// [EmployeeID] = @EmployeeID /// ///--endregion /// /// /// </code> /// </remarks> public int DeleteEmployee(string employeeID) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "EmployeeID" }; object[] objParamValues = { employeeID }; SqlDbType[] paramTypes = { SqlDbType.NVarChar }; pDataAccess.ExecuteSP("spDeleteEmployee", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spDeleteEmployee"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@EmployeeID", SqlDbType.NVarChar,32).Value=employeeID; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }
/// <summary> /// 此函数调用存储过程 spDeleteSystemLogsDynamic 并返回数据库中受影响的记录数 /// </summary> ///<param name="whereCondition">变量 whereCondition: 用于设置参数 '@WhereCondition' 给存储过程spDeleteSystemLogsDynamic </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spDeleteSystemLogsDynamic ] 如下: /// <code> /// CREATE PROCEDURE [dbo].[spDeleteSystemLogsDynamic] /// @WhereCondition nvarchar(1000) ///AS /// ///--SET NOCOUNT ON ///--SET TRANSACTION ISOLATION LEVEL READ COMMITTED ///DECLARE @SQL nvarchar(3250) ///SET @SQL=' ///insert into SystemLogBak /// ( /// BakTime, /// [LogID], /// [SessionID], /// [UserID], /// [LogTime], /// [ModuleID], /// [LogType], /// [LogDescription], /// [LogIP], /// [Platform], /// [BrowserVersion], /// [Language] /// ) /// select /// GetDate(), ///[ID], ///[SessionID], ///[UserID], ///[LogTime], ///[ModuleID], ///[LogType], ///[LogDescription], ///[LogIP], ///[Platform], ///[BrowserVersion], ///[Language] ///FROM SystemLog /// where 1=1 '+ @WhereCondition /// ///SET @SQL = ' ///DELETE ///FROM /// [dbo].[SystemLog] ///WHERE 1=1 /// ' + @WhereCondition /// ///EXEC sp_executesql @SQL /// ///--endregion /// /// /// </code> /// </remarks> public int DeleteSystemLogsDynamic(string whereCondition) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "WhereCondition" }; object[] objParamValues = { whereCondition }; SqlDbType[] paramTypes = { SqlDbType.NVarChar }; pDataAccess.ExecuteSP("spDeleteSystemLogsDynamic", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spDeleteSystemLogsDynamic"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@WhereCondition", SqlDbType.NVarChar,1000).Value=whereCondition; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }
/// <summary> /// 此函数调用存储过程 spAddOrUpdateProject 并返回数据库中受影响的记录数 /// </summary> ///<param name="projectID">变量 projectID: 用于设置参数 '@ProjectID' 给存储过程spAddOrUpdateProject </param> ///<param name="projectName">变量 projectName: 用于设置参数 '@ProjectName' 给存储过程spAddOrUpdateProject </param> ///<param name="shortName">变量 shortName: 用于设置参数 '@ShortName' 给存储过程spAddOrUpdateProject </param> ///<param name="address">变量 address: 用于设置参数 '@Address' 给存储过程spAddOrUpdateProject </param> ///<param name="fax">变量 fax: 用于设置参数 '@Fax' 给存储过程spAddOrUpdateProject </param> ///<param name="tel">变量 tel: 用于设置参数 '@Tel' 给存储过程spAddOrUpdateProject </param> ///<param name="email">变量 email: 用于设置参数 '@Email' 给存储过程spAddOrUpdateProject </param> ///<param name="contact">变量 contact: 用于设置参数 '@Contact' 给存储过程spAddOrUpdateProject </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spAddOrUpdateProject ] 如下: /// <code> /// create procedure spAddOrUpdateProject /// @ProjectID nvarchar(32), /// @ProjectName nvarchar(512), /// @ShortName nvarchar(256), /// @Address nvarchar(512), /// @Fax nvarchar(64), /// @Tel nvarchar(64), /// @Email nvarchar(64), /// @Contact nvarchar(64) ///as /// if exists (select * from Project) /// update Project /// set ProjectID=@ProjectID,ProjectName=@ProjectName, /// ShortName=@ShortName,Address=@Address,Fax=@Fax, /// Tel=@Tel,Email=@Email,Contact=@Contact /// else /// insert into Project(ProjectID,ProjectName,ShortName,Address,Fax, /// Tel,Email,Contact) /// values(@ProjectID,@ProjectName,@ShortName,@Address,@Fax, /// @Tel,@Email,@Contact) /// /// </code>code> /// </remarks> public int AddOrUpdateProject( string projectID, string projectName, string shortName, string address, string fax, string tel, string email, string contact, string Bank, string AccountNo, string TaxNo, string Attorney, string Deputy ) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "ProjectID", "ProjectName", "ShortName", "Address", "Fax", "Tel", "Email", "Contact", "Bank", "AccountNo", "TaxNo", "Attorney", "Deputy" }; object[] objParamValues = { projectID, projectName, shortName, address, fax, tel, email, contact, Bank, AccountNo, TaxNo, Attorney, Deputy }; SqlDbType[] paramTypes = { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar }; pDataAccess.ExecuteSP("spAddOrUpdateProject", sParams, objParamValues, paramTypes); return(1); // mCommandText = "spAddOrUpdateProject"; // mCommandType = CommandType.StoredProcedure ; // base.ClearParameters(); // // base.AddParameter("@ProjectID", SqlDbType.NVarChar,32).Value=projectID; // base.AddParameter("@ProjectName", SqlDbType.NVarChar,512).Value=projectName; // base.AddParameter("@ShortName", SqlDbType.NVarChar,256).Value=shortName; // base.AddParameter("@Address", SqlDbType.NVarChar,512).Value=address; // base.AddParameter("@Fax", SqlDbType.NVarChar,64).Value=fax; // base.AddParameter("@Tel", SqlDbType.NVarChar,64).Value=tel; // base.AddParameter("@Email", SqlDbType.NVarChar,64).Value=email; // base.AddParameter("@Contact", SqlDbType.NVarChar,64).Value=contact; // base.AddParameter("@Bank", SqlDbType.NVarChar,100).Value=Bank; // base.AddParameter("@AccountNo", SqlDbType.NVarChar,100).Value=AccountNo; // base.AddParameter("@TaxNo", SqlDbType.NVarChar,100).Value=TaxNo; // base.AddParameter("@Attorney", SqlDbType.NVarChar,50).Value=Attorney; // base.AddParameter("@Deputy", SqlDbType.NVarChar,50).Value=Deputy; // // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }
public string InsertApproveMember(string putinID, string objectType, string objectID) { string[] sParams = { "putinID", "objectType", "objectID" }; object[] objParamValues = { putinID, objectType, objectID }; SqlDbType[] paramTypes = { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar }; bool result = _da.ExecuteSP("spInsertApproveMember", sParams, objParamValues, paramTypes); if (result) { return(""); } else { return("InsertApproveMember"); } }
public int DeletePM(string UserID) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "ManagerID" }; object[] objParamValues = { UserID }; SqlDbType[] paramTypes = { SqlDbType.NVarChar }; pDataAccess.ExecuteSP("spDeletePM", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spDeletePM"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // base.AddParameter("@ManagerID",SqlDbType.NVarChar,32).Value=UserID; // // return base.ExecuteNonQuery(); }
/// <summary> /// 此函数调用存储过程 spInsertSystemLog stored procedure and return the log id /// </summary> ///<param name="sessionID">变量 sessionID: 用于设置参数 '@SessionID' 给存储过程spInsertSystemLog </param> ///<param name="userID">变量 userID: 用于设置参数 '@UserID' 给存储过程spInsertSystemLog </param> ///<param name="logTime">变量 logTime: 用于设置参数 '@LogTime' 给存储过程spInsertSystemLog </param> ///<param name="moduleID">变量 moduleID: 用于设置参数 '@ModuleID' 给存储过程spInsertSystemLog </param> ///<param name="logType">变量 logType: 用于设置参数 '@LogType' 给存储过程spInsertSystemLog </param> ///<param name="logDescription">变量 logDescription: 用于设置参数 '@LogDescription' 给存储过程spInsertSystemLog </param> ///<param name="logIP">变量 logIP: 用于设置参数 '@LogIP' 给存储过程spInsertSystemLog </param> ///<param name="platform">变量 platform: 用于设置参数 '@Platform' 给存储过程spInsertSystemLog </param> ///<param name="browserVersion">变量 browserVersion: 用于设置参数 '@BrowserVersion' 给存储过程spInsertSystemLog </param> ///<param name="language">变量 language: 用于设置参数 '@Language' 给存储过程spInsertSystemLog </param> /// <returns>Log ID</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spInsertSystemLog ] 如下: /// <code> /// ///--region [dbo].[spInsertSystemLog] /// ///------------------------------------------------------------------------------------------------------------------------ ///-- Create by: Dou Zhi-Cheng ///-- Procedure Name: [dbo].[spInsertSystemLog] ///-- Date Generated: 2005年6月8日 ///------------------------------------------------------------------------------------------------------------------------ /// ///CREATE PROCEDURE [dbo].[spInsertSystemLog] /// @SessionID nvarchar(100), /// @UserID nvarchar(32), /// @LogTime datetime, /// @ModuleID nvarchar(100), /// @LogType nvarchar(50), /// @LogDescription nvarchar(500), /// @LogIP nvarchar(50), /// @Platform nvarchar(50), /// @BrowserVersion nvarchar(50), /// @Language nvarchar(50), /// @ID bigint OUTPUT ///AS /// ///--SET NOCOUNT ON /// ///INSERT INTO [dbo].[SystemLog] ( /// [SessionID], /// [UserID], /// [LogTime], /// [ModuleID], /// [LogType], /// [LogDescription], /// [LogIP], /// [Platform], /// [BrowserVersion], /// [Language] ///) VALUES ( /// @SessionID, /// @UserID, /// @LogTime, /// @ModuleID, /// @LogType, /// @LogDescription, /// @LogIP, /// @Platform, /// @BrowserVersion, /// @Language ///) /// ///SET @ID = SCOPE_IDENTITY() /// ///--endregion /// /// /// </code> /// </remarks> public long InsertSystemLog(string sessionID, string userID, DateTime logTime, string moduleID, string logType, string logDescription, string logIP, string platform, string browserVersion, string language) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "SessionID", "UserID", "LogTime", "ModuleID", "LogType", "LogDescription", "LogIP", "Platform", "BrowserVersion", "Language", "ID" }; object[] objParamValues = { sessionID, userID, logTime, moduleID, logType, logDescription, logIP, platform, browserVersion, language, ParameterDirection.Output }; SqlDbType[] paramTypes = { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.DateTime, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.BigInt }; pDataAccess.ExecuteSP("spInsertSystemLog", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spInsertSystemLog"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@SessionID", SqlDbType.NVarChar,100).Value=sessionID; // base.AddParameter("@UserID", SqlDbType.NVarChar,32).Value=userID; // base.AddParameter("@LogTime", SqlDbType.DateTime,0).Value=logTime; // base.AddParameter("@ModuleID", SqlDbType.NVarChar,100).Value=moduleID; // base.AddParameter("@LogType", SqlDbType.NVarChar,50).Value=logType; // base.AddParameter("@LogDescription", SqlDbType.NVarChar,500).Value=logDescription; // base.AddParameter("@LogIP", SqlDbType.NVarChar,50).Value=logIP; // base.AddParameter("@Platform", SqlDbType.NVarChar,50).Value=platform; // base.AddParameter("@BrowserVersion", SqlDbType.NVarChar,50).Value=browserVersion; // base.AddParameter("@Language", SqlDbType.NVarChar,50).Value=language; // base.AddParameter("@ID", SqlDbType.BigInt).Direction=ParameterDirection.Output; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // base.ExecuteNonQuery(); // return (long)base.GetParameterValue("@ID"); // } // catch // { // //throw the exception out // throw; // } }
/// <summary> /// 此函数调用存储过程 spUpdateEmployee 并返回数据库中受影响的记录数 /// </summary> ///<param name="employeeID">变量 employeeID: 用于设置参数 '@EmployeeID' 给存储过程spUpdateEmployee </param> ///<param name="employeeName">变量 employeeName: 用于设置参数 '@EmployeeName' 给存储过程spUpdateEmployee </param> ///<param name="fullName">变量 fullName: 用于设置参数 '@FullName' 给存储过程spUpdateEmployee </param> ///<param name="employeeDescription">变量 employeeDescription: 用于设置参数 '@EmployeeDescription' 给存储过程spUpdateEmployee </param> ///<param name="departmentID">变量 departmentID: 用于设置参数 '@DepartmentID' 给存储过程spUpdateEmployee </param> ///<param name="fax">变量 fax: 用于设置参数 '@Fax' 给存储过程spUpdateEmployee </param> ///<param name="tel">变量 tel: 用于设置参数 '@Tel' 给存储过程spUpdateEmployee </param> ///<param name="email">变量 email: 用于设置参数 '@Email' 给存储过程spUpdateEmployee </param> ///<param name="mobile">变量 mobile: 用于设置参数 '@Mobile' 给存储过程spUpdateEmployee </param> ///<param name="status">变量 status: 用于设置参数 '@Status' 给存储过程spUpdateEmployee </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spUpdateEmployee ] 如下: /// <code> /// ///--region [dbo].[spUpdateEmployee] /// ///------------------------------------------------------------------------------------------------------------------------ ///-- Create by: Dou Zhi-Cheng ///-- Procedure Name: [dbo].[spUpdateEmployee] ///-- Date Generated: 2005年6月6日 ///------------------------------------------------------------------------------------------------------------------------ /// ///CREATE PROCEDURE [dbo].[spUpdateEmployee] /// @EmployeeID nvarchar(32), /// @EmployeeName nvarchar(64), /// @FullName nvarchar(512), /// @EmployeeDescription nvarchar(1024), /// @DepartmentID nvarchar(50), /// @Fax nvarchar(64), /// @Tel nvarchar(64), /// @Email nvarchar(64), /// @Mobile nvarchar(64), /// @Status tinyint ///AS /// ///--SET NOCOUNT ON /// ///UPDATE [dbo].[Employee] SET /// [EmployeeName] = @EmployeeName, /// [FullName] = @FullName, /// [EmployeeDescription] = @EmployeeDescription, /// [DepartmentID] = @DepartmentID, /// [Fax] = @Fax, /// [Tel] = @Tel, /// [Email] = @Email, /// [Mobile] = @Mobile, /// [Status] = @Status ///WHERE /// [EmployeeID] = @EmployeeID /// ///--endregion /// /// /// </code> /// </remarks> public int UpdateEmployee(string employeeID, string employeeName, string fullName, string employeeDescription, string departmentID, string fax, string tel, string email, string mobile, int PositionType, bool Sex, byte status) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "EmployeeID", "EmployeeName", "FullName", "EmployeeDescription", "DepartmentID", "Fax", "Tel", "Email", "Mobile", "PositionType", "Sex", "Status" }; object[] objParamValues = { employeeID, employeeName, fullName, employeeDescription, departmentID, fax, tel, email, mobile, PositionType, Sex, status }; SqlDbType[] paramTypes = { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Int, SqlDbType.Bit, SqlDbType.TinyInt }; pDataAccess.ExecuteSP("spUpdateEmployee", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spUpdateEmployee"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@EmployeeID", SqlDbType.NVarChar,32).Value=employeeID; // base.AddParameter("@EmployeeName", SqlDbType.NVarChar,64).Value=employeeName; // base.AddParameter("@FullName", SqlDbType.NVarChar,512).Value=fullName; // base.AddParameter("@EmployeeDescription", SqlDbType.NVarChar,1024).Value=employeeDescription; // base.AddParameter("@DepartmentID", SqlDbType.NVarChar,50).Value=departmentID; // base.AddParameter("@Fax", SqlDbType.NVarChar,64).Value=fax; // base.AddParameter("@Tel", SqlDbType.NVarChar,64).Value=tel; // base.AddParameter("@Email", SqlDbType.NVarChar,64).Value=email; // base.AddParameter("@Mobile", SqlDbType.NVarChar,64).Value=mobile; // base.AddParameter("@PositionType", SqlDbType.Int).Value=PositionType; // base.AddParameter("@Sex", SqlDbType.Bit).Value=Sex; // base.AddParameter("@Status", SqlDbType.TinyInt,0).Value=status; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }
/// <summary> /// 此函数调用存储过程 spUpdateDepartment 并返回数据库中受影响的记录数 /// </summary> ///<param name="departmentID">变量 departmentID: 用于设置参数 '@DepartmentID' 给存储过程spUpdateDepartment </param> ///<param name="departmentName">变量 departmentName: 用于设置参数 '@DepartmentName' 给存储过程spUpdateDepartment </param> ///<param name="departmentDescription">变量 departmentDescription: 用于设置参数 '@DepartmentDescription' 给存储过程spUpdateDepartment </param> ///<param name="principal">变量 principal: 用于设置参数 '@Principal' 给存储过程spUpdateDepartment </param> ///<param name="address">变量 address: 用于设置参数 '@Address' 给存储过程spUpdateDepartment </param> ///<param name="fax">变量 fax: 用于设置参数 '@Fax' 给存储过程spUpdateDepartment </param> ///<param name="tel">变量 tel: 用于设置参数 '@Tel' 给存储过程spUpdateDepartment </param> ///<param name="email">变量 email: 用于设置参数 '@Email' 给存储过程spUpdateDepartment </param> ///<param name="contact">变量 contact: 用于设置参数 '@Contact' 给存储过程spUpdateDepartment </param> ///<param name="status">变量 status: 用于设置参数 '@Status' 给存储过程spUpdateDepartment </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spUpdateDepartment ] 如下: /// <code> /// ///--region [dbo].[spUpdateDepartment] /// ///------------------------------------------------------------------------------------------------------------------------ /// /// ///-- Procedure Name: [dbo].[spUpdateDepartment] ///-- Date Generated: 2005年6月6日 ///------------------------------------------------------------------------------------------------------------------------ /// ///CREATE PROCEDURE [dbo].[spUpdateDepartment] /// @DepartmentID nvarchar(50), /// @DepartmentName nvarchar(255), /// @DepartmentDescription ntext, /// @Principal nvarchar(64), /// @Address nvarchar(512), /// @Fax nvarchar(64), /// @Tel nvarchar(64), /// @Email nvarchar(64), /// @Contact nvarchar(64), /// @Status tinyint ///AS /// ///SET NOCOUNT ON /// ///UPDATE [dbo].[Department] SET /// [DepartmentName] = @DepartmentName, /// [DepartmentDescription] = @DepartmentDescription, /// [Principal] = @Principal, /// [Address] = @Address, /// [Fax] = @Fax, /// [Tel] = @Tel, /// [Email] = @Email, /// [Contact] = @Contact, /// [Status] = @Status ///WHERE /// [DepartmentID] = @DepartmentID /// ///--endregion /// /// /// </code>code> /// </remarks> public int UpdateDepartment(string departmentID, string departmentName, string departmentDescription, string principal, string address, string fax, string tel, string email, string contact, byte status) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "DepartmentID", "DepartmentName", "DepartmentDescription", "Principal", "Address", "Fax", "Tel", "Email", "Contact", "Status" }; object[] objParamValues = { departmentID, departmentName, departmentDescription, principal, address, fax, tel, email, contact, status }; SqlDbType[] paramTypes = { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NText, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.TinyInt }; pDataAccess.ExecuteSP("spUpdateDepartment", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spUpdateDepartment"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@DepartmentID", SqlDbType.NVarChar,50).Value=departmentID; // base.AddParameter("@DepartmentName", SqlDbType.NVarChar,255).Value=departmentName; // base.AddParameter("@DepartmentDescription", SqlDbType.NText,1073741823).Value=departmentDescription; // base.AddParameter("@Principal", SqlDbType.NVarChar,64).Value=principal; // base.AddParameter("@Address", SqlDbType.NVarChar,512).Value=address; // base.AddParameter("@Fax", SqlDbType.NVarChar,64).Value=fax; // base.AddParameter("@Tel", SqlDbType.NVarChar,64).Value=tel; // base.AddParameter("@Email", SqlDbType.NVarChar,64).Value=email; // base.AddParameter("@Contact", SqlDbType.NVarChar,64).Value=contact; // base.AddParameter("@Status", SqlDbType.TinyInt,0).Value=status; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }
/// <summary> /// 此函数调用存储过程 spInsertSysMaterialIDSegConfig 并返回数据库中受影响的记录数 /// </summary> ///<param name="segID">变量 segID: 用于设置参数 '@SegID' 给存储过程spInsertSysMaterialIDSegConfig </param> ///<param name="startIndex">变量 startIndex: 用于设置参数 '@StartIndex' 给存储过程spInsertSysMaterialIDSegConfig </param> ///<param name="length">变量 length: 用于设置参数 '@Length' 给存储过程spInsertSysMaterialIDSegConfig </param> ///<param name="segFormula">变量 segFormula: 用于设置参数 '@SegFormula' 给存储过程spInsertSysMaterialIDSegConfig </param> ///<param name="fullSegFormula">变量 fullSegFormula: 用于设置参数 '@FullSegFormula' 给存储过程spInsertSysMaterialIDSegConfig </param> ///<param name="segDescription">变量 segDescription: 用于设置参数 '@SegDescription' 给存储过程spInsertSysMaterialIDSegConfig </param> ///<param name="isLeafClassSeg">变量 isLeafClassSeg: 用于设置参数 '@IsLeafClassSeg' 给存储过程spInsertSysMaterialIDSegConfig </param> ///<param name="isLeafSeg">变量 isLeafSeg: 用于设置参数 '@IsLeafSeg' 给存储过程spInsertSysMaterialIDSegConfig </param> /// <returns>受影响的记录数</returns> /// <remarks> /// 存储过程源码 [ 存储过程 spInsertSysMaterialIDSegConfig ] 如下: /// <code> /// --endregion /// /// /// /// ///--region [dbo].[spInsertSysMaterialIDSegConfig] /// ///------------------------------------------------------------------------------------------------------------------------ ///-- Create by: Dou Zhi-Cheng ///-- Procedure Name: [dbo].[spInsertSysMaterialIDSegConfig] ///-- Date Generated: 2005年6月13日 ///------------------------------------------------------------------------------------------------------------------------ /// ///-- ///create procedure spInsertSysMaterialIDSegConfig /// @SegID smallint, /// @StartIndex smallint, /// @Length smallint, /// @SegFormula nvarchar(32), /// @FullSegFormula nvarchar(32), /// @SegDescription nvarchar(100), /// @IsLeafClassSeg bit, /// @IsLeafSeg bit /// ///as ///insert into SysMaterialIDSegConfig ///( /// SegID, /// StartIndex, /// Length, /// SegFormula, /// FullSegFormula, /// SegDescription, /// IsLeafClassSeg, /// IsLeafSeg ///) ///values ///( /// @SegID, /// @StartIndex, /// @Length, /// @SegFormula, /// @FullSegFormula, /// @SegDescription, /// @IsLeafClassSeg, /// @IsLeafSeg ///) /// /// </code> /// </remarks> public int InsertSysMaterialIDSegConfig(short segID, short startIndex, short length, string segFormula, string fullSegFormula, string segDescription, bool isLeafClassSeg, bool isLeafSeg) { DataAcess pDataAccess = Common.GetProjectDataAcess.GetDataAcess(); string[] sParams = { "SegID", "StartIndex", "Length", "SegFormula", "FullSegFormula", "SegDescription", "IsLeafClassSeg", "IsLeafSeg" }; object[] objParamValues = { segID, startIndex, length, segFormula, fullSegFormula, segDescription, isLeafClassSeg, isLeafSeg }; SqlDbType[] paramTypes = { SqlDbType.SmallInt, SqlDbType.SmallInt, SqlDbType.SmallInt, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Bit, SqlDbType.Bit }; pDataAccess.ExecuteSP("spInsertSysMaterialIDSegConfig", sParams, objParamValues, paramTypes); return(1); // //set the commandText // mCommandText = "spInsertSysMaterialIDSegConfig"; // //set the CommandType // mCommandType = CommandType.StoredProcedure ; // //Clear all the parameters // base.ClearParameters(); // //add and set the parameters // base.AddParameter("@SegID", SqlDbType.SmallInt,0).Value=segID; // base.AddParameter("@StartIndex", SqlDbType.SmallInt,0).Value=startIndex; // base.AddParameter("@Length", SqlDbType.SmallInt,0).Value=length; // base.AddParameter("@SegFormula", SqlDbType.NVarChar,32).Value=segFormula; // base.AddParameter("@FullSegFormula", SqlDbType.NVarChar,32).Value=fullSegFormula; // base.AddParameter("@SegDescription", SqlDbType.NVarChar,100).Value=segDescription; // base.AddParameter("@IsLeafClassSeg", SqlDbType.Bit,0).Value=isLeafClassSeg; // base.AddParameter("@IsLeafSeg", SqlDbType.Bit,0).Value=isLeafSeg; // //return the result reader // try // { // //Execute the sql command and return the 受影响的记录数 // return base.ExecuteNonQuery(); // } // catch // { // //throw the exception out // throw; // } }