public Task <bool> InsertInvoiceComments(InvoiceCommentsEntity invoiceCommentsEntity) { string sql = @"INSERT INTO [dbo].[invoice_comments] ([local_authority_id] ,[billing_cycle_id] ,[resident_id] ,[payment_type_id] ,[transaction_amount] ,[comments] ,[updated_by_id]) VALUES (@localauthorityid ,@billingcycleid ,@residentid ,@paymenttypeid ,@transactionamount ,@comments ,@updatedbyid)"; using (IDbConnection conn = new SqlConnection(_connectionString)) { conn.Open(); DynamicParameters dp = new DynamicParameters(); dp.Add("localauthorityid", invoiceCommentsEntity.LocalAuthorityId, DbType.Int32, ParameterDirection.Input); dp.Add("billingcycleid", invoiceCommentsEntity.BillingCycleId, DbType.Int32, ParameterDirection.Input); dp.Add("residentid", invoiceCommentsEntity.ResidentId, DbType.Int32, ParameterDirection.Input); dp.Add("paymenttypeid", invoiceCommentsEntity.PaymentTypeId, DbType.Int32, ParameterDirection.Input); dp.Add("transactionamount", invoiceCommentsEntity.TransactionAmount, DbType.Decimal, ParameterDirection.Input); dp.Add("comments", invoiceCommentsEntity.Comments, DbType.String, ParameterDirection.Input); dp.Add("updatedbyid", invoiceCommentsEntity.UpdatedById, DbType.Int32, ParameterDirection.Input); var result = conn.Execute(sql, dp, commandType: CommandType.Text); } return(Task.FromResult(true)); }
public Task <bool> InsertInvoiceComments(InvoiceCommentsEntity invoiceCommentsEntity) { var user = System.Threading.Thread.CurrentPrincipal as SecurityPrincipal; var updatedById = user.Id; invoiceCommentsEntity.UpdatedById = updatedById; return(_invoiceDataProvider.InsertInvoiceComments(invoiceCommentsEntity)); }
public IHttpActionResult InsertValidationComments([FromBody] InvoiceCommentsEntity invoiceCommentsEntity) { this._invoiceService.InsertInvoiceComments(invoiceCommentsEntity); return(Ok(invoiceCommentsEntity)); }