public static CacheParameterSet ( string connectionString, string commandText ) : void | ||
connectionString | string | a valid connection string for a SqlConnection |
commandText | string | the stored procedure name or T-SQL command |
return | void |
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_WF_ProcessInstance_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_WF_ProcessInstance_ProcessID, SqlDbType.NVarChar, 50), new SqlParameter(Parm_WF_ProcessInstance_StartDate, SqlDbType.DateTime, 23), new SqlParameter(Parm_WF_ProcessInstance_Originator, SqlDbType.NVarChar, 50), new SqlParameter(Parm_WF_ProcessInstance_Status, SqlDbType.Int, 10), new SqlParameter(Parm_WF_ProcessInstance_FormID, SqlDbType.NVarChar, 50), new SqlParameter(Parm_WF_ProcessInstance_FormData, SqlDbType.NVarChar, 50), new SqlParameter(Parm_WF_ProcessInstance_EndDate, SqlDbType.DateTime, 23), new SqlParameter(Parm_WF_ProcessInstance_Rounds, SqlDbType.Int, 10), new SqlParameter(Parm_WF_ProcessInstance_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_WF_ProcessInstance_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_WF_ProcessInstance_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_WF_ProcessInstance_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_WF_ProcessInstance_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_WF_ProcessInstance_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_WF_ProcessInstance_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_WF_ProcessInstance_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_WF_ProcessInstance_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
public User GetUserByUserID(int userID) { User user = new User(); string sql = "select * from Tb_User where UserID=@UserID"; SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(sql); if (parms == null) { parms = new SqlParameter[] { new SqlParameter("@UserID", SqlDbType.BigInt) }; SqlHelperParameterCache.CacheParameterSet(sql, parms); } parms[0].Value = userID; using (SqlDataReader dr = SqlHelper.ExecuteReader(connString, CommandType.Text, sql, parms)) { RowHelper row = new RowHelper(dr); if (row.Read()) { user.UserID = row.GetInt32("UserID"); user.LastLoginIP = row.GetString("LastLoginIP"); user.LastLoginTime = row.GetDateTime("LastLoginTime"); user.RegTime = row.GetDateTime("RegTime"); user.Server = row.GetString("Server"); user.Status = row.GetUInt32("Status"); user.UserName = row.GetString("UserName"); user.UserPwd = row.GetString("UserPwd"); } dr.Close(); } return(user); }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SQLConnStringWrite, Sql_Tickets_Insert); if (parms == null) { parms = new [] { new SqlParameter(Parm_Tickets_Itemid, SqlDbType.VarChar, 50), new SqlParameter(Parm_Tickets_Itemdesc, SqlDbType.NVarChar, 200), new SqlParameter(Parm_Tickets_Itemtype, SqlDbType.NVarChar, 200), new SqlParameter(Parm_Tickets_Price, SqlDbType.Decimal, 18), new SqlParameter(Parm_Tickets_Validtype, SqlDbType.Int, 10), new SqlParameter(Parm_Tickets_Validdays, SqlDbType.Int, 10), new SqlParameter(Parm_Tickets_Validdate, SqlDbType.DateTime, 23) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SQLConnStringWrite, Sql_Tickets_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmIssuanceModel_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_CrmIssuanceModel_ModelIdentify, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIssuanceModel_ModelName, SqlDbType.NVarChar, 100), new SqlParameter(Parm_CrmIssuanceModel_ModelType, SqlDbType.Int, 10), new SqlParameter(Parm_CrmIssuanceModel_ModelAddress, SqlDbType.NVarChar, 200), new SqlParameter(Parm_CrmIssuanceModel_ModelWidth, SqlDbType.Int, 10), new SqlParameter(Parm_CrmIssuanceModel_ModelHeight, SqlDbType.Int, 10), new SqlParameter(Parm_CrmIssuanceModel_PictureSets, SqlDbType.VarChar, 500), new SqlParameter(Parm_CrmIssuanceModel_StoredProcedure, SqlDbType.NVarChar, 100), new SqlParameter(Parm_CrmIssuanceModel_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_CrmIssuanceModel_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIssuanceModel_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIssuanceModel_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmIssuanceModel_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIssuanceModel_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIssuanceModel_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmIssuanceModel_Id, SqlDbType.DateTime, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmIssuanceModel_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComNoticeAttach_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_ComNoticeAttach_ResourceId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_FileName, SqlDbType.NVarChar, 100), new SqlParameter(Parm_ComNoticeAttach_FileReName, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_FileSize, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_IsCompleted, SqlDbType.Int, 10), new SqlParameter(Parm_ComNoticeAttach_FileAddress, SqlDbType.NVarChar, 200), new SqlParameter(Parm_ComNoticeAttach_FileType, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_FileTypeName, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_FileRemark, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_ComNoticeAttach_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNoticeAttach_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeAttach_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNoticeAttach_Id, SqlDbType.NVarChar, 50), }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComNoticeAttach_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComNotice_Insert); if (parms == null) { parms = new [] { new SqlParameter(Parm_ComNotice_Title, SqlDbType.NVarChar, 200), new SqlParameter(Parm_ComNotice_Contents, SqlDbType.Text, 2147483647), new SqlParameter(Parm_ComNotice_Astatus, SqlDbType.Int, 10), new SqlParameter(Parm_ComNotice_IsTop, SqlDbType.Int, 10), new SqlParameter(Parm_ComNotice_AType, SqlDbType.Int, 10), new SqlParameter(Parm_ComNotice_StartTime, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNotice_EndTimie, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNotice_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_ComNotice_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNotice_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNotice_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNotice_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNotice_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNotice_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNotice_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComNotice_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
private SqlParameter[] GetParameters(U_USR_WList tobjU_USR_WList) { SqlParameter[] objParamArray = SqlHelperParameterCache.GetCachedParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_USR_WList); if (objParamArray == null) { //Represents a parameter to a System.Data.SqlClient.SqlCommand, //and optionally, its mapping to System.Data.DataSet columns. objParamArray = new SqlParameter[] { new SqlParameter(PARAM_WList_Id, tobjU_USR_WList.WList_Id), new SqlParameter(PARAM_Event_Id, tobjU_USR_WList.Event_Id), new SqlParameter(PARAM_Event_Creator_Id, tobjU_USR_WList.Event_Creator_Id), new SqlParameter(PARAM_WList_Name, tobjU_USR_WList.WList_Name), new SqlParameter(PARAM_WList_Status, tobjU_USR_WList.WList_Status), new SqlParameter(PARAM_Media_Id_Img, tobjU_USR_WList.Media_Id_Img), new SqlParameter(PARAM_Comments, tobjU_USR_WList.Comments), new SqlParameter(PARAM_Created_Date, tobjU_USR_WList.Created_Date), new SqlParameter(PARAM_Updated_Date, tobjU_USR_WList.Updated_Date), new SqlParameter(PARAM_Created_by, tobjU_USR_WList.Created_by), new SqlParameter(PARAM_Updated_by, tobjU_USR_WList.Updated_by), }; SqlHelperParameterCache.CacheParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_USR_WList, objParamArray); } return(objParamArray); }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComAttribute_Insert); if (parms == null) { parms = new [] { new SqlParameter(Parm_ComAttribute_RsId, SqlDbType.VarChar, 32), new SqlParameter(Parm_ComAttribute_AttributeId, SqlDbType.Int, 10), new SqlParameter(Parm_ComAttribute_AttributeName, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComAttribute_DateType, SqlDbType.VarChar, 32), new SqlParameter(Parm_ComAttribute_RegExpression, SqlDbType.NVarChar, 200), new SqlParameter(Parm_ComAttribute_ListSql, SqlDbType.NVarChar, -1), new SqlParameter(Parm_ComAttribute_OrderNo, SqlDbType.Int, 10), new SqlParameter(Parm_ComAttribute_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_ComAttribute_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComAttribute_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComAttribute_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComAttribute_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComAttribute_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComAttribute_UpdateOn, SqlDbType.DateTime, 23) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComAttribute_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
private SqlParameter[] GetParameters(U_EVNT_WList_Pub_Dtl tobjU_EVNT_WList_Pub_Dtl) { SqlParameter[] objParamArray = SqlHelperParameterCache.GetCachedParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_EVNT_WList_Pub_Dtl); if (objParamArray == null) { //Represents a parameter to a System.Data.SqlClient.SqlCommand, //and optionally, its mapping to System.Data.DataSet columns. objParamArray = new SqlParameter[] { new SqlParameter(PARAM_Id, tobjU_EVNT_WList_Pub_Dtl.Id), new SqlParameter(PARAM_Event_Id, tobjU_EVNT_WList_Pub_Dtl.Event_Id), new SqlParameter(PARAM_WList_Id, tobjU_EVNT_WList_Pub_Dtl.WList_Id), new SqlParameter(PARAM_Pub_Date, tobjU_EVNT_WList_Pub_Dtl.Pub_Date), new SqlParameter(PARAM_Pub_MediaType, tobjU_EVNT_WList_Pub_Dtl.Pub_MediaType), new SqlParameter(PARAM_Pub_Status, tobjU_EVNT_WList_Pub_Dtl.Pub_Status), new SqlParameter(PARAM_Contact_Id, tobjU_EVNT_WList_Pub_Dtl.Contact_Id), new SqlParameter(PARAM_Email_Id, tobjU_EVNT_WList_Pub_Dtl.Email_Id), new SqlParameter(PARAM_Phone_No, tobjU_EVNT_WList_Pub_Dtl.Phone_No), new SqlParameter(PARAM_WList_CodeForPub, tobjU_EVNT_WList_Pub_Dtl.WList_CodeForPub), new SqlParameter(PARAM_Created_Date, tobjU_EVNT_WList_Pub_Dtl.Created_Date), new SqlParameter(PARAM_Updated_Date, tobjU_EVNT_WList_Pub_Dtl.Updated_Date), new SqlParameter(PARAM_Created_by, tobjU_EVNT_WList_Pub_Dtl.Created_by), new SqlParameter(PARAM_Updated_by, tobjU_EVNT_WList_Pub_Dtl.Updated_by), }; SqlHelperParameterCache.CacheParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_EVNT_WList_Pub_Dtl, objParamArray); } return(objParamArray); }
public IList <UserGroup> GetUserGroupListByUserID(int userID) { IList <UserGroup> result = new List <UserGroup>(); string sql = @"SELECT * FROM Tb_UserGroup WHERE UserID=@UserID ORDER BY SortNum"; SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(sql); if (parms == null) { parms = new SqlParameter[] { new SqlParameter("@UserID", SqlDbType.BigInt) }; SqlHelperParameterCache.CacheParameterSet(sql, parms); } parms[0].Value = userID; using (SqlDataReader dr = SqlHelper.ExecuteReader(connString, CommandType.Text, sql, parms)) { RowHelper row = new RowHelper(dr); while (row.Read()) { result.Add(new UserGroup() { GroupName = row.GetString("GroupName"), ID = row.GetInt32("ID"), SortNum = row.GetInt32("SortNum"), UserID = row.GetInt32("UserID") }); } dr.Close(); } return(result); }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComNote_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_ComNote_ReceivePhone, SqlDbType.VarChar, 11), new SqlParameter(Parm_ComNote_MistakeInfo, SqlDbType.NVarChar, 200), new SqlParameter(Parm_ComNote_ReceiveTime, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNote_Status, SqlDbType.Int, 10), new SqlParameter(Parm_ComNote_SendDate, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNote_Remark, SqlDbType.NVarChar, 200), new SqlParameter(Parm_ComNote_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_ComNote_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNote_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNote_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNote_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNote_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNote_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNote_ResourcesId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNote_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComNote_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComNoticeReceive_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_ComNoticeReceive_NoticeId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeReceive_UserId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeReceive_UserNameq, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeReceive_IsRead, SqlDbType.Int, 10), new SqlParameter(Parm_ComNoticeReceive_LastReadTime, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNoticeReceive_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_ComNoticeReceive_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeReceive_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeReceive_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNoticeReceive_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeReceive_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComNoticeReceive_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComNoticeReceive_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComNoticeReceive_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
private SqlParameter[] GetParameters(U_USR_MASTER tobjU_USR_MASTER) { SqlParameter[] objParamArray = SqlHelperParameterCache.GetCachedParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_USR_MASTER); if (objParamArray == null) { //Represents a parameter to a System.Data.SqlClient.SqlCommand, //and optionally, its mapping to System.Data.DataSet columns. objParamArray = new SqlParameter[] { new SqlParameter(PARAM_Usr_Id, tobjU_USR_MASTER.Usr_Id), new SqlParameter(PARAM_First_Name, tobjU_USR_MASTER.First_Name), new SqlParameter(PARAM_Last_Name, tobjU_USR_MASTER.Last_Name), new SqlParameter(PARAM_Alt_Email_Id, tobjU_USR_MASTER.Alt_Email_Id), new SqlParameter(PARAM_Gender, tobjU_USR_MASTER.Gender), new SqlParameter(PARAM_Date_Of_Birth, tobjU_USR_MASTER.Date_Of_Birth), new SqlParameter(PARAM_About_member, tobjU_USR_MASTER.About_member), new SqlParameter(PARAM_Is_married, tobjU_USR_MASTER.Is_married), new SqlParameter(PARAM_Wed_anniversary, tobjU_USR_MASTER.Wed_anniversary), new SqlParameter(PARAM_Rating, tobjU_USR_MASTER.Rating), new SqlParameter(PARAM_Address_Id, tobjU_USR_MASTER.Address_Id), new SqlParameter(PARAM_Usr_Profile_Id, tobjU_USR_MASTER.Usr_role_Id), new SqlParameter(PARAM_Media_Id_Img, tobjU_USR_MASTER.Media_Id_Img), new SqlParameter(PARAM_Created_Date, tobjU_USR_MASTER.Created_Date), new SqlParameter(PARAM_Updated_Date, tobjU_USR_MASTER.Updated_Date), new SqlParameter(PARAM_Created_by, tobjU_USR_MASTER.Created_by), new SqlParameter(PARAM_Updated_by, tobjU_USR_MASTER.Updated_by), }; SqlHelperParameterCache.CacheParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_USR_MASTER, objParamArray); } return(objParamArray); }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmIdeaList_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_CrmIdeaList_ResourceID, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_Type, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_UserId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_Idea, SqlDbType.NVarChar, 200), new SqlParameter(Parm_CrmIdeaList_ProcessID, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_ProcessInstanceID, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_WorkList, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_LeveL, SqlDbType.Int, 10), new SqlParameter(Parm_CrmIdeaList_Duty, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_CrmIdeaList_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmIdeaList_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmIdeaList_UpdateOn, SqlDbType.DateTime, 23) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmIdeaList_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
public void InsertFirend(UserFirend ufInfo) { if (IsExitsFirendID(ufInfo.UserID, ufInfo.FriendID)) { return; } string sql = @"Insert into Tb_UserFriend (UserID,FriendID,GroupID,Subscription,NickName) values (@UserID,@FriendID,@GroupID,@Subscription,@NickName)"; SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(sql); if (parms == null) { parms = new SqlParameter[] { new SqlParameter("@UserID", SqlDbType.BigInt), new SqlParameter("@FriendID", SqlDbType.BigInt), new SqlParameter("@GroupID", SqlDbType.Int), new SqlParameter("@Subscription", SqlDbType.NVarChar, 10), new SqlParameter("@NickName", SqlDbType.NVarChar, 20) }; SqlHelperParameterCache.CacheParameterSet(sql, parms); } parms[0].Value = ufInfo.UserID; parms[1].Value = ufInfo.FriendID; parms[2].Value = ufInfo.GroupID; parms[3].Value = ufInfo.Subscription; parms[4].Value = ufInfo.NickName; SqlHelper.ExecuteNonQuery(connString, CommandType.Text, sql, parms); }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComLoginLog_Insert); if (parms == null) { parms = new [] { new SqlParameter(Parm_ComLoginLog_Source, SqlDbType.Int, 10), new SqlParameter(Parm_ComLoginLog_Ip, SqlDbType.NVarChar, 20), new SqlParameter(Parm_ComLoginLog_Status, SqlDbType.Int, 10), new SqlParameter(Parm_ComLoginLog_Note, SqlDbType.NVarChar, 100), new SqlParameter(Parm_ComLoginLog_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_ComLoginLog_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComLoginLog_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComLoginLog_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComLoginLog_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComLoginLog_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComLoginLog_UpdateOn, SqlDbType.DateTime, 23) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComLoginLog_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmDailyOneProblemRecord_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_CrmDailyOneProblemRecord_ProblemId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_UserId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_UserName, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_RightAnswer, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_UserAnswers, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_IsCorrect, SqlDbType.Int, 10), new SqlParameter(Parm_CrmDailyOneProblemRecord_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_CrmDailyOneProblemRecord_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmDailyOneProblemRecord_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmDailyOneProblemRecord_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmDailyOneProblemRecord_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmDailyOneProblemRecord_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComResource_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_ComResource_ParentId, SqlDbType.VarChar, 32), new SqlParameter(Parm_ComResource_RsKey, SqlDbType.VarChar, 200), new SqlParameter(Parm_ComResource_RsValue, SqlDbType.VarChar, 100), new SqlParameter(Parm_ComResource_RsUseflg, SqlDbType.Char, 1), new SqlParameter(Parm_ComResource_RsRemark, SqlDbType.VarChar, 200), new SqlParameter(Parm_ComResource_OrderNo, SqlDbType.Int, 10), new SqlParameter(Parm_ComResource_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_ComResource_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComResource_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComResource_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComResource_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComResource_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_ComResource_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_ComResource_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_ComResource_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmPost_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_CrmPost_CompanyId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_DepartmentId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_RoleId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_Code, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_FullName, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_Remark, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_Enabled, SqlDbType.Int, 10), new SqlParameter(Parm_CrmPost_SortCode, SqlDbType.Int, 10), new SqlParameter(Parm_CrmPost_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_CrmPost_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmPost_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmPost_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmPost_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmPost_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
private SqlParameter[] GetParameters(U_EVNT_MASTER tobjU_EVNT_MASTER) { SqlParameter[] objParamArray = SqlHelperParameterCache.GetCachedParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_EVNT_MASTER); if (objParamArray == null) { //Represents a parameter to a System.Data.SqlClient.SqlCommand, //and optionally, its mapping to System.Data.DataSet columns. objParamArray = new SqlParameter[] { new SqlParameter(PARAM_Event_Id, tobjU_EVNT_MASTER.Event_Id), new SqlParameter(PARAM_Event_Creator_Id, tobjU_EVNT_MASTER.Event_Creator_Id), new SqlParameter(PARAM_Event_Type_Id, tobjU_EVNT_MASTER.Event_Type_Id), new SqlParameter(PARAM_Event_Name, tobjU_EVNT_MASTER.Event_Name), new SqlParameter(PARAM_Event_Desc, tobjU_EVNT_MASTER.Event_Desc), new SqlParameter(PARAM_Event_StartDate, tobjU_EVNT_MASTER.Event_StartDate), new SqlParameter(PARAM_Event_EndDate, tobjU_EVNT_MASTER.Event_EndDate), new SqlParameter(PARAM_Even_Location, tobjU_EVNT_MASTER.Even_Location), new SqlParameter(PARAM_Event_Status, tobjU_EVNT_MASTER.Event_Status), new SqlParameter(PARAM_Media_Id_Img, tobjU_EVNT_MASTER.Media_Id_Img), new SqlParameter(PARAM_COMMENTS, tobjU_EVNT_MASTER.COMMENTS), new SqlParameter(PARAM_Created_Date, tobjU_EVNT_MASTER.Created_Date), new SqlParameter(PARAM_Updated_Date, tobjU_EVNT_MASTER.Updated_Date), new SqlParameter(PARAM_Created_by, tobjU_EVNT_MASTER.Created_by), new SqlParameter(PARAM_Updated_by, tobjU_EVNT_MASTER.Updated_by), }; SqlHelperParameterCache.CacheParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_EVNT_MASTER, objParamArray); } return(objParamArray); }
public void UpdateUserInfo(DataModule.UserInfo userInfo) { string sql = "UPDATE Tb_UserInfo set Email=@Email, NickName=@NickName, Sex=@Sex, BirthDay=@BirthDay, Age=@Age where UserID=@UserID"; SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(sql); if (parms == null) { parms = new SqlParameter[] { new SqlParameter("@Email", SqlDbType.NVarChar, 50), new SqlParameter("@NickName", SqlDbType.NVarChar, 20), new SqlParameter("@Sex", SqlDbType.SmallInt), new SqlParameter("@BirthDay", SqlDbType.Date), new SqlParameter("@Age", SqlDbType.Int), new SqlParameter("@UserID", SqlDbType.BigInt) }; SqlHelperParameterCache.CacheParameterSet(sql, parms); } parms[0].Value = userInfo.Email; parms[1].Value = userInfo.NickName; parms[2].Value = userInfo.Sex; parms[3].Value = userInfo.BirthDay; parms[4].Value = userInfo.Age; parms[5].Value = userInfo.UserID; SqlHelper.ExecuteNonQuery(connString, CommandType.Text, sql, parms); }
private SqlParameter[] GetParameters(U_USR_Lgn tobjU_USR_Lgn) { SqlParameter[] objParamArray = SqlHelperParameterCache.GetCachedParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_USR_Lgn); if (objParamArray == null) { //Represents a parameter to a System.Data.SqlClient.SqlCommand, //and optionally, its mapping to System.Data.DataSet columns. objParamArray = new SqlParameter[] { new SqlParameter(PARAM_Login_Id, tobjU_USR_Lgn.Login_Id), new SqlParameter(PARAM_Usr_Mst_Id, tobjU_USR_Lgn.Usr_Mst_Id), new SqlParameter(PARAM_Email_ID, tobjU_USR_Lgn.Email_ID), new SqlParameter(PARAM_Mobile_Number, tobjU_USR_Lgn.Mobile_Number), new SqlParameter(PARAM_Pwd, tobjU_USR_Lgn.Pwd), new SqlParameter(PARAM_Last_Login_Date, tobjU_USR_Lgn.Last_Login_Date), new SqlParameter(PARAM_Ip_Address, tobjU_USR_Lgn.Ip_Address), new SqlParameter(PARAM_Login_status, tobjU_USR_Lgn.Login_status), new SqlParameter(PARAM_Created_Date, tobjU_USR_Lgn.Created_Date), new SqlParameter(PARAM_Updated_Date, tobjU_USR_Lgn.Updated_Date), new SqlParameter(PARAM_Created_by, tobjU_USR_Lgn.Created_by), new SqlParameter(PARAM_Updated_by, tobjU_USR_Lgn.Updated_by), }; SqlHelperParameterCache.CacheParameterSet(General.SQL_CONN_STRING, SQL_INSERT_U_USR_Lgn, objParamArray); } return(objParamArray); }
private SqlParameter[] GetParameters(Company objCompany) { SqlParameter[] objParamArray = SqlHelperParameterCache.GetCachedParameterSet(SQL_CONN_STRING, SQL_INSERT_Company); if (objParamArray == null) { //Represents a parameter to a System.Data.SqlClient.SqlCommand, //and optionally, its mapping to System.Data.DataSet columns. objParamArray = new SqlParameter[] { new SqlParameter(PARAM_CompanyCode, objCompany.CompanyCode), new SqlParameter(PARAM_CompanyName, objCompany.CompanyName), new SqlParameter(PARAM_ShortName, objCompany.ShortName), new SqlParameter(PARAM_Salogan, objCompany.Salogan), new SqlParameter(PARAM_ContactPerson, objCompany.ContactPerson), new SqlParameter(PARAM_Address, objCompany.Address), new SqlParameter(PARAM_Phone1, objCompany.Phone1), new SqlParameter(PARAM_Phone2, objCompany.Phone2), new SqlParameter(PARAM_Phone3, objCompany.Phone3), new SqlParameter(PARAM_Phone4, objCompany.Phone4), new SqlParameter(PARAM_Fax1, objCompany.Fax1), new SqlParameter(PARAM_Fax2, objCompany.Fax2), new SqlParameter(PARAM_URL, objCompany.URL), new SqlParameter(PARAM_Eamil1, objCompany.Eamil1), new SqlParameter(PARAM_Email2, objCompany.Email2), new SqlParameter(PARAM_STRNo, objCompany.STRNo), new SqlParameter(PARAM_NTN, objCompany.NTN), new SqlParameter(PARAM_LogoPath, objCompany.LogoPath), new SqlParameter(PARAM_Status, objCompany.Status), new SqlParameter(PARAM_AddByUserId, objCompany.AddByUserId), new SqlParameter(PARAM_AddDateTime, objCompany.AddDateTime), }; SqlHelperParameterCache.CacheParameterSet(SQL_CONN_STRING, SQL_INSERT_Company, objParamArray); } return(objParamArray); }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmCompany_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_CrmCompany_ParentId, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Category, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Code, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_FullName, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_ShortName, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Nature, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Manager, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Contact, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Phone, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Fax, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Email, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_ProvinceId, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Province, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_CityId, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_City, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_CountyId, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_County, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_Address, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_AccountInfo, SqlDbType.VarChar, 200), new SqlParameter(Parm_CrmCompany_Postalcode, SqlDbType.VarChar, 200), new SqlParameter(Parm_CrmCompany_Web, SqlDbType.VarChar, 200), new SqlParameter(Parm_CrmCompany_Remark, SqlDbType.VarChar, 200), new SqlParameter(Parm_CrmCompany_Enforcement, SqlDbType.Int, 10), new SqlParameter(Parm_CrmCompany_Enabled, SqlDbType.Int, 10), new SqlParameter(Parm_CrmCompany_SortCode, SqlDbType.Int, 10), new SqlParameter(Parm_CrmCompany_DeleteMark, SqlDbType.Int, 10), new SqlParameter(Parm_CrmCompany_CreateDate, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmCompany_CreateUserId, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_CreateUserName, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_ModifyDate, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmCompany_ModifyUserId, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_ModifyUserName, SqlDbType.VarChar, 50), new SqlParameter(Parm_CrmCompany_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_CrmCompany_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmCompany_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmCompany_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmCompany_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmCompany_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmCompany_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmCompany_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmCompany_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
/// <summary> /// 获取一个给SQL语句传参用的参数集合 /// </summary> /// <returns>SqlParameter[] 集合</returns> public override SqlParameter[] GetParms() { try { var parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmUser_Insert); if (parms == null) { parms = new[] { new SqlParameter(Parm_CrmUser_CompanyId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_DepartmentId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_InnerUser, SqlDbType.Int, 10), new SqlParameter(Parm_CrmUser_Code, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_Account, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_Password, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_Secretkey, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_RealName, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_Spell, SqlDbType.NVarChar, 200), new SqlParameter(Parm_CrmUser_Gender, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_Birthday, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmUser_Mobile, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_Telephone, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_OICQ, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_Email, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_ChangePasswordDate, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmUser_OpenId, SqlDbType.Int, 10), new SqlParameter(Parm_CrmUser_LogOnCount, SqlDbType.Int, 10), new SqlParameter(Parm_CrmUser_FirstVisit, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmUser_PreviousVisit, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmUser_LastVisit, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmUser_AuditStatus, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_AuditUserId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_AuditUserName, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_AuditDateTime, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmUser_IsCityManager, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_Remark, SqlDbType.NVarChar, 200), new SqlParameter(Parm_CrmUser_Enabled, SqlDbType.Int, 10), new SqlParameter(Parm_CrmUser_SortCode, SqlDbType.Int, 10), new SqlParameter(Parm_CrmUser_RowStatus, SqlDbType.Int, 10), new SqlParameter(Parm_CrmUser_CreatorId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_CreateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_CreateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmUser_UpdateId, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_UpdateBy, SqlDbType.NVarChar, 50), new SqlParameter(Parm_CrmUser_UpdateOn, SqlDbType.DateTime, 23), new SqlParameter(Parm_CrmUser_Id, SqlDbType.NVarChar, 50) }; SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlConnStringWrite, Sql_CrmUser_Insert, parms); } return(parms); } catch (Exception e) { throw new Exception("获取查询参数时出错!", e); } }
public List <Model.ProductInfo> GetProductsBySearch(string[] keywords) { List <Model.ProductInfo> list = new List <Model.ProductInfo>(); int numKeywords = keywords.Length; StringBuilder sql = new StringBuilder(Sql_Select_Products_By_Search1); for (int i = 0; i < numKeywords; i++) { sql.Append(string.Format(Sql_Select_Products_By_Search2, Parm_Keyword + i)); sql.Append(i + 1 < numKeywords ? Sql_Select_Products_By_Search3 : Sql_Select_Products_By_Search4); } string sqlProductsBySearch = sql.ToString(); SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(SqlHelper.SqlProviderConnString, sqlProductsBySearch); if (parms == null) { parms = new SqlParameter[numKeywords]; for (int i = 0; i < numKeywords; i++) { parms[i] = new SqlParameter(Parm_Keyword + i, SqlDbType.NVarChar, 10); } SqlHelperParameterCache.CacheParameterSet(SqlHelper.SqlProviderConnString, sqlProductsBySearch, parms); } for (int i = 0; i < numKeywords; i++) { parms[i].Value = keywords[i]; } using (SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.SqlProviderConnString, CommandType.Text, sqlProductsBySearch, parms)) { if (reader != null) { while (reader.Read()) { Model.ProductInfo model = new Model.ProductInfo(); model.ProductId = reader.GetString(0); model.ProductName = reader.GetString(1); model.Subtitle = reader.GetString(2); model.ProductPrice = reader.GetDecimal(3); model.ImagesUrl = reader.GetString(4); list.Add(model); } } } return(list); }
public void DeleteGroup(int id) { string sql = "DELETE FROM Tb_UserGroup WHERE ID=@ID"; SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(sql); if (parms == null) { parms = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.Int) }; SqlHelperParameterCache.CacheParameterSet(sql, parms); } parms[0].Value = id; SqlHelper.ExecuteNonQuery(connString, CommandType.Text, sql, parms); }
public void UpdateGroupName(int id, string name) { string sql = "UPDATE Tb_UserGroup SET GroupName=@GroupName WHERE ID=@ID"; SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(sql); if (parms == null) { parms = new SqlParameter[] { new SqlParameter("@GroupName", SqlDbType.NVarChar, 20), new SqlParameter("@ID", SqlDbType.Int) }; SqlHelperParameterCache.CacheParameterSet(sql, parms); } parms[0].Value = id; parms[1].Value = name; SqlHelper.ExecuteNonQuery(connString, CommandType.Text, sql, parms); }
public void DeleteFirendByFriendID(int userID, int friendID) { string sql = "Delete from Tb_UserFriend where UserID=@UserID and FriendID=@FriendID"; SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(sql); if (parms == null) { parms = new SqlParameter[] { new SqlParameter("@UserID", SqlDbType.BigInt), new SqlParameter("@FriendID", SqlDbType.BigInt) }; SqlHelperParameterCache.CacheParameterSet(sql, parms); } parms[0].Value = userID; parms[1].Value = friendID; SqlHelper.ExecuteNonQuery(connString, CommandType.Text, sql, parms); }
public void UpdateUserStatusByUserID(int userID, uint status) { string sql = "Update Tb_User set Status=@Status where UserID=@UserID"; SqlParameter[] parms = SqlHelperParameterCache.GetCachedParameterSet(sql); if (parms == null) { parms = new SqlParameter[] { new SqlParameter("@Status", SqlDbType.TinyInt), new SqlParameter("@UserID", SqlDbType.BigInt) }; SqlHelperParameterCache.CacheParameterSet(sql, parms); } parms[0].Value = status; parms[1].Value = userID; SqlHelper.ExecuteNonQuery(connString, CommandType.Text, sql, parms); }