public bool RemoveParticipatingProvider(ParticipatingProvider participatingProvider) { try { using (IDbConnection db = new SqlConnection(ConfigurationValues.FaxAutomationConnection)) { try { const string query = "delete from [CareProvider]" + " where id = @id"; int rowsAffectd = db.Execute(query, new { @id = participatingProvider.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; } }
public bool AddParticipatingProvider(ParticipatingProvider participatingProvider) { try { using (IDbConnection db = new SqlConnection(ConfigurationValues.FaxAutomationConnection)) { try { const string query = "INSERT INTO [dbo].[CareProvider]" + "(" + " [FirstName]" + " ,[LastName]" + " ,[GreenwayID]" + " ,[Enabled]" + ")" + "VALUES" + "(" + " @FirstName,@LastName,@GreenwayID,@Enabled" + ")"; int rowsAffectd = db.Execute(query, new { @FirstName = participatingProvider.FirstName, @LastName = participatingProvider.LastName, @GreenwayID = participatingProvider.GreenwayID, @Enabled = participatingProvider.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; } }
// DELETE: api/ParticipatingProvider/5 public void Delete(ParticipatingProvider participatingProvider) { ProviderData providerData = new ProviderData(); providerData.RemoveParticipatingProvider(participatingProvider); string s1 = participatingProvider.LastName; }