public bool ExceptionExists(int clientID, int businessRuleID, int objectID, int objectTypeID) { bool exists = false; using (RuleExceptionManager repository = new RuleExceptionManager()) { exists = repository.CheckForException(clientID, businessRuleID, objectID, objectTypeID); } return exists; }
public int checkInsertable(int businessruleId, int clientId, int userId, int claimId) { RuleExceptionManager RuleExceptionManagerObj = new RuleExceptionManager(); RuleException RuleExceptionObj = new RuleException(); int insertState = 0; RuleExceptionObj = RuleExceptionManagerObj.GetRuleException(businessruleId, clientId, userId, claimId); try { bool active = Convert.ToBoolean(RuleExceptionObj.IsActive); if (active == false) { insertState = 1; } else { insertState = 2; } } catch (Exception e) { insertState = 0; } return insertState; }
public void sendEmailThread() { var adjusterCount = 0; var supervisorCount = 0; RuleExceptionManager RuleExceptionManagerObj = new RuleExceptionManager(); RuleException RuleExceptionObj = new RuleException(); List<RuleException> RuleExceptionArr = new List<RuleException>(); Globals gvGet = Globals.Instance(); int clientID = Convert.ToInt32(gvGet.getClientId()); RuleExceptionArr = RuleExceptionManagerObj.GetAllException(clientID); for (var i = 0; i < RuleExceptionArr.Count; i++) { int businessRuleId = Convert.ToInt32(RuleExceptionArr[i].BusinessRuleID); if (checkAdjusterSendMail(businessRuleId)) { adjusterCount = adjusterCount + 1; } if (checkSupervisorSendMail(businessRuleId)) { supervisorCount = supervisorCount + 1; } } int[] exceptionListAdjuster = new int[adjusterCount]; int[] formerExceptionListAdjuster = gvGet.getExceptionListAdjuster(); int[] exceptionListSupervisor = new int[supervisorCount]; int[] formerExceptionSupervisor = gvGet.getExceptionListSupervisor(); var j = 0; var k = 0; for (var i = 0; i < RuleExceptionArr.Count; i++) { int businessRuleId = Convert.ToInt32(RuleExceptionArr[i].BusinessRuleID); int userId = Convert.ToInt32(RuleExceptionArr[i].UserID); int claimId = Convert.ToInt32(RuleExceptionArr[i].ObjectID); if (checkAdjusterSendMail(businessRuleId)) { exceptionListAdjuster[j] = RuleExceptionArr[i].RuleExceptionID; bool canAdd = true; for (var q = 0; q < formerExceptionListAdjuster.Length; q++) { if (RuleExceptionArr[i].RuleExceptionID == formerExceptionListAdjuster[q]) { canAdd = false; } } if (canAdd) { adjusterSendMail(businessRuleId, clientID, userId, claimId); } j = j + 1; } if (checkSupervisorSendMail(businessRuleId)) { exceptionListSupervisor[k] = RuleExceptionArr[i].RuleExceptionID; bool canAdd = true; for (var q = 0; q < formerExceptionSupervisor.Length; q++) { if (RuleExceptionArr[i].RuleExceptionID == formerExceptionSupervisor[q]) { canAdd = false; } } if (canAdd) { supervisorSendMail(businessRuleId, clientID, userId, claimId); } k = k + 1; } } gvGet.setExceptionListAdjuster(exceptionListAdjuster); gvGet.setExceptionListSupervisor(exceptionListSupervisor); }
public void insertRuleException(int BusinessRuleId, int clientID, int userID, int claimId) { RuleExceptionManager RuleExceptionManagerObj = new RuleExceptionManager(); RuleException RuleExceptionObj = new RuleException(); RuleExceptionObj.BusinessRuleID = BusinessRuleId; RuleExceptionObj.ClientID = clientID; RuleExceptionObj.UserID = userID; RuleExceptionObj.ObjectID = claimId; RuleExceptionObj.ObjectTypeID = 1; RuleExceptionManagerObj.Save(RuleExceptionObj); }
public void formatExceptions(int clientID, int userID, int claimId) { RuleExceptionManager RuleExceptionManagerObj = new RuleExceptionManager(); RuleExceptionManagerObj.format(clientID, userID, claimId); }
public void updateRuleException(int BusinessRuleId, int clientID, int userID, int claimId) { RuleExceptionManager RuleExceptionManagerObj = new RuleExceptionManager(); RuleExceptionManagerObj.update(BusinessRuleId, clientID, userID, claimId); }
public void AddException(RuleException ruleException) { using (RuleExceptionManager repository = new RuleExceptionManager()) { repository.Save(ruleException); } }
public static string getRuleExceptionStatistics(int clientID) { string json = null; List<RuleExceptionStatisticsView> stats = null; using (RuleExceptionManager repository = new RuleExceptionManager()) { stats = repository.GetExceptionStatistics(clientID); } if (stats != null && stats.Count > 0) { json = Newtonsoft.Json.JsonConvert.SerializeObject(stats); } return json; }
public static string getExceptionsForRule(int clientID, int ruleID) { string encryptedValue = null; string json = null; List<RuleExceptionView> ruleExceptions = null; using (RuleExceptionManager repository = new RuleExceptionManager()) { ruleExceptions = repository.GetByRuleID(clientID, ruleID); } if (ruleExceptions != null && ruleExceptions.Count > 0) { foreach (RuleExceptionView view in ruleExceptions) { if (view.UserID == null) view.UserName = "******"; switch (view.ObjectTypeID) { case (int)Globals.ObjectType.Invoice: Invoice invoice = InvoiceManager.GetByID((int)view.ObjectID); if (invoice != null) { encryptedValue = Core.SecurityManager.EncryptQueryString(view.ObjectID.ToString()); // add link to invoice page view.url = string.Format("<a class='link' href=\"javascript:PopupCenter('../Protected/LeadInvoice.aspx?q={0}');\">Invoice #{1}</a>", encryptedValue, invoice.InvoiceNumber); } break; case (int)Globals.ObjectType.Claim: using (ClaimManager repository = new ClaimManager()) { Claim claim = repository.Get((int)view.ObjectID); if (claim != null) { encryptedValue = Core.SecurityManager.EncryptQueryString(view.ObjectID.ToString()); // add link to claim page view.url = string.Format("<a class='link' href=\"javascript:PopupCenter('../Protected/ClaimEdit.aspx?id={0}');\">{1}</a>", encryptedValue, claim.LeadPolicy.Leads.insuredName); view.InsureClaim = claim.InsurerClaimNumber; Carrier CarrierObj = new Carrier(); if (claim.CarrierID != null) { CarrierObj = CarrierManager.GetByID(Convert.ToInt32(claim.CarrierID)); view.Carrier = CarrierObj.CarrierName; } } } break; default: break; } } } json = Newtonsoft.Json.JsonConvert.SerializeObject(ruleExceptions); return json; }