/// <summary> /// Creates a status history for a claim. Note that if you pass 'null' for newRevisit, it will /// use the old value for the revisit date. /// </summary> /// <param name="newStatus"></param> /// <param name="newRevisit"></param> /// <param name="as_is_flag"></param> internal void CreateStatusHistory(claim_status newStatus, DateTime?newRevisit, bool as_is_flag) { string noteText = string.Empty; claim_status_history csh = new claim_status_history(); csh.claim_id = id; csh.order_id = csh.GetNextOrderID(); csh.user_id = ActiveUser.UserObject.id; csh.date_of_change = DateTime.Now; csh.old_status_id = status_id; if (newStatus == null) { csh.new_status_id = status_id; } else { csh.new_status_id = newStatus.id; } csh.old_revisit_date = revisit_date; if (newRevisit != null) { csh.new_revisit_date = newRevisit; } csh.as_is_flag = as_is_flag; csh.Save(); }
private void UpdateStatusHistory(claim aClaim) { return; // Unknown error occurring here on import (property value empty or invalid - int i id) // TODO: Figure this out! try { claim_status_history csh = new claim_status_history(); csh.claim_id = aClaim.id; csh.order_id = csh.GetNextOrderID(); csh.user_id = C_DentalClaimTracker.Properties.Settings.Default.SystemUserID; csh.date_of_change = DateTime.Now; csh.old_status_id = aClaim.status_id; csh.new_status_id = C_DentalClaimTracker.Properties.Settings.Default.PaymentStatusID; csh.old_revisit_date = aClaim.revisit_date; csh.new_revisit_date = csh.old_revisit_date; csh.as_is_flag = false; csh.Save(); } catch (Exception err) { LoggingHelper.Log("Error in update status history\n" + err.Message, LogSeverity.Critical); throw new Exception("An error occurred creating the status history for this change. Your save should continue as " + "normal, but please notify a system administrator of this error:\n\n" + err.Message); } }
internal void ResetStatus() { claim_status_history csh = new claim_status_history(); csh.claim_id = id; csh.order_id = csh.GetNextOrderID(); csh.user_id = ActiveUser.UserObject.id; csh.date_of_change = DateTime.Now; csh.old_status_id = status_id; csh.new_status_id = -1; csh.as_is_flag = false; csh.Save(); status_id = -1; Save(); }