예제 #1
0
        /// <summary>
        /// Rule ID 8
        /// </summary>
        /// <param name="claimID"></param>
        /// <param name="expenseID"></param>
        /// <returns></returns>
        public static bool specificExpenseTypePerCarrier(int clientID, int claimID, int expenseID)
        {
            int carrierID = 0;
            bool isRuleMet = false;
            List<BusinessRule> rules = null;
            string[] properties = {"CarrierID", "ExpenseTypeID"};
            string[] values = null;

            // get carrier associated with claim/policy
            using (ClaimManager repository = new ClaimManager()) {
                carrierID = repository.GetCarrier(claimID);
            }

            if (carrierID > 0 && rules != null && rules.Count > 0) {
                // build value array
                values = new string[] { carrierID.ToString(), expenseID.ToString()};

                foreach (BusinessRule rule in rules) {
                    XElement ruleXML = XElement.Parse(rule.RuleXML);

                    isRuleMet = testRule(ruleXML, properties, values);

                    if (isRuleMet) {
                        // add exception to queue
                    }
                }
            }

            return isRuleMet;
        }
예제 #2
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Expression<Func<Claim, bool>> predicate = null;
            List<AdjusterView> adjusters = null;
            List<LeadView> leads = null;

            predicate = buildPredicate();

            using (ClaimManager repository = new ClaimManager()) {
                leads = repository.Search(predicate).orderBy("ClaimantLastName").ToList();
            }

            gvSearchResult.DataSource = leads;
            gvSearchResult.DataBind();

            if (leads != null && leads.Count > 0) {
                pnlResult.Visible = true;
                pnlToolbar.Visible = true;

                // load adjusters
                adjusters = AdjusterManager.GetClaimAssigned(clientID);

                gvAdjusters.DataSource = adjusters;
                gvAdjusters.DataBind();

                CollectionManager.FillCollection(ddlAdjuster, "AdjusterID", "AdjusterName", adjusters);
            }
        }
예제 #3
0
        public List<LeadView> getLeadList()
        {
            List<LeadView> leadArr = new List<LeadView>();

            int myClaimID = SessionHelper.getClaimID();
            var predicate = buildPredicateList();

            using (ClaimManager repository = new ClaimManager())
            {
                leadArr = repository.Search(predicate);
            }

            return leadArr;
        }
        public List<Claim> TestRule(BusinessRule rule)
        {
            //List<BusinessRule> rules = null;
            List<Claim> claims = null;
            int lapsedTime = 0;
            DateTime now = DateTime.Now;

            //// get business rules for client/rule type id
            //using (BusinessRuleManager repository = new BusinessRuleManager()) {
            //	rules = repository.GetBusinessRules(Globals.RuleType.ClaimAssingmentReview);
            //}

            XElement ruleXML = XElement.Parse(rule.RuleXML);

            // get lapse time units: number of hours or days
            int.TryParse(GetElementValue(ruleXML, "LapseTime"), out lapsedTime);

            // get lapse time type: hours or days
            string lapseTimeType = GetElementValue(ruleXML, "LapseTimeType");

            Expression<Func<Claim, bool>> predicate = null;

            // query filters
            predicate = PredicateBuilder.True<CRM.Data.Entities.Claim>();
            //predicate = predicate.And(x => x.LeadPolicy.Lead.ClientID == clientID);			// claims for this client only
            predicate = predicate.And(x => x.IsActive == true);							// active claims
            predicate = predicate.And(x => x.LastStatusUpdate != null);
            predicate = predicate.And(x => x.ProgressStatusID == (int)Globals.ClaimProgressStatus.ClaimAssignedNotAcceptedYet);

            // determine time lapsed
            if (lapseTimeType == "1") {		// hours
                predicate = predicate.And(x => EntityFunctions.DiffHours(x.LastProgressChanged, now) > lapsedTime);
            }
            else if (lapseTimeType == "2") {	// days
                predicate = predicate.And(x => EntityFunctions.DiffDays(x.LastProgressChanged, now) > lapsedTime);
            }

            using (ClaimManager repository = new ClaimManager()) {
                claims = repository.SearchClaim(predicate);
            }

            return claims;
        }
        public RuleException TestRule(int clientID, Claim claim, int expenseTypeID)
        {
            int carrierID = 0;
            bool isRuleMet = false;

            // get carrier associated with claim/policy
            using (ClaimManager repository = new ClaimManager()) {
                carrierID = repository.GetCarrier(claim.ClaimID);
            }

            // get business rules for client/rule type id
            using (BusinessRuleManager repository = new BusinessRuleManager()) {
                rules = repository.GetBusinessRules(clientID, Globals.RuleType.SpecificExpenseTypePerCarrier);
            }

            if (carrierID > 0 && expenseTypeID > 0 && rules != null && rules.Count > 0) {
                // build value array
                values = new string[] { carrierID.ToString(), expenseTypeID.ToString() };

                foreach (BusinessRule rule in rules) {
                    XElement ruleXML = XElement.Parse(rule.RuleXML);

                    isRuleMet = base.TestRule(ruleXML, properties, values);

                    if (isRuleMet) {
                        // add exception to queue
                        ruleException = new RuleException();

                        ruleException.BusinessRuleID = rule.BusinessRuleID;

                        ruleException.ClientID = clientID;

                        ruleException.ObjectID = claim.ClaimID;

                        ruleException.ObjectTypeID = (int)Globals.ObjectType.Claim;

                        break;
                    }
                }
            }

            return ruleException;
        }
예제 #6
0
        protected void gvUserLeads_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            List<LeadView> results = null;

            gvUserLeads.PageIndex = e.NewPageIndex;

            string sortExpression = ViewState["lastSortExpression"] == null ? "ClaimantLastName" : ViewState["lastSortExpression"].ToString();
            bool descending = ViewState["lastSortDirection"] == null ? false : (bool)ViewState["lastSortDirection"];

            Expression<Func<vw_Lead_Search, bool>> predicate = buildPredicate();

            using (ClaimManager repository = new ClaimManager())
            {
                results = repository.Search(predicate, sortExpression, descending);
            }

            gvUserLeads.DataSource = results;
            gvUserLeads.DataBind();
        }
        public static string SaveNotes(int claimID, string serviceQty, string serviceDate, string descp, string invoiceServiceType, int invoiceServiceTypeId, string serviceAdjuster, string serviceAdjustId, int leadID, string emailTo)
        {
            string json = "";
            ClaimService claimService = null;
            ClaimComment diary = null;
            Leads objLeads = null;
            Claim objClaim = null;
            int userID = SessionHelper.getUserId();

            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (ClaimServiceManager repository = new ClaimServiceManager())
                    {
                        claimService = new ClaimService();
                        claimService.ClaimID = claimID;

                        claimService.ServiceQty = serviceQty == null ? 0 : Convert.ToDecimal(serviceQty);
                        claimService.ServiceDate = Convert.ToDateTime(serviceDate);
                        claimService.ServiceDescription = descp.Trim();
                        claimService.ServiceTypeID = Convert.ToInt32(invoiceServiceTypeId);
                        claimService.UserID = userID;
                        claimService.AdjusterID = Convert.ToInt32(serviceAdjustId);

                        claimService = repository.Save(claimService);
                    }

                    // diary
                    diary = new ClaimComment();
                    diary.ClaimID = claimID;
                    diary.CommentDate = DateTime.Now;
                    diary.UserId = userID;
                    diary.ActivityType = "Service: " + invoiceServiceType;
                    diary.CommentText = string.Format("Description: {0}, Date {1:MM/dd/yyyy h:mm}, Qty: {2:N2}, Adjuster: {3}",
                                                claimService.ServiceDescription,
                                                claimService.ServiceDate,
                                                claimService.ServiceQty,
                                                serviceAdjuster
                                                );
                    ClaimCommentManager.Save(diary);

                    scope.Complete();
                    //  SendNoteEmail();
                }
                objLeads = LeadsManager.GetByLeadId(leadID);
                ClaimManager objClaimManager = new ClaimManager();
                objClaim = objClaimManager.Get(claimID);
                string insuerFileId = objClaim.InsurerClaimNumber;
                string insurerName = objLeads.InsuredName;
                string claimNumber = objClaim.AdjusterClaimNumber;
                string userName = SessionHelper.getUserName();
                SendNoteEmail(insuerFileId, insurerName, claimNumber, serviceAdjuster, descp.Trim(), userName, emailTo, serviceDate, serviceQty);

                json = "Service save successfully";

            }
            catch (Exception ex)
            {
                Core.EmailHelper.emailError(ex);
            }

            return json;
        }
예제 #8
0
        public int getProgressId(int claimId)
        {
            int progress = 0;
            ClaimManager ClaimManagerobj = new ClaimManager();
            Claim claimObj = new Claim();
            claimObj = ClaimManagerobj.Get(claimId);

            if (claimObj.ProgressStatusID != null)
            {
                progress = Convert.ToInt32(claimObj.ProgressStatusID);

            }
            else
            {
                progress = 0;

            }

            return progress;
        }
예제 #9
0
        protected void fillClaimStatusReview(int clientd)
        {
            ClaimManager objClaimManager = new ClaimManager();
            List<Carrier> objCarrier = new List<Carrier>();
            objCarrier = objClaimManager.GetAllCarrier(clientd);
            if (objCarrier != null)
            {
                CollectionManager.FillCollection(ddlClaimCarrier, "CarrierID", "CarrierName", objCarrier);
            }

            List<ContactList> objContactlist = new List<ContactList>() ;

             List<Contact> listContact= ContactManager.GetAll(clientd).ToList();

             ContactList objcontact1;
             foreach (Contact data in listContact)
             {
                 objcontact1 = new ContactList();
                 objcontact1.ContactID = data.ContactID;
                 objcontact1.FirstName = data.FirstName;
                 objcontact1.LastName = data.LastName;
                 objcontact1.Email = data.Email;
                 objcontact1.CompanyName = data.CompanyName;
                 objcontact1.IdOf = "c";
                 objContactlist.Add(objcontact1);
             }
             List<AdjusterMaster> listAdjuster = CRM.Data.Account.AdjusterManager.GetAll(clientd).ToList();
            foreach (AdjusterMaster data in listAdjuster)
            {
                objcontact1 = new ContactList();
                objcontact1.ContactID = data.AdjusterId;
                objcontact1.FirstName = data.FirstName;
                objcontact1.LastName = data.LastName;
                objcontact1.Email = data.email;
                objcontact1.CompanyName = data.CompanyName;
                objcontact1.IdOf = "a";
                objContactlist.Add(objcontact1);
            }
            gvSelectRecipients.DataSource = objContactlist.AsQueryable();
               gvSelectRecipients.DataBind();
        }
        protected void gvLimits2_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int limitID = Convert.ToInt32(e.CommandArgument);
            int policyId = Convert.ToInt32(Session["policyID"].ToString());
            ClaimManager objClaimManager = new ClaimManager();

            using (TransactionScope scope = new TransactionScope())
            {
                List<Claim> lstClaim = objClaimManager.GetPolicyClaim(policyId);
                foreach (var claim in lstClaim)
                {
                    int claimId = claim.ClaimID;
                    ClaimLimitManager.EditModeDeleteClaimLimit(limitID, claimId);
                }
                PolicyLimitManager.EditModeDeletePolicyLimit(limitID);
                LimitManager.EditModeDeleteLimit(limitID);
                scope.Complete();
            }
            Response.Redirect(Request.RawUrl);
            bindData(policyId);
        }
예제 #11
0
        protected void btnShowLossTemplate_Click(object sender, EventArgs e)
        {
            //int policyId = 0;

            ClaimManager objClaimManager = new ClaimManager();
            int policyId = Convert.ToInt32(hdnPolicyIdDetuctible.Value);

               List<Claim> lstClaim  =objClaimManager.GetPolicyClaim(policyId);

            using (TransactionScope scope = new TransactionScope())
            {
                //delete all claim from claim limit
                foreach (var claim in lstClaim)
                {
                    int claimId = claim.ClaimID;
                    ClaimLimitManager.IsDeleted(claimId);
                }

                // delete limit,claimlimit,policylimit data which enter as loss details
                LimitManager.DeletePolicyLimit( policyId);

                //first get all limit
                List<Limit> objLimit = LimitManager.GetAllLimit(true);

                foreach (var limit in objLimit)
                {
                    //enter in
                    PolicyLimit objPolicyLimit = new PolicyLimit();
                    objPolicyLimit.PolicyID = policyId;
                    objPolicyLimit.LimitID = limit.LimitID;
                    PolicyLimitManager.Save(objPolicyLimit);

                }

                //code for enter in all claim in claim limit
                foreach (var claim in lstClaim)
                {
                    foreach (var limit in objLimit)
                    {
                        ClaimLimit objClaimLimit = new ClaimLimit();
                        objClaimLimit.ClaimID = claim.ClaimID;
                        objClaimLimit.LimitID = limit.LimitID;
                        ClaimLimitManager.Save(objClaimLimit);
                    }

                }

                scope.Complete();
            }

            acrossAllCoverages.Enabled = true;
            coverageSpecific.Enabled = true;
            txtDeductible.Enabled = true;

            propertyLimits.bindData(policyId);
            //casualtyLimits.bindData(policyId);
        }
        public static string SaveClaimStatus(int claimStatus, string insurerClaimId, string insurerName, int claimAdjusterId, string adjusterComapnyName, string updatedby, string commentNote, string emailTo, int carrierID, int claimID, string recipientId, string claimAdjuster, string claimStatusName, string carrier, string idOf)
        {
            string json = "";
            Claim objclaim = null;
            AdjusterMaster objAdjusterMaster = null;
            Leads objLeads = null;
            CRM.Data.Entities.LeadPolicy objLeadPolicy = null;
            ClaimComment comment = null;
            Client objClient = null;
            int userID = SessionHelper.getUserId();
            int leadID = 0;
            int policyId = 0;
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (ClaimManager repository = new ClaimManager())
                    {
                        objclaim = new Claim();
                        objclaim.ClaimID = claimID;
                        objclaim.StatusID = claimStatus;
                        objclaim.InsurerClaimNumber = insurerClaimId;
                        //objclaim.CarrierID = carrierID;
                        objclaim.AdjusterID = claimAdjusterId;
                        objclaim.StatusUpdatedBy = updatedby;
                        objclaim.StatusCommentNote = commentNote;
                        //objclaim.StatusEmailTo = EmailTo;
                        repository.UpdateClaimStatus(objclaim);

                        // AdjusterMaster
                        objAdjusterMaster = new AdjusterMaster();
                        objAdjusterMaster.AdjusterId = claimAdjusterId;
                        //objAdjusterMaster.CompanyName = AdjusterComapnyName;
                        repository.UpdateAdjusterName(objAdjusterMaster);

                        //leads
                        leadID = repository.GetPolicyId(claimID);
                        objLeads = new Leads();
                        objLeads.LeadId = leadID;
                        objLeads.InsuredName = insurerName;
                        repository.UpdateInsurerName(objLeads);
                        //save carrier id in Lead policy
                        policyId = repository.GetLeadPolicyId(claimID);
                        objLeadPolicy = new Data.Entities.LeadPolicy();
                        objLeadPolicy.Id = policyId;
                        objLeadPolicy.CarrierID = carrierID;
                        repository.UpdateCarrierId(objLeadPolicy);
                        //claim comment for add notes
                        comment = new ClaimComment();
                        comment.ClaimID = claimID;
                        comment.IsActive = true;
                        comment.UserId = Core.SessionHelper.getUserId();
                        comment.CommentDate = DateTime.Now;
                        comment.ActivityType = "Status Changed";
                        comment.CommentText = commentNote.Trim();
                        ClaimCommentManager.Save(comment);

                        //client company name
                        //Client c = ClaimsManager.GetClientByUserId(SessionHelper.getUserId());
                        //c.BusinessName = AdjusterComapnyName;
                        //ClaimsManager.SaveClient(c);

                    }
                    scope.Complete();
                }
                string[] recipId = recipientId.Split(',');
                string recipientEmailId = string.Empty;

                string[] idofTable = idOf.Split(',');
                int index2 = 0;
                for (int index = 0; index < recipId.Length; index++)
                {
                    index2 = 0;
                    int.TryParse(recipId[index], out index2);
                    if (idofTable[index] == "c")
                    {

                        Contact objContact = ContactManager.Get(index2);
                        if (!string.IsNullOrEmpty(objContact.Email))
                        {
                            if (recipientEmailId == "")
                            {
                                recipientEmailId = objContact.Email;
                            }
                            else
                            {
                                recipientEmailId = recipientEmailId + "," + objContact.Email;
                            }
                        }
                    }
                    else
                    {

                        AdjusterMaster objAdjuster = AdjusterManager.GetAdjusterId(index2);

                        if (!string.IsNullOrEmpty(objAdjuster.email))
                        {
                            if (recipientEmailId == "")
                            {
                                recipientEmailId = objAdjuster.email;
                            }
                            else
                            {
                                recipientEmailId = recipientEmailId + "," + objAdjuster.email;
                            }
                        }

                    }
                }
                if (!string.IsNullOrEmpty(recipientEmailId))
                {
                    notifyUser(claimStatus, insurerClaimId, insurerName, claimAdjusterId, adjusterComapnyName, updatedby, commentNote, "", carrierID, claimID, recipientEmailId, claimAdjuster, claimStatusName, carrier, recipId, idofTable);
                }
                json = "Status save successfully";

            }
            catch (Exception ex)
            {
                Core.EmailHelper.emailError(ex);
            }

            return json;
        }
        public static string SaveClaimExpense(string expenseType, string insurerClaimId, string insurerName, int claimAdjusterId, string adjusterComapnyName, string updatedby, string commentNote, string emailTo, int carrierID, int claimID, string recipientId, string claimAdjuster, string expenseTypeName, string carrier, string idOf, string expenseQty, string expenseAmount, string expenseDate, string reimbrance)
        {
            string json = "";
            Claim objclaim = null;
            AdjusterMaster objAdjusterMaster = null;
            Leads objLeads = null;
            ClaimComment comment = null;
            ClaimExpense claimExpense = null;
            CRM.Data.Entities.LeadPolicy objLeadPolicy = null;
            int userID = SessionHelper.getUserId();
            int leadID = 0;
            int policyId = 0;
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (ClaimManager repository = new ClaimManager())
                    {
                        objclaim = new Claim();
                        objclaim.ClaimID = claimID;

                        objclaim.InsurerClaimNumber = insurerClaimId;
                        //objclaim.CarrierID = carrierID;
                        objclaim.AdjusterID = claimAdjusterId;
                        // objclaim.StatusUpdatedBy = updatedby;
                        repository.UpdateClaimStatus(objclaim);

                        // AdjusterMaster
                        objAdjusterMaster = new AdjusterMaster();
                        objAdjusterMaster.AdjusterId = claimAdjusterId;
                        //objAdjusterMaster.CompanyName = AdjusterComapnyName;
                        repository.UpdateAdjusterName(objAdjusterMaster);

                        //leads
                        leadID = repository.GetPolicyId(claimID);
                        objLeads = new Leads();
                        objLeads.LeadId = leadID;
                        objLeads.InsuredName = insurerName;
                        repository.UpdateInsurerName(objLeads);
                        //save carrier id in Lead policy
                        policyId = repository.GetLeadPolicyId(claimID);
                        objLeadPolicy = new Data.Entities.LeadPolicy();
                        objLeadPolicy.Id = policyId;
                        objLeadPolicy.CarrierID = carrierID;
                        repository.UpdateCarrierId(objLeadPolicy);

                        //add expense
                        ClaimExpenseManager objClaimExpenseManager = new ClaimExpenseManager();
                        claimExpense = new ClaimExpense();
                        claimExpense.ClaimID = claimID;
                        if (!string.IsNullOrEmpty(expenseAmount))
                        {
                            claimExpense.ExpenseAmount = Convert.ToDecimal(expenseAmount);
                        }
                        if (!string.IsNullOrEmpty(expenseDate))
                        {
                            claimExpense.ExpenseDate = Convert.ToDateTime(expenseDate);
                        }
                        claimExpense.ExpenseDescription = commentNote.Trim();
                        claimExpense.ExpenseTypeID = Convert.ToInt32(expenseType);
                        if (reimbrance == "1")
                        {
                            claimExpense.IsReimbursable = true;
                        }
                        else
                        {
                            claimExpense.IsReimbursable = false;
                        }

                        claimExpense.UserID = userID;
                        claimExpense.AdjusterID = Convert.ToInt32(claimAdjusterId);
                        if (!string.IsNullOrEmpty(expenseQty))
                        {
                            claimExpense.ExpenseQty = Convert.ToDecimal(expenseQty);
                        }
                        objClaimExpenseManager.Save(claimExpense);

                        //claim comment for add notes
                        comment = new ClaimComment();
                        comment.ClaimID = claimID;
                        comment.IsActive = true;
                        comment.UserId = Core.SessionHelper.getUserId();
                        comment.CommentDate = DateTime.Now;
                        comment.ActivityType = "Add Expense";
                        comment.CommentText = string.Format("Expense: {0}, Description: {1}, Date: {2:MM/dd/yyyy}, Amount: {3:N2}, Adjuster: {4} Qty: {5:N2}",
                                                 expenseTypeName,
                                                 commentNote.Trim(),
                                                 Convert.ToDateTime(expenseDate),
                                                 expenseAmount,
                                                 claimAdjuster,
                                                 expenseQty
                                                 );
                        ClaimCommentManager.Save(comment);

                    }
                    scope.Complete();
                }
                string[] recipId = recipientId.Split(',');
                string recipientEmailId = string.Empty;

                string[] IdofTable = idOf.Split(',');
                int index2 = 0;
                for (int index = 0; index < recipId.Length; index++)
                {
                    index2 = 0;
                    int.TryParse(recipId[index], out index2);
                    if (IdofTable[index] == "c")
                    {

                        Contact objContact = ContactManager.Get(index2);
                        if (!string.IsNullOrEmpty(objContact.Email))
                        {
                            if (recipientEmailId == "")
                            {
                                recipientEmailId = objContact.Email;
                            }
                            else
                            {
                                recipientEmailId = recipientEmailId + "," + objContact.Email;
                            }
                        }
                    }
                    else
                    {

                        AdjusterMaster objAdjuster = AdjusterManager.GetAdjusterId(index2);

                        if (!string.IsNullOrEmpty(objAdjuster.email))
                        {
                            if (recipientEmailId == "")
                            {
                                recipientEmailId = objAdjuster.email;
                            }
                            else
                            {
                                recipientEmailId = recipientEmailId + "," + objAdjuster.email;
                            }
                        }

                    }
                }
                SendExpenseEmail(expenseType, insurerClaimId, insurerName, claimAdjusterId, adjusterComapnyName, updatedby, commentNote, "", carrierID, claimID, recipientEmailId, claimAdjuster, expenseTypeName, carrier, recipId, IdofTable, expenseQty, expenseAmount, expenseDate, reimbrance);
                json = "Expense add successfully";

            }
            catch (Exception ex)
            {
                Core.EmailHelper.emailError(ex);
            }

            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;
        }
        public static string getClaimForProgress(int clientID, int progressID, int carrierid, int adjusterid)
        {
            string json = null;
            List<ClaimProgressData> claims = null;
            string encryptedClaimID = null;

            using (ClaimManager repository = new ClaimManager())
            {
                claims = repository.GetByProgressID(clientID, progressID, carrierid, adjusterid);
            }

            // add link to claim page
            if (claims != null && claims.Count > 0)
            {
                foreach (ClaimProgressData claim in claims)
                {
                    encryptedClaimID = Core.SecurityManager.EncryptQueryString(claim.claimID.ToString());

                    claim.url = string.Format("<a href=\"javascript:PopupCenter('../Protected/ClaimEdit.aspx?q={0}');\">View</a>", encryptedClaimID);
                }

            }

            //ComputerBeacon.Json.Serializer.Serialize(leads);

            json = Newtonsoft.Json.JsonConvert.SerializeObject(claims);

            return json;
        }
예제 #16
0
        protected void gvUserLeads_Sorting(object sender, GridViewSortEventArgs e)
        {
            List<LeadView> results = null;
            bool descending = false;

            if (ViewState[e.SortExpression] == null)
                descending = false;
            else
                descending = !(bool)ViewState[e.SortExpression];

            ViewState[e.SortExpression] = descending;

            ViewState["lastSortExpression"] = e.SortExpression;
            ViewState["lastSortDirection"] = descending;

            Expression<Func<vw_Lead_Search, bool>> predicate = buildPredicate();

            using (ClaimManager repository = new ClaimManager())
            {
                results = repository.Search(predicate, e.SortExpression, descending);
            }

            gvUserLeads.DataSource = results;
            gvUserLeads.DataBind();
        }
예제 #17
0
        protected void btnSaveClaimService_Click(object sender, EventArgs e)
        {
            ClaimService claimService = null;
            ClaimComment diary = null;
            AdjusterMaster adjuster = null;
            Claim myClaim = null;
            CarrierInvoiceProfile CarrierInvoice = null;

            int userID = SessionHelper.getUserId();
            int claimID = SessionHelper.getClaimID();
            int id = 0;
            int myAdjusterID = 0;
            int profileID = 0;

            Page.Validate("service");
            if (!Page.IsValid)
                return;

            id = Convert.ToInt32(ViewState["ClaimServiceID"]);

            //Get current claim info to pass through to emails
            ClaimManager cm = new ClaimManager();
            myClaim =  cm.Get(claimID);

            //AdjusterManager

            try {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (ClaimServiceManager repository = new ClaimServiceManager())
                    {
                        if (id == 0)
                        {
                            claimService = new ClaimService();
                            claimService.ClaimID = claimID;
                        }
                        else
                        {
                            claimService = repository.Get(id);
                        }

                        claimService.ServiceQty = this.txtServiceQty.Value == null ? 0 : Convert.ToDecimal(txtServiceQty.Value);
                        claimService.ServiceDate = txtServiceDate.Date;
                        claimService.ServiceDescription = txtServiceDescription.Text.Trim();
                        claimService.ServiceTypeID = Convert.ToInt32(this.ddlInvoiceServiceType.SelectedValue);
                        claimService.UserID = userID;
                        claimService.AdjusterID = Convert.ToInt32(hf_serviceAdjusterID.Value);
                        claimService.Activity = ddlActivity.SelectedItem.Text;
                        claimService.InternalComments = txtMyComments.Text.Trim();
                        claimService.IsBillable = cbIsBillable.Checked;
                        claimService.Billed = false;
                        //save to db
                        claimService = repository.Save(claimService);

                        //string EmailService = ddlInvoiceServiceType.SelectedItem.Text;
                        //string EmailActivity = ddlActivity.SelectedItem.Text;
                        //string EmailDescription = txtServiceDescription.Text;
                        //string EmailInternal = txtMyComments.Text;
                        //string EmailQuantity = txtServiceQty.Text;
                        //string EmailDate = txtServiceDate.Text;

                    }

                    // diary
                    diary = new ClaimComment();
                    diary.ClaimID = claimID;
                    diary.CommentDate = DateTime.Now;
                    diary.UserId = userID;
                    diary.ActivityType = ddlActivity.SelectedItem.Text;
                    diary.InternalComments = txtMyComments.Text.Trim();
                    diary.CommentText = string.Format("Service: {0}, Description: {1}, Date {2:MM/dd/yyyy}, Qty: {3:N2}, Adjuster: {4}",
                                                ddlInvoiceServiceType.SelectedItem.Text,
                                                claimService.ServiceDescription,
                                                claimService.ServiceDate,
                                                claimService.ServiceQty,
                                                txtServiceAdjuster.Text
                                                );
                    ClaimCommentManager.Save(diary);

                    myAdjusterID = Convert.ToInt32(claimService.AdjusterID); //Convert.ToInt32(myClaim.AdjusterID);

                    //EMAIL ADJUSTER OC 10/21/2014
                    if (myAdjusterID != 0 || myAdjusterID != null)
                    {
                        adjuster = AdjusterManager.GetAdjusterId(myAdjusterID);
                    }
                    if (cbEmailAdjuster.Checked == true)
                    {
                        try
                        {
                            notifyAdjuster(adjuster, claimService, myClaim);
                        }
                        catch (Exception ex)
                        {
                            lblMessage.Text = "Unable to send email to adjuster";
                            lblMessage.CssClass = "error";
                        }
                    }
                    //EMAIL CLIENT CONTACT OC 10/22/2014
                    if (cbEmailClient.Checked == true) //Dont need to check if invoice Pro ID is empty becuase to get to this point, one has to exist already
                    {
                        if (Session["ComingFromAllClaims"] != null) //if the user got here straight from the all claims screen
                        {
                            profileID = Convert.ToInt32(Session["CarrierInvoiceID"]);
                        }
                        else//coming from claim detail page
                        {
                            profileID = Convert.ToInt32(Session["InvoiceProfileID"]);
                        }
                        CarrierInvoice = CarrierInvoiceProfileManager.Get(profileID);
                        try
                        {
                            notifyClientContact(CarrierInvoice, claimService, myClaim, adjuster);
                        }
                        catch (Exception ex)
                        {
                            lblMessage.Text = "Unable to send email to client contact";
                            lblMessage.CssClass = "error";
                        }

                    }
                    //EMAIL TO WHOMEVER
                    if(txtEmailTo.Text != "")
                    {

                        try
                        {
                            notifySpecifiedUser(adjuster, claimService, myClaim);
                        }
                        catch (Exception ex)
                        {
                            lblMessage.Text = "Unable to send email to adjuster";
                            lblMessage.CssClass = "error";
                        }
                    }

                    scope.Complete();

                }

                lblMessage.Text = "Service was saved successfully.";
                lblMessage.CssClass = "ok";

                // keep edit form active
                lbtnNewClaimService_Click(null, null);

                // refresh grid
                gvClaimService.DataSource = loadClaimServices(claimID);
                gvClaimService.DataBind();

            }
            catch (Exception ex)
            {
                Core.EmailHelper.emailError(ex);

                lblMessage.Text = "Unable to save claim service.";
                lblMessage.CssClass = "error";
            }
            //send email to adjuster
        }
예제 #18
0
        protected void btnSaveExpense_Click(object sender, EventArgs e)
        {
            Claim claim = null;
            Claim myClaim = null;
            ClaimExpense claimExpense = null;
            AdjusterMaster adjuster = null;
            CarrierInvoiceProfile CarrierInvoice = null;

            int clientID = SessionHelper.getClientId();
            int userID = SessionHelper.getUserId();
            int claimID = SessionHelper.getClaimID();
            int myAdjusterID = 0;
            int profileID = 0;
            int expenseTypeID = 0;
            int id = 0;

            Page.Validate("expense");
            if (!Page.IsValid)
                return;

            id = Convert.ToInt32(ViewState["ClaimExpenseID"]);

            ClaimManager cm = new ClaimManager();
            myClaim = cm.Get(claimID);

            try
            {
                expenseTypeID = Convert.ToInt32(ddlExpenseType.SelectedValue);

                using (TransactionScope scope = new TransactionScope())
                {
                    using (ClaimExpenseManager repository = new ClaimExpenseManager())
                    {
                        if (id == 0) {
                            claimExpense = new ClaimExpense();
                            claimExpense.ClaimID = claimID;
                        }
                        else {
                            claimExpense = repository.Get(id);
                        }

                        // populate fields
                        if(txtExpenseAmount.Visible == false)
                        {
                            var x = Session["multiplier"].ToString();

                            double expenseAmount = Convert.ToDouble(x) * Convert.ToDouble(txtExpenseQty.ValueDecimal); //newOC 10/7/14
                            claimExpense.ExpenseAmount = Convert.ToDecimal(expenseAmount);

                            decimal d = Convert.ToDecimal(expenseAmount);
                            //Session["EmailAmount"] = "$" + Math.Round(d, 2);
                            Session["EmailAmount"] = String.Format("{0:0.00}", expenseAmount);
                           // Session["EmailAmount"] = expenseAmount;
                        }
                        else
                        {
                            claimExpense.ExpenseAmount = txtExpenseAmount.ValueDecimal;
                        }
                        claimExpense.ExpenseDate = txtExpenseDate.Date;
                        claimExpense.ExpenseDescription = txtExpenseDescription.Text.Trim();
                        claimExpense.ExpenseTypeID = expenseTypeID;
                        claimExpense.IsReimbursable = cbxExpenseReimburse.Checked;
                        claimExpense.UserID = userID;
                        claimExpense.AdjusterID = Convert.ToInt32(hf_expenseAdjusterID.Value);
                        claimExpense.ExpenseQty = txtExpenseQty.ValueDecimal;
                        claimExpense.InternalComments = txtMyComments.Text.Trim();
                        claimExpense.Billed = false;
                       // claimExpense.IsBillable = cbIsBillable.Checked;
                        // save expense
                        claimExpense = repository.Save(claimExpense);
                    }

                    // update diary entry
                    ClaimComment diary = new ClaimComment();
                    diary.ClaimID = claimID;
                    diary.CommentDate = DateTime.Now;
                    diary.UserId = userID;
                    diary.CommentText = string.Format("Expense: {0}, Description: {1}, Date: {2:MM/dd/yyyy}, Amount: {3:N2}, Adjuster: {4} Qty: {5:N2}",
                                                ddlExpenseType.SelectedItem.Text,
                                                claimExpense.ExpenseDescription,
                                                claimExpense.ExpenseDate,
                                                claimExpense.ExpenseAmount,
                                                txtExpenseAdjuster.Text,
                                                claimExpense.ExpenseQty
                                                );
                    ClaimCommentManager.Save(diary);

                    // 2014-05-02 apply rule
                    using (SpecificExpenseTypePerCarrier ruleEngine = new SpecificExpenseTypePerCarrier())
                    {
                        claim = new Claim();
                        claim.ClaimID = claimID;
                        RuleException ruleException = ruleEngine.TestRule(clientID, claim, expenseTypeID);

                        if (ruleException != null) {
                            ruleException.UserID = Core.SessionHelper.getUserId();
                            ruleEngine.AddException(ruleException);
                            CheckSendMail(ruleException);
                        }
                    }
                    myAdjusterID = Convert.ToInt32(claimExpense.AdjusterID); //Convert.ToInt32(myClaim.AdjusterID);
                    //EMAIL ADJUSTER OC 10/22/2014
                    if (myAdjusterID != 0 || myAdjusterID != null)
                    {
                        adjuster = AdjusterManager.GetAdjusterId(myAdjusterID);
                    }
                    if (cbEmailAdjuster.Checked == true)
                    {
                        try
                        {
                            notifyAdjuster(adjuster, claimExpense, myClaim);

                        }
                        catch (Exception ex)
                        {
                            lblMessage.Text = "Unable to send email to adjuster";
                            lblMessage.CssClass = "error";
                        }
                    }
                    //EMAIL CLIENT CONTACT OC 10/22/2014
                    if (cbEmailClient.Checked == true) //Dont need to check if invoice Pro ID is empty becuase to get to this point, one has to exist already
                    {
                        if (Session["ComingFromAllClaims"] != null) //if the user got here straight from the all claims screen
                        {
                            profileID = Convert.ToInt32(Session["CarrierInvoiceID"]);
                        }
                        else//coming from claim detail page
                        {
                            profileID = Convert.ToInt32(Session["InvoiceProfileID"]);
                        }
                        CarrierInvoice = CarrierInvoiceProfileManager.Get(profileID);
                        try
                        {
                              notifyClientContact(CarrierInvoice, claimExpense, myClaim, adjuster);
                        }
                        catch (Exception ex)
                        {
                            lblMessage.Text = "Unable to send email to client contact";
                            lblMessage.CssClass = "error";
                        }

                    }
                    //EMAIL TO WHOMEVER OC 10/22/2014
                    if (txtEmailTo.Text != "")
                    {

                        try
                        {
                             notifySpecifiedUser(adjuster, claimExpense, myClaim);
                        }
                        catch (Exception ex)
                        {
                            lblMessage.Text = "Unable to send email to adjuster";
                            lblMessage.CssClass = "error";
                        }
                    }

                    // complete transaction
                    scope.Complete();
                }

                lblMessage.Text = "Expense saved successfully.";
                lblMessage.CssClass = "ok";

                // refresh grid
                gvExpense.DataSource = loadExpenses(claimID);
                gvExpense.DataBind();

                // keep edit form active
                lbtnNewExpense_Click(null, null);
                lblAmount.Text = "";
                lblAmount.Visible = false;
                txtExpenseAmount.Visible = true;
            }
            catch (Exception ex) {
                Core.EmailHelper.emailError(ex);

                lblMessage.Text = "Unable to save claim expense.";
                lblMessage.CssClass = "error";
            }
        }
예제 #19
0
        protected void btnShowLossTemplate_Click(object sender, EventArgs e)
        {
            int policyId = 0;
            Claim objClaim = null;
            ClaimManager objClaimManager = new ClaimManager();
            int claimId = Convert.ToInt32(hf_ClaimIdForStatus.Value);
            using (TransactionScope scope = new TransactionScope())
            {

                objClaim = objClaimManager.Get(claimID);
                policyId = objClaim.PolicyID;

                // delete limit,claimlimit,policylimit data which enter as loss details
                LimitManager.DeleteLimit(claimId, policyId);

                //ClaimLimitManager.IsDeleted(claimId);
                // PolicyLimitManager.IsDeleted(policyId);

                //enter claim limit and policy limit
                //first get all limit
                List<Limit> objLimit = LimitManager.GetAllLimit(true);

                foreach (var limit in objLimit)
                {
                    ClaimLimit objClaimLimit = new ClaimLimit();
                    objClaimLimit.ClaimID = claimId;
                    objClaimLimit.LimitID = limit.LimitID;
                    ClaimLimitManager.Save(objClaimLimit);

                    PolicyLimit objPolicyLimit = new PolicyLimit();
                    objPolicyLimit.PolicyID = policyId;
                    objPolicyLimit.LimitID = limit.LimitID;
                    PolicyLimitManager.Save(objPolicyLimit);
                }

                Data.Entities.LeadPolicy objLeadPolicy = new Data.Entities.LeadPolicy();
                objLeadPolicy.Id = policyId;
                objLeadPolicy.ApplyAcrossAllCoverage = false;
                objLeadPolicy.ApplyDeductibleSet = false;
                LeadPolicyManager.Update(objLeadPolicy);
                scope.Complete();
            }

            //acrossAllCoverages.Enabled = true;
            //coverageSpecific.Enabled = true;
            txtDeductible.Enabled = true;

            propertyLimits.bindData(policyID);

               // casualtyLimits.bindData(claimId);
        }
        protected void bindData()
        {
            int claimID = 0;
            int clientID = 0;
            int policyID = 0;
            Claim claim = null;

            Leads lead = null;

            // get id for current lead
            claimID = Core.SessionHelper.getClaimID();

            // get client id
            clientID = Core.SessionHelper.getClientId();

            // get current policy
            policyID = Core.SessionHelper.getPolicyID();

            using (ClaimManager repository = new ClaimManager()) {
                claim = repository.Get(claimID);
            }
            if (claim == null)
                return;

            // get lead/claim
            lead = claim.LeadPolicy.Leads;

            if (claim.LeadPolicy != null && claim.LeadPolicy.LeadPolicyType != null) {
                // get policy type
                lblPolicyType.Text = claim.LeadPolicy.LeadPolicyType.Description;
            }

            if (claim.LeadPolicy != null && claim.LeadPolicy != null) {
                // get policy number
                lblPolicyNumber.Text = claim.LeadPolicy.PolicyNumber;
            }

            // get insurer claim number
            lblInsurerClaimNumber.Text = claim.InsurerClaimNumber;

            // get policy information
            if (lead != null) {
                lblClient.Text = string.Format("<b>{0} {1}<br/>{2}<br/>{3}<br/>{4}, {5} {6}</b>",
                        lead.ClaimantFirstName ?? "",		//0
                        lead.ClaimantLastName ?? "",		//1
                        lead.LossAddress ?? "",			//2
                        lead.LossAddress2 ?? "",			//3
                        lead.CityName ?? "",			//4
                        lead.StateName ?? "",			//5
                        lead.Zip ?? ""					//6
                        );

            }

            bindTimeExpenseForInvoice(claimID);
        }
예제 #21
0
        private int bindLeads()
        {
            //gonna have to add something here that says if user role is adjuster, do something different - OC9/4/14
            int resultCount = 0;
            int myClaimID = SessionHelper.getClaimID();
            var predicate = buildPredicate();

            using (ClaimManager repository = new ClaimManager())
            {
                objLead = repository.Search(predicate);
            }

            if (objLead != null && objLead.Count > 0)
            {
                pnlSearchResult.Visible = true;

                gvUserLeads.DataSource = objLead;
                gvUserLeads.DataBind();

                resultCount = objLead.Count;
            }
            else
            {
                gvUserLeads.DataSource = null;
                gvUserLeads.DataBind();
            }

            lblSearchResult.Text = string.Format("{0} claims found.", resultCount);
            lblSearchResult.Visible = true;

            customizeFieldColumns(gvUserLeads);

            updateDashboard();

            return resultCount;
        }
예제 #22
0
        private void checkUserSearchFromMasterPage()
        {
            int adjustID = 0;
            AdjusterMaster adjuster = null;
            int carrierID = 0;
            int clientID = 0;
            int foundCount = 0;
            int userID = 0;
            string keyword = null;
            Expression<Func<vw_Lead_Search, bool>> predicate = null;
            CRM.Data.Entities.SecUser secUser = null;

            if (Request.Params["s"] != null)
            {
                keyword = Request.Params["s"].ToString();

                clientID = SessionHelper.getClientId();
                userID = SessionHelper.getUserId();

                predicate = PredicateBuilder.True<CRM.Data.Entities.vw_Lead_Search>();

                // mandatory filters

                //predicate = predicate.And(x => x.IsActive == true);		// active claims
                predicate = predicate.And(x => x.ClientID == clientID);	// client leads
                predicate = predicate.And(x => x.Status == 1);			// active lead
                //predicate = predicate.And(x => x.UserID != 0);			// user created lead

                predicate = predicate.And(x => x.AdjusterClaimNumber.Contains(keyword) ||
                                        x.ContractorName.Contains(keyword) ||
                                        x.AppraiserName.Contains(keyword) ||
                                        x.UmpireName.Contains(keyword) ||
                                        x.InsuredName.Contains(keyword) ||
                                        x.LossAddress.Contains(keyword) ||
                                        x.PolicyNumber.Contains(keyword) ||
                                        x.InsurerClaimNumber.Contains(keyword)||
                                        x.ProducerName.Contains(keyword));

                //if (DateTime.TryParse(keyword, out fromDate)) {
                //	//predicate = predicate.And(Lead => Lead.OriginalLeadDate >= txtDateFrom.Date);
                //	predicate = predicate.Or(x => x.LossDate >= fromDate);
                //}

                //if (DateTime.TryParse(keyword, out toDate)) {
                //	//predicate = predicate.And(Lead => Lead.OriginalLeadDate <= txtDateTo.Date);
                //	predicate = predicate.Or(x => x.LossDate <= toDate);
                //}

                switch (roleID)
                {
                    case (int)UserRole.Administrator:
                        break;

                    case (int)UserRole.Client:
                    case (int)UserRole.SiteAdministrator:
                        // 2014-03-11
                        //predicate = predicate.And(Lead => Lead.ClientID == clientID);
                        break;

                    case (int)UserRole.Adjuster:
                        // get all leads assigned to adjuster
                        adjuster = AdjusterManager.GetAdjusterByUserID(userID);

                        if (adjuster != null)
                        {
                            adjustID = adjuster.AdjusterId;

                            predicate = predicate.And(x => x.AdjusterId == adjustID);
                        }
                        else
                        {
                            predicate = predicate.And(x => x.UserId == userID);
                        }
                        break;

                    default:
                        // check account is related to carrier. if so, include those leads whose policy has been assinged this carrier
                        secUser = SecUserManager.GetById(userID);
                        if (secUser != null && secUser.CarrierID != null)
                        {
                            carrierID = secUser.CarrierID ?? 0;
                            predicate = predicate.And(x => x.CarrierID == carrierID);
                        }
                        else if (secUser.isViewAllClaims ?? false)
                        {
                            // allow user to see all claims
                        }
                        else
                        {
                            // get all leads created by user
                            predicate = predicate.And(x => x.UserId == userID);
                        }
                        break;
                }

                // do search
                using (ClaimManager repository = new ClaimManager())
                {
                    objLead = repository.Search(predicate);
                }

                if (objLead != null && objLead.Count > 0)
                {
                    pnlSearchResult.Visible = true;

                    foundCount = objLead.Count;

                    customizeFieldColumns(gvUserLeads);
                }

                gvUserLeads.DataSource = objLead;
                gvUserLeads.DataBind();

                lblSearchResult.Text = string.Format("{0} claims found.", objLead.Count);
                lblSearchResult.Visible = true;

                //updateDashboard();
            }
        }
예제 #23
0
        public List<string> getEmailData(int claimId, int BusinessRuleID)
        {
            List<string> emailData = new List<string>();
            string adjusterEmail = "";

            int adjusterId = 0;
            int superVisorId = 0;
            string adjusterClaimNumber = "";
            string dateRecieved = "";
            int ruleId = 0;
            string businessDescription = "";
            string redFlagName = "";
            string insuredName = "";
            string adjusterName = "";
            ClaimManager ClaimManagerObj = new ClaimManager();
            Claim claimObj = new Claim();
            claimObj = ClaimManagerObj.Get(claimId);
            if (claimObj != null && claimObj.AdjusterID != null)
            {
                adjusterId = Convert.ToInt32(claimObj.AdjusterID);
            }

            if (claimObj != null && claimObj.InsurerClaimNumber != null)
            {
                adjusterClaimNumber = claimObj.InsurerClaimNumber;

            }

            if (claimObj != null && claimObj.DateOpenedReported != null)
            {
                dateRecieved = Convert.ToString(claimObj.DateOpenedReported);
            }

            AdjusterMaster adjusterMasterObj = new AdjusterMaster();

            if (claimObj != null) { adjusterMasterObj = claimObj.AdjusterMaster; }
            if (adjusterMasterObj != null && adjusterMasterObj.email != null)
            {
                adjusterEmail = Convert.ToString(adjusterMasterObj.email);
            }

            if (adjusterMasterObj != null && adjusterMasterObj.adjusterName != null)
            {
                adjusterName = Convert.ToString(adjusterMasterObj.adjusterName);
            }

            if (adjusterMasterObj != null && adjusterMasterObj.SupervisorID != null)
            {
                superVisorId = Convert.ToInt32(adjusterMasterObj.SupervisorID);
            }

            CRM.Data.Entities.SecUser secUserObj = new CRM.Data.Entities.SecUser();

            secUserObj = getSecUser(superVisorId);
            insuredName = claimObj.LeadPolicy.Leads.insuredName;

            BusinessRuleManager BusinessRuleManagerObj = new BusinessRuleManager();
            BusinessRule BusinessRuleObj = new BusinessRule();
            BusinessRuleObj = BusinessRuleManagerObj.GetBusinessRule(BusinessRuleID);
            if (BusinessRuleObj.RuleID != null)
            {
                ruleId = Convert.ToInt32(BusinessRuleObj.RuleID);
            };
            businessDescription = BusinessRuleObj.Description;

            CRM.Data.Entities.Rule ruleObj = new CRM.Data.Entities.Rule();
            ruleObj = BusinessRuleManagerObj.GetRule(ruleId);
            redFlagName = ruleObj.RuleName;
            string encryptedClaimNumber = Core.SecurityManager.EncryptQueryString(claimId.ToString());

            emailData.Add(adjusterEmail);
            emailData.Add(adjusterName);
            emailData.Add(secUserObj.Email);
            emailData.Add(secUserObj.UserName);
            emailData.Add(adjusterClaimNumber);
            emailData.Add(dateRecieved);
            emailData.Add(businessDescription);
            emailData.Add(redFlagName);
            emailData.Add(insuredName);
            emailData.Add(encryptedClaimNumber);
            return emailData;
        }
예제 #24
0
        protected void fillClaimStatusReview(int clientd)
        {
            ClaimManager objClaimManager = new ClaimManager();

            List<Carrier> objCarrier = new List<Carrier>();
            objCarrier = objClaimManager.GetAllCarrier(clientd);

            List<ContactList> objContactlist = new List<ContactList>();

            List<Contact> listContact = ContactManager.GetAll(clientd).ToList();

            List<StatusMaster> statusMasters = null;

            List<ExpenseType> expenseTypes = null;

            ContactList objcontact1;
            foreach (Contact data in listContact)
            {
                objcontact1 = new ContactList();
                objcontact1.ContactID = data.ContactID;
                objcontact1.FirstName = data.FirstName;
                objcontact1.LastName = data.LastName;
                objcontact1.Email = data.Email;
                objcontact1.CompanyName = data.CompanyName;
                objcontact1.IdOf = "c";
                objContactlist.Add(objcontact1);
            }
            List<AdjusterMaster> listAdjuster = CRM.Data.Account.AdjusterManager.GetAll(clientd).ToList();
            foreach (AdjusterMaster data in listAdjuster)
            {
                objcontact1 = new ContactList();
                objcontact1.ContactID = data.AdjusterId;
                objcontact1.FirstName = data.FirstName;
                objcontact1.LastName = data.LastName;
                objcontact1.Email = data.email;
                objcontact1.CompanyName = data.CompanyName;
                objcontact1.IdOf = "a";
                objContactlist.Add(objcontact1);
            }
            gvSelectRecipients.DataSource = objContactlist.AsQueryable();
            gvSelectRecipients.DataBind();

            gvSelectRecipientsStatus.DataSource = objContactlist.AsQueryable();
            gvSelectRecipientsStatus.DataBind();

            gvSelectRecipientsExpense.DataSource = objContactlist.AsQueryable();
            gvSelectRecipientsExpense.DataBind();

            statusMasters = StatusManager.GetList(clientd);
            if (statusMasters!=null)
            {
            CollectionManager.FillCollection(ddlClaimStatusReview, "StatusId", "StatusName", statusMasters);
            }
            if (objCarrier!=null)
            {
            CollectionManager.FillCollection(ddlClaimCarrier, "CarrierID", "CarrierName", objCarrier);
            CollectionManager.FillCollection(ddlExpenseClaimCarrier, "CarrierID", "CarrierName", objCarrier);
            }

            Client objClient = ClaimsManager.GetClientByUserId(SessionHelper.getUserId());
            if (objClient!=null)
            {
                txtAdjusterComapnyName.Text = objClient.BusinessName;
                txtExpenseAdjusterComapnyName.Text = objClient.BusinessName;
            }

            using (ExpenseTypeManager repository = new ExpenseTypeManager())
            {
                expenseTypes = repository.GetAll(clientd).ToList();
            }
            if (expenseTypes!=null)
            {
            Core.CollectionManager.FillCollection(ddlExpenseType, "ExpenseTypeID", "ExpenseName", expenseTypes);
            }
        }
예제 #25
0
        public DateTime progressClaimRecievedData(int claimId)
        {
            DateTime progressDate = new DateTime();
            ClaimManager ClaimManagerobj = new ClaimManager();
            Claim claimObj = new Claim();
            claimObj = ClaimManagerobj.Get(claimId);

            if (claimObj.ProgressStatusID != null)
            {

                progressDate = Convert.ToDateTime(claimObj.DateOpenedReported);

            }
            else
            {
                progressDate = DateTime.MinValue;
            }

            return progressDate;
        }
        public static string SaveLossDetails(int policyID, string coverage, string type, string policyLimit, string deductible, string applyTo, string itv, string reserve, int acrossall, string catDeductible, string coInsuranceLimit)
        {
            string json = "";
            int limitID = 0;

            ClaimLimit claimLimit = null;
            PolicyLimit objPolicyLimit = null;

            Limit limits = null;
            Limit limits2 = null;
            int userID = SessionHelper.getUserId();
            ClaimManager objClaimManager = new ClaimManager();

            try
            {
                using (TransactionScope scope = new TransactionScope())
                {

                    List<Claim> lstClaim = objClaimManager.GetPolicyClaim(policyID);

                    bool isTemplate = ClaimLimitManager.PolicyIsStaticTrue(policyID);

                    if (isTemplate)
                    {

                        PolicyLimitManager.IsDeleted(policyID);
                        //if coverage first time then delete all template data from all claimid
                        foreach (var claim in lstClaim)
                        {
                            int claimId = claim.ClaimID;
                            ClaimLimitManager.IsDeleted(claimId);
                        }

                    }

                    limits = new Limit();
                    limits.LimitLetter = coverage;
                    if (type == "Contacts" || type == "Personal Liability" || type == "Medical Payments")
                    {
                        limits.LimitType = 2;
                    }
                    else
                    {
                        limits.LimitType = 1;
                    }
                    limits.LimitDescription = type;
                    limits.IsStatic = false;
                    limits2 = LimitManager.Save(limits);

                    limitID = limits2.LimitID;

                    objPolicyLimit = new PolicyLimit();
                    objPolicyLimit.PolicyID = policyID;
                    objPolicyLimit.LimitID = limitID;
                    if (!string.IsNullOrEmpty(policyLimit))
                    {
                        objPolicyLimit.LimitAmount = Convert.ToDecimal(policyLimit);
                    }
                    else
                    {
                        objPolicyLimit.LimitAmount = 0;
                    }
                    if (!string.IsNullOrEmpty(deductible))
                    {
                        objPolicyLimit.LimitDeductible = Convert.ToDecimal(deductible);
                    }
                    else
                    {
                        objPolicyLimit.LimitDeductible = 0;
                    }
                    //new fields add
                    if (!string.IsNullOrEmpty(catDeductible))
                    {
                        objPolicyLimit.CATDeductible = catDeductible;
                    }
                    if (!string.IsNullOrEmpty(coInsuranceLimit))
                    {
                        objPolicyLimit.ConInsuranceLimit = Convert.ToDecimal(coInsuranceLimit);
                    }
                    else
                    {
                        objPolicyLimit.LimitDeductible = 0;
                    }

                    if (!string.IsNullOrEmpty(itv))
                    {
                        objPolicyLimit.ITV = Convert.ToDecimal(itv);
                    }
                    else
                    {
                        objPolicyLimit.ITV = 0;
                    }
                    if (!string.IsNullOrEmpty(reserve))
                    {
                        objPolicyLimit.Reserve = Convert.ToDecimal(reserve);
                    }
                    else
                    {
                        objPolicyLimit.Reserve = 0;
                    }
                    objPolicyLimit.IsDeleted = false;
                    if (acrossall == 1)
                    {
                        objPolicyLimit.ApplyAcrossAllCoverage = true;
                    }
                    else
                    {
                        objPolicyLimit.ApplyAcrossAllCoverage = false;
                    }
                    objPolicyLimit.ApplyTo = applyTo;

                    PolicyLimitManager.Save(objPolicyLimit);

                    // enter data for each claim
                    foreach (var claim in lstClaim)
                    {

                        claimLimit = new ClaimLimit();
                        claimLimit.ClaimID = claim.ClaimID;
                        claimLimit.LimitID = limitID;
                        claimLimit.LossAmountACV = 0;
                        claimLimit.LossAmountRCV = 0;
                        claimLimit.Depreciation = 0;
                        claimLimit.OverageAmount = 0;
                        claimLimit.NonRecoverableDepreciation = 0;
                        claimLimit.IsDeleted = false;
                        ClaimLimitManager.Save(claimLimit);

                    }

                    scope.Complete();
                }
                json = "Loss details successfully add";

            }
            catch (Exception ex)
            {
                Core.EmailHelper.emailError(ex);
            }

            return json;
        }