Example #1
0
        /// <summary>
        /// 获取通用美容服务码发放记录
        /// </summary>
        /// <param name="packageRecordId"></param>
        /// <returns></returns>
        public async Task <ThirdPartyBeautyPackageRecordModel> GetGeneralBeautyServerCodeSendRecordById(int pkid)
        {
            ThirdPartyBeautyPackageRecordModel result = null;

            try
            {
                result = await _DalGeneralBeautyServerCode.GetGeneralBeautyServerCodeSendRecordById(pkid);
            }
            catch (Exception ex)
            {
                _logger.Error(ex.Message, ex);
            }
            return(result);
        }
       public async Task <ThirdPartyBeautyPackageRecordModel> GetGeneralBeautyServerCodeSendRecordById(int pkid)
       {
           #region SQL
           string sql = @"SELECT TOP  1 [PKID]
     ,[PackageId]
     ,[Phone]
     ,[SerialNumber]
     ,[CreatedDateTime]
     ,[UpdatedDateTime]
     ,[Status]
     ,[UserId]
     ,[OrderId]
 FROM [Tuhu_groupon].[dbo].[ThirdPartyBeautyPackageRecord] WITH(NOLOCK) 
 WHERE PKID=@PKID";
           #endregion
           ThirdPartyBeautyPackageRecordModel result = null;
           using (var conn = new SqlConnection(strConn_OnlyRead))
           {
               var sqlPara = new[]
               {
                   new SqlParameter("PKID", pkid),
               };
               var dateRow = SqlHelper.ExecuteDataRow(conn, CommandType.Text, sql, sqlPara);
               if (dateRow != null)
               {
                   result = new ThirdPartyBeautyPackageRecordModel
                   {
                       PKID            = dateRow.GetValue <Int32>("PKID"),
                       PackageId       = dateRow.GetValue <Guid>("PackageId"),
                       Phone           = dateRow.GetValue <String>("Phone"),
                       SerialNumber    = dateRow.GetValue <String>("SerialNumber"),
                       CreatedDateTime = dateRow.GetValue <DateTime>("CreatedDateTime"),
                       UpdatedDateTime = dateRow.GetValue <DateTime>("UpdatedDateTime"),
                       UserId          = dateRow.GetValue <Guid>("UserId"),
                       OrderId         = dateRow.GetValue <Int32>("OrderId"),
                   }
               }
               ;
           }
           return(await Task.FromResult(result));
       }