Ejemplo n.º 1
0
 /// <summary>
 /// OrderTable 添加操作返回主键的编号
 /// </summary>
 /// <param name="ordertable">OrderTable实体类</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public int AddByIdentity(OrderTableModel ordertable)
 {
     return dataAccess.AddByIdentity(ordertable);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// OrderTable修改操作
 /// </summary>
 /// <param name="oTId">订单表id</param>
 /// <param name="updateModel">要修改OrderTable实体类</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Update(int oTId,OrderTableModel updateModel)
 {
     return dataAccess.Update(oTId,updateModel);
 }
Ejemplo n.º 3
0
 /// <summary>
 ///OrderTable 添加操作
 /// </summary>
 /// <param name="ordertable">OrderTable实体类</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Add(OrderTableModel ordertable)
 {
     return dataAccess.Add(ordertable);
 }
Ejemplo n.º 4
0
 /// <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);
 }
Ejemplo n.º 5
0
        /// <summary>
        ///  获取实体列表
        /// </summary>
        /// <param name="showFields">显示字段</param>
        /// <param name="reader">IDataReader</param>
        /// <returns>返回OrderTable实体列表</returns>
        public static List<OrderTableModel> GetList(List<OrderTableFields> showFields, IDataReader reader)
        {
            List< OrderTableModel> list = new List< OrderTableModel>();
            while ( reader.Read() )
            {
                 OrderTableModel ordertable= new OrderTableModel();
                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTId)) && reader["OTId"] !=DBNull.Value)
                {
                   ordertable.OTId = Convert.ToInt32(reader["OTId"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTOrderSerialNo)) && reader["OTOrderSerialNo"] !=DBNull.Value)
                {
                   ordertable.OTOrderSerialNo = reader["OTOrderSerialNo"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTOrderComfirmNo)) && reader["OTOrderComfirmNo"] !=DBNull.Value)
                {
                   ordertable.OTOrderComfirmNo = reader["OTOrderComfirmNo"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTOrderCreateTime)) && reader["OTOrderCreateTime"] !=DBNull.Value)
                {
                   ordertable.OTOrderCreateTime = Convert.ToDateTime(reader["OTOrderCreateTime"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTTravelTime)) && reader["OTTravelTime"] !=DBNull.Value)
                {
                   ordertable.OTTravelTime = Convert.ToDateTime(reader["OTTravelTime"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTOrderPhone)) && reader["OTOrderPhone"] !=DBNull.Value)
                {
                   ordertable.OTOrderPhone = reader["OTOrderPhone"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTOrderName)) && reader["OTOrderName"] !=DBNull.Value)
                {
                   ordertable.OTOrderName = reader["OTOrderName"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTTicketPhone)) && reader["OTTicketPhone"] !=DBNull.Value)
                {
                   ordertable.OTTicketPhone = reader["OTTicketPhone"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTTicketName)) && reader["OTTicketName"] !=DBNull.Value)
                {
                   ordertable.OTTicketName = reader["OTTicketName"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTTicketNumber)) && reader["OTTicketNumber"] !=DBNull.Value)
                {
                   ordertable.OTTicketNumber = Convert.ToInt32(reader["OTTicketNumber"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTOrderState)) && reader["OTOrderState"] !=DBNull.Value)
                {
                   ordertable.OTOrderState = Convert.ToByte(reader["OTOrderState"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTPayWay)) && reader["OTPayWay"] !=DBNull.Value)
                {
                   ordertable.OTPayWay = Convert.ToByte(reader["OTPayWay"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTTicketPrice)) && reader["OTTicketPrice"] !=DBNull.Value)
                {
                   ordertable.OTTicketPrice = Convert.ToDecimal(reader["OTTicketPrice"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTIdentityCard)) && reader["OTIdentityCard"] !=DBNull.Value)
                {
                   ordertable.OTIdentityCard = reader["OTIdentityCard"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTBrokerage)) && reader["OTBrokerage"] !=DBNull.Value)
                {
                   ordertable.OTBrokerage = Convert.ToDecimal(reader["OTBrokerage"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTTicketTypeId)) && reader["OTTicketTypeId"] !=DBNull.Value)
                {
                   ordertable.OTTicketTypeId = reader["OTTicketTypeId"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTRowValid)) && reader["OTRowValid"] !=DBNull.Value)
                {
                   ordertable.OTRowValid = Convert.ToByte(reader["OTRowValid"]);
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTRemark)) && reader["OTRemark"] !=DBNull.Value)
                {
                   ordertable.OTRemark = reader["OTRemark"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTScenicId)) && reader["OTScenicId"] !=DBNull.Value)
                {
                   ordertable.OTScenicId = reader["OTScenicId"].ToString();
                }

                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, OrderTableFields.OTHaveTicketNumber)) && reader["OTHaveTicketNumber"] !=DBNull.Value)
                {
                   ordertable.OTHaveTicketNumber = Convert.ToInt32(reader["OTHaveTicketNumber"]);
                }

                  list.Add(ordertable);
            }
            reader.Close();
            return list;
        }
Ejemplo n.º 6
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;
 }