Esempio n. 1
0
        public HttpResponseMessage PractitionerRejected(Guid accId)
        {
            string practitionerEmailAddress = String.Empty;

            try
            {
                PractitionerBusiness businessLayer = new PractitionerBusiness();
                practitionerEmailAddress = businessLayer.PractitionerRejected(accId);

                if (!String.IsNullOrEmpty(practitionerEmailAddress))
                {
                    string mailFrom     = ConstantHelper.AppSettings.MailFrom;
                    string emailSubject = ConstantHelper.Email.AccountVerification.AccountRejectedSubject;
                    string emailBody    = ConstantHelper.Email.AccountVerification.PractitionerRejectedBody;
                    string userName     = ConstantHelper.AppSettings.UserName;
                    string password     = ConstantHelper.AppSettings.Password;
                    EmailHelper.SentMail(mailFrom, practitionerEmailAddress, emailSubject, emailBody, userName, password);
                }
            }
            catch (Exception err)
            {
                new LogHelper().LogMessage("RegistrationController.PractitionerRejected : " + err);
            }

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

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

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

            return(response);
        }