Example #1
0
        public HttpResponseMessage CompanyRejected(Guid accId)
        {
            string companyEmailAddress = String.Empty;

            try
            {
                PractitionerBusiness businessLayer = new PractitionerBusiness();
                companyEmailAddress = businessLayer.CompanyRejected(accId);

                if (!String.IsNullOrEmpty(companyEmailAddress))
                {
                    string mailFrom     = ConstantHelper.AppSettings.MailFrom;
                    string emailSubject = ConstantHelper.Email.CompanyVerification.CompanyRejectedSubject;
                    string emailBody    = ConstantHelper.Email.CompanyVerification.CompanyRejectedBody;
                    string userName     = ConstantHelper.AppSettings.UserName;
                    string password     = ConstantHelper.AppSettings.Password;
                    EmailHelper.SentMail(mailFrom, companyEmailAddress, emailSubject, emailBody, userName, password);
                }
            }
            catch (Exception err)
            {
                new LogHelper().LogMessage("RegistrationController.CompanyRejected : " + err);
            }

            string route = ConstantHelper.AppSettings.RootSiteUrl + "HomePage/CompanyRejected";

            var response = Request.CreateResponse(HttpStatusCode.Moved);

            response.Headers.Location = new Uri(route);

            return(response);
        }