public void UpdateCompletionFaxTimePrimary(UpdateCompletedTime upUpdateCompletedTime) { List<ResendFax> resendFaxList = new List<Models.ResendFax>(); if (upUpdateCompletedTime.CompletionTime == "1900-01-01 00:00:00.000") { upUpdateCompletedTime.CompletionTime = string.Empty; } using (IDbConnection db = new SqlConnection(ConfigurationValues.WaldenFaxConnection)) { try { const string query = "update AutomatedFaxesSent" + " set PrimaryCareCompletionTime = @ReferringCareCompletionTime" + " where PrimaryCareSendID = @sendid"; int rowsAffectd = db.Execute(query, new { @ReferringCareCompletionTime = upUpdateCompletedTime.CompletionTime, @sendid = upUpdateCompletedTime.SendID }); } catch (Exception er) { Utility.LogErrors(ConfigurationValues.ErrorLogPath, er.ToString()); } } }
public UpdateCompletedTime GetCompletionTime(string sendID) { UpdateCompletedTime updateCompletedTime = new UpdateCompletedTime(); try { using (IDbConnection db = new SqlConnection(ConfigurationValues.WaldenFaxConnection)) { const string query = "select SendID as SendID ,CompletionTime as CompletionTime from FaxesSendServer" + " where SendID = @SendID"; updateCompletedTime = db.Query<UpdateCompletedTime>(query, new { @SendID = sendID }).Single(); return updateCompletedTime; } } catch (Exception er) { Utility.LogErrors(ConfigurationValues.ErrorLogPath, er.ToString()); return updateCompletedTime; } }