public bool AddExcludedProvider(ExcludedProvider excludedProvider) { try { using (IDbConnection db = new SqlConnection(ConfigurationValues.FaxSignedNotesConnection)) { try { const string query = "INSERT INTO [dbo].[ExclusionList]" + "(" + " [FirstName]" + " ,[LastName]" + " ,[GreenwayID]" + " ,[Enabled]" + ")" + "VALUES" + "(" + " @FirstName,@LastName,@GreenwayID,@Enabled" + ")"; int rowsAffectd = db.Execute(query, new { @FirstName = excludedProvider.FirstName, @LastName = excludedProvider.LastName, @GreenwayID = excludedProvider.GreenwayID, @Enabled = excludedProvider.Enabled }); return true; } catch (Exception er) { string s1 = er.ToString(); return false; //Log.LogMessage(er.ToString()); } } } catch (Exception er) { //EmployeeDesktop.API.Exceptions.ExceptionHandling.InsertErrorMessage(er.ToString()); //EmployeeDesktop.API.Exceptions.ExceptionHandling.SendErrorEmail(er.ToString(), ConfigurationValues.EmailFromFriendly, ConfigurationValues.EmailSendToFriendly, ConfigurationValues.EmailSubject); return false; } }
public bool RemoveExcludedProvider(ExcludedProvider excludedProvider) { try { using (IDbConnection db = new SqlConnection(ConfigurationValues.FaxSignedNotesConnection)) { try { const string query = "delete from [ExclusionList]" + " where id = @id"; int rowsAffectd = db.Execute(query, new { @id = excludedProvider.ID }); return true; } catch (Exception er) { string s1 = er.ToString(); return false; //Log.LogMessage(er.ToString()); } } } catch (Exception er) { //EmployeeDesktop.API.Exceptions.ExceptionHandling.InsertErrorMessage(er.ToString()); //EmployeeDesktop.API.Exceptions.ExceptionHandling.SendErrorEmail(er.ToString(), ConfigurationValues.EmailFromFriendly, ConfigurationValues.EmailSendToFriendly, ConfigurationValues.EmailSubject); return false; } }
// DELETE: api/ExcludedProvider/5 public void Delete(ExcludedProvider excludedProvider) { ProviderData providerData = new ProviderData(); providerData.RemoveExcludedProvider(excludedProvider); }