public IHttpActionResult Post(int syncId, [FromBody] DeleteHistory item) { try { using (SqlConnection sqlcon = new SqlConnection(WebCommon.WebConnection)) { sqlcon.Open(); string sSQL = @"WS_FLEM_DeleteRecord"; SqlCommand cmd = new SqlCommand(sSQL, sqlcon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@SyncId", syncId)); cmd.Parameters.Add(new SqlParameter("@TableName", item.TableName)); cmd.Parameters.Add(new SqlParameter("@MatchId", item.MatchId)); cmd.Parameters.Add(new SqlParameter("@CompanyId", item.CompanyId)); cmd.ExecuteNonQuery(); return(Ok()); } } catch (Exception e) { SqlCommon.ReportInfo(e.Message); return(BadRequest(e.Message)); } }
public HistoryCommand(GetHistory getHistory, DeleteHistory deleteHistory, GetHistoryById getHistoryById) { this.getHistory = getHistory; this.deleteHistory = deleteHistory; this.getHistoryById = getHistoryById; Name = "history"; }