Beispiel #1
0
        public async Task <IResult> UpdateAsync(NewhouseModel newhouseModel)
        {
            var sql = @"
                        UPDATE [dbo].[Newhouse]
                           SET [BuildName] = @BuildName
                              ,[Info] = @Info
                              ,[HighPinPrice] = @HighPinPrice
                              ,[LowPinPrice] = @LowPinPrice
                              ,[HighPrice] = @HighPrice
                              ,[LowPrice] = @LowPrice
                              ,[County] = @County
                              ,[District] = @District
                              ,[UpdateTime] = @UpdateTime
                         WHERE HID = @HID
                        ";

            using (var conn = this._connectionHelper.House)
            {
                var result = await conn.ExecuteAsync(sql, newhouseModel);

                return(new Result()
                {
                    AffectRow = result,
                    Message = "",
                    Success = true
                });
            }
        }
Beispiel #2
0
        public async Task <IResult> InsertAsync(NewhouseModel newhouseModel)
        {
            var sql = @"
                INSERT INTO [dbo].[Newhouse]
                       ([HID]
                       ,[BuildName]
                       ,[Info]
                       ,[HighPinPrice]
                       ,[LowPinPrice]
                       ,[HighPrice]
                       ,[LowPrice]
                       ,[County]
                       ,[District]
                       ,[UpdateTime])
                 VALUES
                       (@HID
                       ,@BuildName
                       ,@Info
                       ,@HighPinPrice
                       ,@LowPinPrice
                       ,@HighPrice
                       ,@LowPrice
                       ,@County
                       ,@District
                       ,@UpdateTime)";

            using (var conn = this._connectionHelper.House)
            {
                var result = await conn.ExecuteAsync(sql, newhouseModel);

                return(new Result()
                {
                    AffectRow = 1,
                    Message = "",
                    Success = true
                });
            }
        }
 public async Task <IResult> UpdateAsync(NewhouseModel newhouseModel)
 {
     return(await this._newhouseRepository.UpdateAsync(newhouseModel));
 }
 public async Task <IResult> InsertAsync(NewhouseModel newhouseModel)
 {
     return(await this._newhouseRepository.InsertAsync(newhouseModel));
 }