public static void CheckSendMail(RuleException ruleExp)
        {
            if (ruleExp != null)
            {
                string adjusterEmail = string.Empty;
                string supervisorEmail = string.Empty;
                bool sendAdjuster = false;
                bool sendSupervisor = false;
                string recipient = string.Empty;
                int claimId = 0;

                BusinessRuleManager objRuleManager = new BusinessRuleManager();
                BusinessRule objRule = new BusinessRule();
                CRM.Data.Entities.Claim objClaim = new CRM.Data.Entities.Claim();
                CRM.Data.Entities.SecUser objSecUser = new Data.Entities.SecUser();
                AdjusterMaster adjustermaster = new AdjusterMaster();

                int businessRuleID = ruleExp.BusinessRuleID ?? 0;
                objRule = objRuleManager.GetBusinessRule(businessRuleID);
                if (objRule != null)
                {
                    claimId = ruleExp.ObjectID ?? 0;

                    objClaim = objRuleManager.GetClaim(claimId);
                    adjustermaster = objRuleManager.GetAdjuster(objClaim.AdjusterID ?? 0);
                    objSecUser = objRuleManager.GetSupervisor(objClaim.SupervisorID ?? 0);
                    if (objSecUser != null)
                    {
                        adjusterEmail = adjustermaster.email;
                        supervisorEmail = objSecUser.Email;

                        sendAdjuster = objRule.EmailAdjuster;
                        sendSupervisor = objRule.EmailSupervisor;

                        if (sendAdjuster == true && sendSupervisor == true)
                        {
                            recipient = adjusterEmail + "," + supervisorEmail;
                            notifyUser(objRule.Description, claimId, recipient);
                        }
                        else if (sendAdjuster == false && sendSupervisor == true)
                        {
                            recipient = supervisorEmail;
                            notifyUser(objRule.Description, claimId, recipient);
                        }
                        else if (sendAdjuster == true && sendSupervisor == false)
                        {

                            recipient = adjusterEmail;
                            notifyUser(objRule.Description, claimId, recipient);
                        }
                    }
                }
            }
        }
        public static void CheckSendMail(RuleException ruleExp)
        {
            if (ruleExp != null)
            {
                string adjusterEmail   = string.Empty;
                string supervisorEmail = string.Empty;
                bool   sendAdjuster    = false;
                bool   sendSupervisor  = false;
                string recipient       = string.Empty;
                int    claimId         = 0;

                BusinessRuleManager       objRuleManager = new BusinessRuleManager();
                BusinessRule              objRule        = new BusinessRule();
                CRM.Data.Entities.Claim   objClaim       = new CRM.Data.Entities.Claim();
                CRM.Data.Entities.SecUser objSecUser     = new Data.Entities.SecUser();
                AdjusterMaster            adjustermaster = new AdjusterMaster();

                int businessRuleID = ruleExp.BusinessRuleID ?? 0;
                objRule = objRuleManager.GetBusinessRule(businessRuleID);
                if (objRule != null)
                {
                    claimId = ruleExp.ObjectID ?? 0;

                    objClaim       = objRuleManager.GetClaim(claimId);
                    adjustermaster = objRuleManager.GetAdjuster(objClaim.AdjusterID ?? 0);
                    objSecUser     = objRuleManager.GetSupervisor(objClaim.SupervisorID ?? 0);
                    if (objSecUser != null)
                    {
                        adjusterEmail   = adjustermaster.email;
                        supervisorEmail = objSecUser.Email;

                        sendAdjuster   = objRule.EmailAdjuster;
                        sendSupervisor = objRule.EmailSupervisor;

                        if (sendAdjuster == true && sendSupervisor == true)
                        {
                            recipient = adjusterEmail + "," + supervisorEmail;
                            notifyUser(objRule.Description, claimId, recipient);
                        }
                        else if (sendAdjuster == false && sendSupervisor == true)
                        {
                            recipient = supervisorEmail;
                            notifyUser(objRule.Description, claimId, recipient);
                        }
                        else if (sendAdjuster == true && sendSupervisor == false)
                        {
                            recipient = adjusterEmail;
                            notifyUser(objRule.Description, claimId, recipient);
                        }
                    }
                }
            }
        }
Example #3
0
        static public void emailUserPasswordReset(Data.Entities.SecUser user)
        {
            string        crsupportEmail         = ConfigurationManager.AppSettings["smtpEmail"].ToString();
            string        crsupportEmailPassword = ConfigurationManager.AppSettings["smtpPassword"].ToString();
            string        siteURL   = ConfigurationManager.AppSettings["siteURL"].ToString();
            StringBuilder emailBody = null;

            if (user != null && !string.IsNullOrEmpty(user.Email))
            {
                string[] recipients = new string[] { user.Email };

                // get new user password to show in email
                string password = SecurityManager.Decrypt(user.Password);

                string subject = "ClaimRuler Password Reset";

                emailBody = new StringBuilder();
                // .containerBox
                emailBody.Append("<div style=\"margin:auto;width:600px;border: 1px solid #DDDDE4; margin: auto;font-family: Tahoma, Arial,sans-serif;font-size: 12px;color: #808080;\">");

                // header
                emailBody.Append("<div><img src=\"http://app.claimruler.com/images/email_header_small.jpg\"></image></div>");

                // .paneContentInner
                emailBody.Append("<div style=\"margin: 20px;\">");
                emailBody.Append("<p>Dear, " + user.FirstName + "!</p>");
                emailBody.Append("<p>Your ClaimRuler password has been reset.</p>");
                emailBody.Append("<p>User name: <b>" + user.UserName + "</b></p>");
                emailBody.Append("<p>New Password: <b>" + password + "</b></p>");
                emailBody.Append("<br><br>Please click on the link below to sign in.<br>");
                emailBody.Append(string.Format("<a target='_blank' href='{0}/login.aspx'>Claim Ruler - Industrial Strength Property Claim Management Software</a>", siteURL));


                emailBody.Append("</div>");                     // paneContentInner
                emailBody.Append("</div>");                     // containerBox


                Core.EmailHelper.sendEmail(crsupportEmail, recipients, null, subject, emailBody.ToString(), null, crsupportEmail, crsupportEmailPassword);
            }
        }
Example #4
0
        private void bindData()
        {
            Data.Entities.SecUser user = null;
            user = new Data.Entities.SecUser();
            var a = SecUserManager.GetByUserId(userID);

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


            case (int)UserRole.Client:
            case (int)UserRole.SiteAdministrator:
                BindClientPanel();

                claimProgressChart.bindData(clientID);

                ruleExceptionChart.bindData(clientID);
                break;

            default:
                BindUserPanel();
                if (a.isViewAllClaims == true)
                {
                    claimProgressChart.bindData(clientID);
                }
                else
                {
                    claimProgressChart.bindData(clientID, userID);
                }


                ruleExceptionChart.bindData(clientID);
                break;
            }
        }
Example #5
0
        private void bindData()
        {
            Data.Entities.SecUser user = null;
            user = new Data.Entities.SecUser();
            var a = SecUserManager.GetByUserId(userID);

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

                case (int)UserRole.Client:
                case (int)UserRole.SiteAdministrator:
                    BindClientPanel();

                    claimProgressChart.bindData(clientID);

                    ruleExceptionChart.bindData(clientID);
                    break;

                default:
                    BindUserPanel();
                    if(a.isViewAllClaims == true)
                    {
                        claimProgressChart.bindData(clientID);
                    }
                    else
                    {
                        claimProgressChart.bindData(clientID, userID);
                    }

                    ruleExceptionChart.bindData(clientID);
                    break;
            }
        }
        public static void notifyUser(int claimStatus, string insurerClaimId, string insurerName, int claimAdjusterId, string adjusterComapnyName, string updatedby, string commentNote, string emailTo, int carrierID, int claimid, string recipient, string claimAdjuster, string claimStatusName, string carrier, string[] recipId, string[] idofTable)
        {
            StringBuilder emailBody = new StringBuilder();
            string password = null;
            string[] recipients = null;
            string smtpHost = null;
            int smtpPort = 0;
            int supervisorId = 0;
            AdjusterMaster objAdjusterMaster = null;
            CRM.Data.Entities.SecUser objSecUser = null;
            //string siteUrl = ConfigurationManager.AppSettings["siteUrl"].ToString();
            string subject = "Please Read Note, Claim Ruler Status Change to: " + claimStatusName + " on Claim # " + insurerClaimId;
            CRM.Data.Entities.SecUser user = null;

            // get logged in user
            int userID = SessionHelper.getUserId();
            // get logged in user email info
            user = SecUserManager.GetByUserId(userID);
            // load email credentials
            smtpHost = user.emailHost;
            string appurl = ConfigurationManager.AppSettings["appURL"].ToString();

            int.TryParse(user.emailHostPort, out smtpPort);

            recipient = emailTo != string.Empty && recipient != string.Empty ? emailTo + "," + recipient : recipient;
            recipient = emailTo != string.Empty && recipient == string.Empty ? emailTo : recipient;

            objAdjusterMaster = new AdjusterMaster();
            objAdjusterMaster = AdjusterManager.GetAdjusterId(claimAdjusterId);
            // code for add adjuster and supervisor email for add in recipients
            if (user.Email != string.Empty)
            {
                recipient = recipient + "," + user.Email;
            }
            if (!string.IsNullOrEmpty(objAdjusterMaster.email))
            {
                recipient = recipient + "," + objAdjusterMaster.email;
            }
            if (!string.IsNullOrEmpty(Convert.ToString(objAdjusterMaster.SupervisorID)))
            {
                SecUserManager.GetByUserId(objAdjusterMaster.SupervisorID ?? 0);
                objSecUser = new Data.Entities.SecUser();
                if (!string.IsNullOrEmpty(objSecUser.Email))
                {
                    recipient = recipient + "," + objSecUser.Email;
                }
            }

            // recipients
            recipients = new string[] { };
            recipients = recipient.Split(',');
            // build email body
            // .containerBox
            emailBody.Append("<div>");
            emailBody.Append("<div>");
            emailBody.Append("Hi " + claimAdjuster + ",<br><br>");

            emailBody.Append("<table>");
            emailBody.Append("<tr><td style='width:100px;'></td>");
            emailBody.Append("<td>");
            emailBody.Append("<b>Update Claim Status/Review</b><br/>");
            emailBody.Append("</td>");
            emailBody.Append("</tr>");
            emailBody.Append("</table>");

            emailBody.Append("<table>");

            emailBody.Append("<tr>");
            emailBody.Append("<td style='width:200px;'>");
            emailBody.Append("Update Status To:");
            emailBody.Append("</td>");
            emailBody.Append("<td>");
            emailBody.Append(claimStatusName);
            emailBody.Append("</td>");
            emailBody.Append("</tr>");

            emailBody.Append("<tr>");
            emailBody.Append("<td>");
            emailBody.Append("Insurer Claim #:");
            emailBody.Append("</td>");
            emailBody.Append("<td><a href='" + appurl + "/protected/Admin/UsersLeads.aspx?s=" + insurerClaimId + "'>");
            emailBody.Append(insurerClaimId);
            emailBody.Append("</a></td>");
            emailBody.Append("</tr>");

            emailBody.Append("<tr>");
            emailBody.Append("<td>");
            emailBody.Append("Insured Name:");
            emailBody.Append("</td>");
            emailBody.Append("<td>");
            emailBody.Append(insurerName);
            emailBody.Append("</td>");
            emailBody.Append("</tr>");

            emailBody.Append("<tr>");
            emailBody.Append("<td>");
            emailBody.Append("Carrier:");
            emailBody.Append("</td>");
            emailBody.Append("<td>");
            emailBody.Append(carrier);
            emailBody.Append("</td>");
            emailBody.Append("</tr>");

            emailBody.Append("<tr>");
            emailBody.Append("<td>");
            emailBody.Append("Adjuster:");
            emailBody.Append("</td>");
            emailBody.Append("<td>");
            emailBody.Append(claimAdjuster);
            emailBody.Append("</td>");
            emailBody.Append("</tr>");

            emailBody.Append("<tr>");
            emailBody.Append("<td>");
            emailBody.Append("Adjuster Company Name:");
            emailBody.Append("</td>");
            emailBody.Append("<td>");
            emailBody.Append(adjusterComapnyName);
            emailBody.Append("</td>");
            emailBody.Append("</tr>");

            emailBody.Append("<tr>");
            emailBody.Append("<td>");
            emailBody.Append("Updated By:");
            emailBody.Append("</td>");
            emailBody.Append("<td>");
            emailBody.Append(user.UserName);
            emailBody.Append("</td>");
            emailBody.Append("</tr>");

            emailBody.Append("<tr>");
            emailBody.Append("<td>");
            emailBody.Append("Comment/Note:");
            emailBody.Append("</td>");
            emailBody.Append("<td>");
            emailBody.Append(commentNote);
            emailBody.Append("</td>");
            emailBody.Append("</tr>");

            emailBody.Append("<tr>");
            emailBody.Append("<td>");
            emailBody.Append("Email To:");
            emailBody.Append("</td>");
            emailBody.Append("<td>");
            emailBody.Append(emailTo);
            emailBody.Append("</td>");
            emailBody.Append("</tr>");

            if (recipId.Length > 0)
            {
                emailBody.Append("<tr>");
                emailBody.Append("<td style='vertical-align:top'>");
                emailBody.Append("Selected Recipients");
                emailBody.Append("</td>");
                emailBody.Append("<td>");

                //////

                emailBody.Append("<table style='border:1px solid;'>");
                emailBody.Append("<tr>");
                emailBody.Append("<td>");
                emailBody.Append("First Name");
                emailBody.Append("</td>");
                emailBody.Append("<td>");
                emailBody.Append("Last Name");
                emailBody.Append("</td>");
                emailBody.Append("<td>");
                emailBody.Append("Company Name");
                emailBody.Append("</td>");
                emailBody.Append("<td>");
                emailBody.Append("Email");
                emailBody.Append("</td>");
                emailBody.Append("<td>");
                emailBody.Append("Contact Title");
                emailBody.Append("</td>");
                emailBody.Append("</tr>");
                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);
                        emailBody.Append("<tr>");

                        emailBody.Append("<td>");
                        emailBody.Append(objContact.FirstName);
                        emailBody.Append("</td>");
                        emailBody.Append("<td>");
                        emailBody.Append(objContact.LastName);
                        emailBody.Append("</td>");
                        emailBody.Append("<td>");
                        emailBody.Append(objContact.CompanyName);
                        emailBody.Append("</td>");
                        emailBody.Append("<td>");
                        emailBody.Append(objContact.Email);
                        emailBody.Append("</td>");
                        emailBody.Append("<td>");
                        emailBody.Append(objContact.ContactTitle);
                        emailBody.Append("</td>");
                        emailBody.Append("</tr>");

                    }
                    else
                    {
                        AdjusterMaster objAdjuster = AdjusterManager.GetAdjusterId(index2);

                        emailBody.Append("<tr>");

                        emailBody.Append("<td>");
                        emailBody.Append(objAdjuster.FirstName);
                        emailBody.Append("</td>");
                        emailBody.Append("<td>");
                        emailBody.Append(objAdjuster.LastName);
                        emailBody.Append("</td>");
                        emailBody.Append("<td>");
                        emailBody.Append(objAdjuster.CompanyName);
                        emailBody.Append("</td>");
                        emailBody.Append("<td>");
                        emailBody.Append(objAdjuster.email);
                        emailBody.Append("</td>");
                        emailBody.Append("<td>");
                        emailBody.Append("");
                        emailBody.Append("</td>");
                        emailBody.Append("</tr>");
                    }
                }

                emailBody.Append("</table>");
                emailBody.Append("</td>");
                emailBody.Append("</tr>");
            }

            emailBody.Append("</table>");
            emailBody.Append("</div>");	// paneContentInner
            emailBody.Append("</div>");	// containerBox

            password = Core.SecurityManager.Decrypt(user.emailPassword);

            // Core.EmailHelper.sendEmail(user.Email, recipients, null, subject, emailBody.ToString(), null, user.emailHost, smtpPort, user.Email, password, true);//user.isSSL ??
            string crsupportEmail = ConfigurationManager.AppSettings["smtpEmail"].ToString();
            string crsupportEmailPassword = ConfigurationManager.AppSettings["smtpPassword"].ToString();
            Core.EmailHelper.sendEmail(crsupportEmail, recipients, null, subject, emailBody.ToString(), null, crsupportEmail, crsupportEmailPassword);
        }