Esempio n. 1
0
        /// <summary>
        ///  获取实体列表
        /// </summary>
        /// <param name="showFields">显示字段</param>
        /// <param name="reader">IDataReader</param>
        /// <returns>返回Remark实体列表</returns>
        public static List<RemarkModel> GetList(List<RemarkFields> showFields, IDataReader reader)
        {
            List< RemarkModel> list = new List< RemarkModel>();
            while ( reader.Read() )
            {
                 RemarkModel remark= new RemarkModel();
                if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, RemarkFields.RId)) && reader["RId"] !=DBNull.Value)
                {
                   remark.RId = Convert.ToInt32(reader["RId"]);
                }

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

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

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

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

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

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

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

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

                  list.Add(remark);
            }
            reader.Close();
            return list;
        }
Esempio n. 2
0
 /// <summary>
 ///Remark 添加操作
 /// </summary>
 /// <param name="remark">Remark实体类</param>
 /// <returns>执行成功返回true,否则为false</returns>
 public bool Add(RemarkModel remark)
 {
     return dataAccess.Add(remark);
 }
Esempio n. 3
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;
 }