public DataTable GetOrderTableExtend(DataBaseType dbType, List<OrderTableFields> orderTableShowFields, List<TicketTypeFields> ticketTypeShowFields, List<OrderTableWhereFields> whereFields, List<OrderTableOrderFields> orderFields, int pageSize, int pageIndex)
        {
            StringBuilder sql = new StringBuilder();
            string orderTableShowFieldsSql = GetOrderShowFields("OrderTable", orderTableShowFields);
            string ticketTypeShowFieldsSql = GetTicketShowFields("TicketType", ticketTypeShowFields);
            int start = (pageIndex - 1) * pageSize + 1;
            int end = start + pageSize - 1;
            sql.Append("SELECT * FROM (SELECT ROW_NUMBER() OVER (");
            if (string.IsNullOrEmpty(GetOrderFields(orderFields)))
            {
                sql.Append(" order by ");
                sql.AppendFormat("[{0}].[dbo].[OrderTable].OTId", DatabaseManager.Db_JQEBookingDataBase);
            }
            else
            {
                sql.Append(GetOrderFields(orderFields));
            }
            sql.Append(") AS rowNumber,");
            sql.Append(orderTableShowFieldsSql);
            sql.Append(",");
            sql.Append(ticketTypeShowFieldsSql);
            sql.Append(" from ");
            sql.AppendFormat("[{0}].[dbo].[OrderTable]", DatabaseManager.Db_JQEBookingDataBase);
            sql.Append(" with(nolock) ");
            sql.Append("left join ");
            sql.AppendFormat("[{0}].[dbo].[TicketType]", DatabaseManager.Db_JQEBookingDataBase);
            sql.Append(" on ");
            sql.AppendFormat("[{0}].[dbo].[OrderTable].OTTicketTypeId=[{0}].[dbo].[TicketType].TTTypeId", DatabaseManager.Db_JQEBookingDataBase);
            sql.Append(" where ");
            sql.Append(GetSqlString(null, whereFields));
            sql.Append(") AS sp WHERE rowNumber BETWEEN ");
            sql.Append(start.ToString());
            sql.Append(" AND ");
            sql.Append(end.ToString());

            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();

            if (whereFields != null && whereFields.Count > 0)
            {
                GetSqlParameterWrapperCollection(collection, null, whereFields);
            }

            DataTable datatable = SqlHelper.ExecuteDataTable(DatabaseManager.GetDataBase(DatabaseManager.Db_JQEBookingConfig, dbType), sql.ToString(), collection);
            return datatable;
        }
Example #2
0
        /// <summary>
        /// Comments 自定义查询操作
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="showFields">显示字段</param>
        /// <param name="whereFields">条件字段</param>
        /// <param name="orderFields">排序字段</param>
        /// <returns>返回Comments实体列表</returns>
        public static List<CommentsModel> GetCommentsListBySql(string sql, List<CommentsWhereFields> whereFields)
        {
            string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Comments表查询操作/File:CommentsAccess.cs/Fun:GetCommentsList*/";
            StringBuilder sqlStr = new StringBuilder();
            sqlStr.Append(sqlDescription);
            sqlStr.Append(sql);
            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();

            if ( whereFields != null && whereFields.Count > 0 )
            {
                sqlStr.Append(" where ");
                sqlStr.Append(GetSqlString(null, whereFields));
            }

            GetSqlParameterWrapperCollection(collection, null, whereFields);
            IDataReader reader = SqlHelper.ExecuteReader(DatabaseManager.GetDataBase(DatabaseManager.Db_JQEBookingConfig,DataBaseType.Read),sqlStr.ToString(), collection);
            return  GetList(null,reader);
        }
        /// <summary>
        /// 获取某个景区的评论数
        /// </summary>
        /// <param name="scenicId"></param>
        /// <returns></returns>
        public int GetCommentsCount(List<CommentsWhereFields> whereFields, string scenicId)
        {
            StringBuilder sqlsb = new StringBuilder();
            sqlsb.Append("select count(Comments.COrderSerialNo) from ");
            sqlsb.AppendFormat("[{0}].[dbo].[Comments]", DatabaseManager.Db_JQEBookingDataBase);
            sqlsb.Append(" with(nolock) left join ");
            sqlsb.AppendFormat("[{0}].[dbo].[OrderTable]", DatabaseManager.Db_JQEBookingDataBase);
            sqlsb.Append(" on Comments.COrderSerialNo=OrderTable.OTOrderSerialNo");
            sqlsb.AppendFormat(" where OrderTable.OTScenicId={0}", scenicId);
            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();
            if (whereFields != null && whereFields.Count > 0)
            {
                GetSqlParameterWrapperCollection(collection, null, whereFields);
                sqlsb.Append(" and ");
            }
            sqlsb.Append(GetSqlString(null, whereFields));
            sqlsb.Append(" --Flat:Asp.net小组/Author:谢超/For:获取订单统计列表/File :CommentsAccess.Extensibility.cs/Fun:GetCommentsExtend");

            return SqlHelper.ExecuteScalarByInt(sqlsb.ToString(), collection);
        }
 /// <summary>
 /// 获取所有评论列表
 /// </summary>
 /// <returns></returns>
 public DataTable GetCommentsExtend(List<CommentsWhereFields> whereFields, string scenicId, int pageSize, int pageIndex)
 {
     int start = (pageIndex - 1) * pageSize + 1;
     int end = start + pageSize - 1;
     StringBuilder sqlsb = new StringBuilder();
     sqlsb.AppendFormat(@"SELECT * FROM
         (SELECT ROW_NUMBER() OVER
         ( order by [{0}].[dbo].[OrderTable].OTId)
         AS rowNumber
         ,Comments.COrderSerialNo
         ,Comments.CCommentsType
         ,Comments.CCommentsContent
         ,Comments.CCommentsTime
         ,Comments.CCommentsReply
         ,Comments.CCommentsState
         ,OrderTable.OTOrderName from ", DatabaseManager.Db_JQEBookingDataBase);
     sqlsb.AppendFormat("[{0}].[dbo].[Comments]", DatabaseManager.Db_JQEBookingDataBase);
     sqlsb.Append(" with(nolock) left join ");
     sqlsb.AppendFormat("[{0}].[dbo].[OrderTable]", DatabaseManager.Db_JQEBookingDataBase);
     sqlsb.Append(" on Comments.COrderSerialNo=OrderTable.OTOrderSerialNo");
     sqlsb.AppendFormat(" where OrderTable.OTScenicId={0} ", scenicId);
     SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();
     if (whereFields != null && whereFields.Count > 0)
     {
         GetSqlParameterWrapperCollection(collection, null, whereFields);
         sqlsb.Append(" and ");
     }
     sqlsb.Append(GetSqlString(null, whereFields));
     sqlsb.Append(") AS sp WHERE rowNumber BETWEEN ");
     sqlsb.Append(start.ToString());
     sqlsb.Append(" AND ");
     sqlsb.Append(end.ToString());
     sqlsb.Append(" --Flat:Asp.net小组/Author:谢超/For:获取订单统计列表/File :CommentsAccess.Extensibility.cs/Fun:GetCommentsExtend");
     DataTable datatable = SqlHelper.ExecuteDataTable(sqlsb.ToString(), collection);
     return datatable;
 }
Example #5
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="showFields">显示字段</param>
        /// <param name="whereFields">条件字段</param>
        /// <param name="orderFields">排序字段</param>
        /// <param name="pageSize">页面数量</param>
        /// <param name="pageIndex">页面索引</param>
        /// <returns>返回Admin实体列表</returns>
        public List<AdminModel> GetAdminList(DataBaseType dbType,List<AdminFields> showFields, List<AdminWhereFields> whereFields, List<AdminOrderFields> orderFields, int pageSize, int pageIndex)
        {
            string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Admin表分页查询操作/File:AdminAccess.cs/Fun:GetAdminList*/";
            StringBuilder sql = new StringBuilder();
            sql.Append(sqlDescription);
            sql.Append(PageSplitQuery.GetPageSplitSql2005("Admin", "AId", GetShowFields(showFields), string.Empty, GetSqlString(null, whereFields), GetOrderFields(orderFields), pageSize, pageIndex));
            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();

            if ( whereFields != null && whereFields.Count > 0 )
            {
                GetSqlParameterWrapperCollection(collection, null, whereFields);
            }

            IDataReader reader = SqlHelper.ExecuteReader(DatabaseManager.GetDataBase(DatabaseManager.Db_JQEBookingConfig,dbType),sql.ToString(), collection);
            return  GetList(showFields,reader);
        }
Example #6
0
 /// <summary>
 /// 自定义添加操作
 /// </summary>
 /// <param name="list">字段值对</param>
 /// <returns>返回主键值</returns>
 public int AddByIdentity(List<AdminFieldValuePair> list)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Admin表增加操作/File:AdminAccess.cs/Fun:AddByIdentity*/";
     StringBuilder sql = new StringBuilder();
     sql.Append(sqlDescription);
     sql.Append(GetInsertSql(list));
     SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();
     GetSqlParameterWrapperCollection(collection, list, null);
        return SqlHelper.ExecuteIdentity(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),collection);
 }
 /// <summary>
 /// OrderTable 添加操作返回主键的编号
 /// </summary>
 /// <param name="ordertable">OrderTable实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public int AddByIdentity(OrderTableModel ordertable,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:OrderTable表增加操作/File:OrderTableAccess.cs/Fun:AddByIdentity*/";
        StringBuilder sql = new StringBuilder();
        sql.Append(sqlDescription);
        sql.Append("insert ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[OrderTable] (OTOrderSerialNo,OTOrderComfirmNo,OTOrderCreateTime,OTTravelTime,OTOrderPhone,OTOrderName,OTTicketPhone,OTTicketName,OTTicketNumber,OTOrderState,OTPayWay,OTTicketPrice,OTIdentityCard,OTBrokerage,OTTicketTypeId,OTRowValid,OTRemark,OTScenicId,OTHaveTicketNumber) values(@OTOrderSerialNo,@OTOrderComfirmNo,@OTOrderCreateTime,@OTTravelTime,@OTOrderPhone,@OTOrderName,@OTTicketPhone,@OTTicketName,@OTTicketNumber,@OTOrderState,@OTPayWay,@OTTicketPrice,@OTIdentityCard,@OTBrokerage,@OTTicketTypeId,@OTRowValid,@OTRemark,@OTScenicId,@OTHaveTicketNumber)");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@OTOrderSerialNo", ordertable.OTOrderSerialNo,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTOrderComfirmNo", ordertable.OTOrderComfirmNo,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTOrderCreateTime", ordertable.OTOrderCreateTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@OTTravelTime", ordertable.OTTravelTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@OTOrderPhone", ordertable.OTOrderPhone,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTOrderName", ordertable.OTOrderName,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTTicketPhone", ordertable.OTTicketPhone,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTTicketName", ordertable.OTTicketName,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTTicketNumber", ordertable.OTTicketNumber,SqlDbType.Int));
        Collection.Add(new SqlParameterWrapper("@OTOrderState", ordertable.OTOrderState,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@OTPayWay", ordertable.OTPayWay,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@OTTicketPrice", ordertable.OTTicketPrice,SqlDbType.Decimal));
        Collection.Add(new SqlParameterWrapper("@OTIdentityCard", ordertable.OTIdentityCard,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTBrokerage", ordertable.OTBrokerage,SqlDbType.Decimal));
        Collection.Add(new SqlParameterWrapper("@OTTicketTypeId", ordertable.OTTicketTypeId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTRowValid", ordertable.OTRowValid,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@OTRemark", ordertable.OTRemark,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTScenicId", ordertable.OTScenicId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTHaveTicketNumber", ordertable.OTHaveTicketNumber,SqlDbType.Int));
        return SqlHelper.ExecuteIdentity(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction);
 }
Example #8
0
 /// <summary>
 /// 自定义删除
 /// </summary>
 /// <param name="where">删除条件</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Delete(List<CommentsWhereFields> where,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Comments表删除操作/File:CommentsAccess.cs/Fun:Delete*/";
     StringBuilder sql = new StringBuilder();
     sql.Append(sqlDescription);
     sql.Append("delete ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Comments] where ");
     sql.Append(GetSqlString(null, where));
     SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();
     GetSqlParameterWrapperCollection(collection, null, where);
     return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig), sql.ToString(), collection,transaction) > 0;
 }
Example #9
0
 /// <summary>
 /// Comments 添加操作
 /// </summary>
 /// <param name="comments">Comments实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Add(CommentsModel comments,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Comments表增加操作/File:CommentsAccess.cs/Fun:Add*/";
        StringBuilder sql = new StringBuilder();
        sql.Append(sqlDescription);
        sql.Append("insert ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Comments] (COrderSerialNo,CCommentsType,CCommentsContent,CCommentsTime,CCommentsReply,CReplyTime,CCommentsState,CRowValid) values(@COrderSerialNo,@CCommentsType,@CCommentsContent,@CCommentsTime,@CCommentsReply,@CReplyTime,@CCommentsState,@CRowValid)");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@COrderSerialNo", comments.COrderSerialNo,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@CCommentsType", comments.CCommentsType,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@CCommentsContent", comments.CCommentsContent,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@CCommentsTime", comments.CCommentsTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@CCommentsReply", comments.CCommentsReply,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@CReplyTime", comments.CReplyTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@CCommentsState", comments.CCommentsState,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@CRowValid", comments.CRowValid,SqlDbType.TinyInt));
        return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction) > 0;
 }
Example #10
0
        /// <summary>
        /// 获取SqlParameterWrapperCollection
        /// </summary>
        /// <param name="collection">SqlParameterWrapperCollection</param>
        /// <param name="updates">更新列表</param>
        /// <param name="where">条件列表</param>
        public static void GetSqlParameterWrapperCollection(SqlParameterWrapperCollection collection, List<CommentsFieldValuePair> updates, List<CommentsWhereFields> where)
        {
            if ( updates != null && updates.Count > 0 )
            {
                foreach ( CommentsFieldValuePair values in updates )
                {
                    SetSqlParameterWrapperCollection(collection, values.Field, values.Field.ToString(), values.FieldValue);
                }
            }

            if ( where != null && where.Count > 0 )
            {
                for( int i=0; i< where.Count; i++)
                {
                     if (where[i].Condition == QueryCondition.InOpertion)
                      {
                          continue;
                      }
                    string suffix = string.Empty;
                    if ( updates != null && IsExistField(updates, where[i].Field) )
                    {
                        suffix = "1";
                    }
                    suffix = IsWhereField(where, i);
                    SetSqlParameterWrapperCollection(collection, where[i].Field, where[i].Field.ToString() + suffix, where[i].FieldValue);
                }
            }
        }
Example #11
0
        /// <summary>
        /// TicketType 自定义查询操作
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="showFields">显示字段</param>
        /// <param name="whereFields">条件字段</param>
        /// <param name="orderFields">排序字段</param>
        /// <returns>返回TicketType表格</returns>
        public DataTable GetTicketTypeTable(DataBaseType dbType,List<TicketTypeFields> showFields, List<TicketTypeWhereFields> whereFields, List<TicketTypeOrderFields> orderFields)
        {
            string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:TicketType表查询操作/File:TicketTypeAccess.cs/Fun:GetTicketTypeTable*/";
            StringBuilder sql = new StringBuilder();
            sql.Append(sqlDescription);
            sql.Append("select " + GetShowFields(showFields) + " from ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[TicketType] with(nolock)");
            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();

            if ( whereFields != null && whereFields.Count > 0 )
            {
                sql.Append(" where ");
                sql.Append(GetSqlString(null, whereFields));
            }

            if ( orderFields != null && orderFields.Count > 0 )
            {
                sql.Append(GetOrderFields(orderFields));
            }

            GetSqlParameterWrapperCollection(collection, null, whereFields);
            return SqlHelper.ExecuteDataTable(DatabaseManager.GetDataBase(DatabaseManager.Db_JQEBookingConfig,dbType),sql.ToString(),collection);
        }
Example #12
0
        /// <summary>
        /// 设置SqlParameterWrapperCollection
        /// </summary>
        /// <param name="collection">SqlParameterWrapperCollection</param>
        /// <param name="field">字段</param>
        /// <param name="fieldVariable">字段变量</param>
        /// <param name="fieldValue">值</param>
        public static void SetSqlParameterWrapperCollection(SqlParameterWrapperCollection collection, RemarkFields field, string fieldVariable, object fieldValue)
        {
            switch ( field )
            {
                case RemarkFields.RId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Int));
                    break;

                case RemarkFields.ROrderSerialNo:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case RemarkFields.RRemarkType:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case RemarkFields.RRemarkContent:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case RemarkFields.RRemarkTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case RemarkFields.RRemarkReply:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case RemarkFields.RReplyTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case RemarkFields.RRemarkState:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case RemarkFields.RRowValid:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

            }
        }
Example #13
0
 /// <summary>
 /// OrderTable修改操作
 /// </summary>
 /// <param name="oTId">订单表id</param>
 /// <param name="updateModel">要修改OrderTable实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Update(int oTId,OrderTableModel updateModel,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:OrderTable表更新操作/File:OrderTableAccess.cs/Fun:Update*/";
     StringBuilder sql = new StringBuilder();
     sql.Append(sqlDescription);
        sql.Append("update ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[OrderTable] set OTOrderComfirmNo=@OTOrderComfirmNo,OTOrderCreateTime=@OTOrderCreateTime,OTTravelTime=@OTTravelTime,OTOrderPhone=@OTOrderPhone,OTOrderName=@OTOrderName,OTTicketPhone=@OTTicketPhone,OTTicketName=@OTTicketName,OTTicketNumber=@OTTicketNumber,OTOrderState=@OTOrderState,OTPayWay=@OTPayWay,OTTicketPrice=@OTTicketPrice,OTIdentityCard=@OTIdentityCard,OTBrokerage=@OTBrokerage,OTTicketTypeId=@OTTicketTypeId,OTRowValid=@OTRowValid,OTRemark=@OTRemark,OTScenicId=@OTScenicId,OTHaveTicketNumber=@OTHaveTicketNumber where OTId=@OTId");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@OTOrderComfirmNo", updateModel.OTOrderComfirmNo,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTOrderCreateTime", updateModel.OTOrderCreateTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@OTTravelTime", updateModel.OTTravelTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@OTOrderPhone", updateModel.OTOrderPhone,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTOrderName", updateModel.OTOrderName,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTTicketPhone", updateModel.OTTicketPhone,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTTicketName", updateModel.OTTicketName,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTTicketNumber", updateModel.OTTicketNumber,SqlDbType.Int));
        Collection.Add(new SqlParameterWrapper("@OTOrderState", updateModel.OTOrderState,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@OTPayWay", updateModel.OTPayWay,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@OTTicketPrice", updateModel.OTTicketPrice,SqlDbType.Decimal));
        Collection.Add(new SqlParameterWrapper("@OTIdentityCard", updateModel.OTIdentityCard,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTBrokerage", updateModel.OTBrokerage,SqlDbType.Decimal));
        Collection.Add(new SqlParameterWrapper("@OTTicketTypeId", updateModel.OTTicketTypeId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTRowValid", updateModel.OTRowValid,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@OTRemark", updateModel.OTRemark,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTScenicId", updateModel.OTScenicId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@OTHaveTicketNumber", updateModel.OTHaveTicketNumber,SqlDbType.Int));
        Collection.Add(new SqlParameterWrapper("@OTId", oTId,SqlDbType.Int));
        return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction) > 0;
 }
Example #14
0
 /// <summary>
 /// JQResource 添加操作返回主键的编号
 /// </summary>
 /// <param name="jqresource">JQResource实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public int AddByIdentity(JQResourceModel jqresource,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:JQResource表增加操作/File:JQResourceAccess.cs/Fun:AddByIdentity*/";
        StringBuilder sql = new StringBuilder();
        sql.Append(sqlDescription);
        sql.Append("insert ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[JQResource] (JQRScenicId,JQRScenicName,JQRScenicDecribe,JQRPrincipal,JQRAddress,JQRTelephone,JQREmail,JQRRowValid,JQRCreateTime) values(@JQRScenicId,@JQRScenicName,@JQRScenicDecribe,@JQRPrincipal,@JQRAddress,@JQRTelephone,@JQREmail,@JQRRowValid,@JQRCreateTime)");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@JQRScenicId", jqresource.JQRScenicId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRScenicName", jqresource.JQRScenicName,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRScenicDecribe", jqresource.JQRScenicDecribe,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRPrincipal", jqresource.JQRPrincipal,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRAddress", jqresource.JQRAddress,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRTelephone", jqresource.JQRTelephone,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQREmail", jqresource.JQREmail,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRRowValid", jqresource.JQRRowValid,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@JQRCreateTime", jqresource.JQRCreateTime,SqlDbType.DateTime));
        return SqlHelper.ExecuteIdentity(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction);
 }
Example #15
0
        /// <summary>
        /// 设置SqlParameterWrapperCollection
        /// </summary>
        /// <param name="collection">SqlParameterWrapperCollection</param>
        /// <param name="field">字段</param>
        /// <param name="fieldVariable">字段变量</param>
        /// <param name="fieldValue">值</param>
        public static void SetSqlParameterWrapperCollection(SqlParameterWrapperCollection collection, JQResourceFields field, string fieldVariable, object fieldValue)
        {
            switch ( field )
            {
                case JQResourceFields.JQRId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Int));
                    break;

                case JQResourceFields.JQRScenicId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case JQResourceFields.JQRScenicName:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case JQResourceFields.JQRScenicDecribe:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case JQResourceFields.JQRPrincipal:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case JQResourceFields.JQRAddress:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case JQResourceFields.JQRTelephone:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case JQResourceFields.JQREmail:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case JQResourceFields.JQRRowValid:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case JQResourceFields.JQRCreateTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

            }
        }
Example #16
0
 /// <summary>
 /// JQResource修改操作
 /// </summary>
 /// <param name="jQRId">景区资源表Id</param>
 /// <param name="updateModel">要修改JQResource实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Update(int jQRId,JQResourceModel updateModel,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:JQResource表更新操作/File:JQResourceAccess.cs/Fun:Update*/";
     StringBuilder sql = new StringBuilder();
     sql.Append(sqlDescription);
        sql.Append("update ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[JQResource] set JQRScenicDecribe=@JQRScenicDecribe,JQRPrincipal=@JQRPrincipal,JQRAddress=@JQRAddress,JQRTelephone=@JQRTelephone,JQREmail=@JQREmail,JQRRowValid=@JQRRowValid,JQRCreateTime=@JQRCreateTime where JQRId=@JQRId");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@JQRScenicDecribe", updateModel.JQRScenicDecribe,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRPrincipal", updateModel.JQRPrincipal,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRAddress", updateModel.JQRAddress,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRTelephone", updateModel.JQRTelephone,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQREmail", updateModel.JQREmail,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@JQRRowValid", updateModel.JQRRowValid,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@JQRCreateTime", updateModel.JQRCreateTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@JQRId", jQRId,SqlDbType.Int));
        return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction) > 0;
 }
Example #17
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="showFields">显示字段</param>
        /// <param name="whereFields">条件字段</param>
        /// <param name="orderFields">排序字段</param>
        /// <param name="pageSize">页面数量</param>
        /// <param name="pageIndex">页面索引</param>
        /// <returns>返回表格</returns>
        public DataTable GetJQResourceTable(DataBaseType dbType,List<JQResourceFields> showFields, List<JQResourceWhereFields> whereFields, List<JQResourceOrderFields> orderFields, int pageSize, int pageIndex)
        {
            string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:JQResource表分页查询操作/File:JQResourceAccess.cs/Fun:GetJQResourceTable*/";
            StringBuilder sql = new StringBuilder();
            sql.Append(sqlDescription);
            sql.Append(PageSplitQuery.GetPageSplitSql2005("JQResource", "JQRId", GetShowFields(showFields), string.Empty, GetSqlString(null, whereFields), GetOrderFields(orderFields), pageSize, pageIndex));
            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();

            if ( whereFields != null && whereFields.Count > 0 )
            {
                GetSqlParameterWrapperCollection(collection, null, whereFields);
            }
            return SqlHelper.ExecuteDataTable(DatabaseManager.GetDataBase(DatabaseManager.Db_JQEBookingConfig,dbType),sql.ToString(),collection);
        }
Example #18
0
        /// <summary>
        /// 设置SqlParameterWrapperCollection
        /// </summary>
        /// <param name="collection">SqlParameterWrapperCollection</param>
        /// <param name="field">字段</param>
        /// <param name="fieldVariable">字段变量</param>
        /// <param name="fieldValue">值</param>
        public static void SetSqlParameterWrapperCollection(SqlParameterWrapperCollection collection, TicketTypeFields field, string fieldVariable, object fieldValue)
        {
            switch ( field )
            {
                case TicketTypeFields.TTId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Int));
                    break;

                case TicketTypeFields.TTTypeId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case TicketTypeFields.TTTypeName:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case TicketTypeFields.TTScenicId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case TicketTypeFields.TTStartTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case TicketTypeFields.TTDeadline:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case TicketTypeFields.TTRowValid:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case TicketTypeFields.TTCreateTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

            }
        }
Example #19
0
 /// <summary>
 /// TicketType 添加操作
 /// </summary>
 /// <param name="tickettype">TicketType实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Add(TicketTypeModel tickettype,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:TicketType表增加操作/File:TicketTypeAccess.cs/Fun:Add*/";
        StringBuilder sql = new StringBuilder();
        sql.Append(sqlDescription);
        sql.Append("insert ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[TicketType] (TTTypeId,TTTypeName,TTScenicId,TTStartTime,TTDeadline,TTRowValid,TTCreateTime) values(@TTTypeId,@TTTypeName,@TTScenicId,@TTStartTime,@TTDeadline,@TTRowValid,@TTCreateTime)");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@TTTypeId", tickettype.TTTypeId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@TTTypeName", tickettype.TTTypeName,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@TTScenicId", tickettype.TTScenicId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@TTStartTime", tickettype.TTStartTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@TTDeadline", tickettype.TTDeadline,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@TTRowValid", tickettype.TTRowValid,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@TTCreateTime", tickettype.TTCreateTime,SqlDbType.DateTime));
        return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction) > 0;
 }
Example #20
0
 /// <summary>
 /// Remark 添加操作
 /// </summary>
 /// <param name="remark">Remark实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Add(RemarkModel remark,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Remark表增加操作/File:RemarkAccess.cs/Fun:Add*/";
        StringBuilder sql = new StringBuilder();
        sql.Append(sqlDescription);
        sql.Append("insert ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Remark] (ROrderSerialNo,RRemarkType,RRemarkContent,RRemarkTime,RRemarkReply,RReplyTime,RRemarkState,RRowValid) values(@ROrderSerialNo,@RRemarkType,@RRemarkContent,@RRemarkTime,@RRemarkReply,@RReplyTime,@RRemarkState,@RRowValid)");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@ROrderSerialNo", remark.ROrderSerialNo,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@RRemarkType", remark.RRemarkType,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@RRemarkContent", remark.RRemarkContent,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@RRemarkTime", remark.RRemarkTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@RRemarkReply", remark.RRemarkReply,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@RReplyTime", remark.RReplyTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@RRemarkState", remark.RRemarkState,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@RRowValid", remark.RRowValid,SqlDbType.TinyInt));
        return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction) > 0;
 }
Example #21
0
 /// <summary>
 /// 自定义修改
 /// </summary>
 /// <param name="update">更新字段</param>
 /// <param name="where">条件字段</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Update(List<CommentsFieldValuePair> update, List<CommentsWhereFields> where,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Comments表更新操作/File:CommentsAccess.cs/Fun:Update*/";
     StringBuilder sql = new StringBuilder();
     sql.Append(sqlDescription);
     sql.Append("update ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Comments] set ");
     sql.Append(GetSqlString(update, null));
     if(where !=null && where.Count > 0)
     {
          sql.Append(" where ");
          sql.Append(GetSqlString(null, where));
     }
     SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();
     GetSqlParameterWrapperCollection(collection, update, where);
     return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig), sql.ToString(), collection,transaction) > 0;
 }
Example #22
0
        /// <summary>
        /// 查询数量
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="whereFields">条件字段</param>
        /// <returns>返回Admin表格</returns>
        public int GetCount(DataBaseType dbType, List<AdminWhereFields> whereFields)
        {
            string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Admin表查询操作/File:AdminAccess.cs/Fun:GetTopAdminTable*/";
            StringBuilder sql = new StringBuilder();
            sql.Append(sqlDescription);
            sql.Append("select count(*) from ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Admin] with(nolock)");
            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();

            if ( whereFields != null && whereFields.Count > 0 )
            {
                sql.Append(" where ");
                sql.Append(GetSqlString(null, whereFields));
            }

            GetSqlParameterWrapperCollection(collection, null, whereFields);
            return SqlHelper.ExecuteScalarByInt(DatabaseManager.GetDataBase(DatabaseManager.Db_JQEBookingConfig,dbType),sql.ToString(),collection);
        }
Example #23
0
        /// <summary>
        /// 设置SqlParameterWrapperCollection
        /// </summary>
        /// <param name="collection">SqlParameterWrapperCollection</param>
        /// <param name="field">字段</param>
        /// <param name="fieldVariable">字段变量</param>
        /// <param name="fieldValue">值</param>
        public static void SetSqlParameterWrapperCollection(SqlParameterWrapperCollection collection, CommentsFields field, string fieldVariable, object fieldValue)
        {
            switch ( field )
            {
                case CommentsFields.CId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Int));
                    break;

                case CommentsFields.COrderSerialNo:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case CommentsFields.CCommentsType:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case CommentsFields.CCommentsContent:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case CommentsFields.CCommentsTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case CommentsFields.CCommentsReply:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case CommentsFields.CReplyTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case CommentsFields.CCommentsState:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case CommentsFields.CRowValid:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

            }
        }
Example #24
0
 /// <summary>
 /// Admin修改操作
 /// </summary>
 /// <param name="aId">景区用户Id</param>
 /// <param name="updateModel">要修改Admin实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Update(int aId,AdminModel updateModel,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Admin表更新操作/File:AdminAccess.cs/Fun:Update*/";
     StringBuilder sql = new StringBuilder();
     sql.Append(sqlDescription);
        sql.Append("update ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Admin] set APassword=@APassword,AEmail=@AEmail,ATelephone=@ATelephone,ARowValid=@ARowValid,ACreateTime=@ACreateTime,AScenicId=@AScenicId,AUserLimit=@AUserLimit where AId=@AId");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@APassword", updateModel.APassword,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@AEmail", updateModel.AEmail,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@ATelephone", updateModel.ATelephone,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@ARowValid", updateModel.ARowValid,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@ACreateTime", updateModel.ACreateTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@AScenicId", updateModel.AScenicId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@AUserLimit", updateModel.AUserLimit,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@AId", aId,SqlDbType.Int));
        return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction) > 0;
 }
Example #25
0
 /// <summary>
 /// 自定义添加操作
 /// </summary>
 /// <param name="list">字段值对</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Add(List<CommentsFieldValuePair> list,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Comments表增加操作/File:CommentsAccess.cs/Fun:Add*/";
        StringBuilder sql = new StringBuilder();
        sql.Append(sqlDescription);
        sql.Append(GetInsertSql(list));
        SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();
        GetSqlParameterWrapperCollection(collection, list, null);
        return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),collection,transaction) > 0;
 }
Example #26
0
        /// <summary>
        /// Comments 自定义查询操作
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="showFields">显示字段</param>
        /// <param name="whereFields">条件字段</param>
        /// <param name="orderFields">排序字段</param>
        /// <returns>返回Comments实体列表</returns>
        public List<CommentsModel> GetCommentsList(DataBaseType dbType,List<CommentsFields> showFields, List<CommentsWhereFields> whereFields, List<CommentsOrderFields> orderFields)
        {
            string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Comments表查询操作/File:CommentsAccess.cs/Fun:GetCommentsList*/";
            StringBuilder sql = new StringBuilder();
            sql.Append(sqlDescription);
            sql.Append("select " + GetShowFields(showFields) + " from ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Comments] with(nolock)");
            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();

            if ( whereFields != null && whereFields.Count > 0 )
            {
                sql.Append(" where ");
                sql.Append(GetSqlString(null, whereFields));
            }

            if ( orderFields != null && orderFields.Count > 0 )
            {
                sql.Append(GetOrderFields(orderFields));
            }

            GetSqlParameterWrapperCollection(collection, null, whereFields);
            IDataReader reader = SqlHelper.ExecuteReader(DatabaseManager.GetDataBase(DatabaseManager.Db_JQEBookingConfig,dbType),sql.ToString(), collection);
            return  GetList(showFields,reader);
        }
Example #27
0
        /// <summary>
        /// 设置SqlParameterWrapperCollection
        /// </summary>
        /// <param name="collection">SqlParameterWrapperCollection</param>
        /// <param name="field">字段</param>
        /// <param name="fieldVariable">字段变量</param>
        /// <param name="fieldValue">值</param>
        public static void SetSqlParameterWrapperCollection(SqlParameterWrapperCollection collection, AdminFields field, string fieldVariable, object fieldValue)
        {
            switch ( field )
            {
                case AdminFields.AId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Int));
                    break;

                case AdminFields.AName:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case AdminFields.APassword:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case AdminFields.AEmail:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case AdminFields.ATelephone:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case AdminFields.ARowValid:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case AdminFields.ACreateTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case AdminFields.AScenicId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case AdminFields.AUserId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case AdminFields.AUserLimit:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

            }
        }
Example #28
0
        /// <summary>
        /// 设置SqlParameterWrapperCollection
        /// </summary>
        /// <param name="collection">SqlParameterWrapperCollection</param>
        /// <param name="field">字段</param>
        /// <param name="fieldVariable">字段变量</param>
        /// <param name="fieldValue">值</param>
        public static void SetSqlParameterWrapperCollection(SqlParameterWrapperCollection collection, OrderTableFields field, string fieldVariable, object fieldValue)
        {
            switch ( field )
            {
                case OrderTableFields.OTId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Int));
                    break;

                case OrderTableFields.OTOrderSerialNo:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTOrderComfirmNo:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTOrderCreateTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case OrderTableFields.OTTravelTime:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.DateTime));
                    break;

                case OrderTableFields.OTOrderPhone:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTOrderName:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTTicketPhone:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTTicketName:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTTicketNumber:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Int));
                    break;

                case OrderTableFields.OTOrderState:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case OrderTableFields.OTPayWay:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case OrderTableFields.OTTicketPrice:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Decimal));
                    break;

                case OrderTableFields.OTIdentityCard:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTBrokerage:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Decimal));
                    break;

                case OrderTableFields.OTTicketTypeId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTRowValid:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.TinyInt));
                    break;

                case OrderTableFields.OTRemark:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTScenicId:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.NVarChar));
                    break;

                case OrderTableFields.OTHaveTicketNumber:
                    collection.Add(new SqlParameterWrapper("@" + fieldVariable, fieldValue, SqlDbType.Int));
                    break;

            }
        }
Example #29
0
        /// <summary>
        ///  获取对象
        /// </summary>
        /// <param name="dbType">数据库类型</param>
        /// <param name="showField">字段</param>
        /// <param name="whereFields">条件字段</param>
        /// <returns>返回Comments表格</returns>
        public object GetObject(DataBaseType dbType, CommentsFields showField, List<CommentsWhereFields> whereFields)
        {
            string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Comments表查询操作/File:CommentsAccess.cs/Fun:GetTopCommentsTable*/";
            StringBuilder sql = new StringBuilder();
            sql.Append(sqlDescription);
            sql.Append("select "+ showField.ToString()+" from ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Comments] with(nolock)");
            SqlParameterWrapperCollection collection = new SqlParameterWrapperCollection();

            if ( whereFields != null && whereFields.Count > 0 )
            {
                sql.Append(" where ");
                sql.Append(GetSqlString(null, whereFields));
            }

            GetSqlParameterWrapperCollection(collection, null, whereFields);
            return SqlHelper.ExecuteScalar(DatabaseManager.GetDataBase(DatabaseManager.Db_JQEBookingConfig,dbType),sql.ToString(),collection);
        }
Example #30
0
 /// <summary>
 /// Admin 添加操作返回主键的编号
 /// </summary>
 /// <param name="admin">Admin实体类</param>
 /// <param name="transaction">事务</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public int AddByIdentity(AdminModel admin,DbTransaction transaction)
 {
     string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:Admin表增加操作/File:AdminAccess.cs/Fun:AddByIdentity*/";
        StringBuilder sql = new StringBuilder();
        sql.Append(sqlDescription);
        sql.Append("insert ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[Admin] (AName,APassword,AEmail,ATelephone,ARowValid,ACreateTime,AScenicId,AUserId,AUserLimit) values(@AName,@APassword,@AEmail,@ATelephone,@ARowValid,@ACreateTime,@AScenicId,@AUserId,@AUserLimit)");
        SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection();
        Collection.Add(new SqlParameterWrapper("@AName", admin.AName,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@APassword", admin.APassword,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@AEmail", admin.AEmail,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@ATelephone", admin.ATelephone,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@ARowValid", admin.ARowValid,SqlDbType.TinyInt));
        Collection.Add(new SqlParameterWrapper("@ACreateTime", admin.ACreateTime,SqlDbType.DateTime));
        Collection.Add(new SqlParameterWrapper("@AScenicId", admin.AScenicId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@AUserId", admin.AUserId,SqlDbType.NVarChar));
        Collection.Add(new SqlParameterWrapper("@AUserLimit", admin.AUserLimit,SqlDbType.TinyInt));
        return SqlHelper.ExecuteIdentity(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction);
 }