Exemplo n.º 1
0
        private void SendEmailToWait()
        {
            string            recipient = TextBoxEmail.Text;
            string            subject   = "Patient Portal Verification and SinUp Completion";
            string            body      = "Our team will soon contact you. Wait For our next mail.";
            GmailHandlerClass obj       = new GmailHandlerClass();

            obj.SendEmail(recipient, subject, body);
            string response = obj.SendEmail(recipient, subject, body);
        }
        protected void FireRowCommand(object sender, GridViewCommandEventArgs e)

        {
            string command   = e.CommandName;
            int    requestId = Int32.Parse(e.CommandArgument.ToString());

            switch (command)
            {
            case "Respond":
            {
                try
                {
                    string CS = ConfigurationManager.ConnectionStrings["ConnectToPatientPortal"].ConnectionString;
                    using (SqlConnection connection = new SqlConnection(CS))
                    {
                        connection.Open();
                        SqlCommand com = new SqlCommand("Select * from DoctorRegistrationRequestsTable where RequestId='" + requestId + "'", connection);
                        using (SqlDataReader reader = com.ExecuteReader())
                        {
                            if (reader.Read())
                            {
                                string            name   = reader.GetString(1);
                                string            email  = reader.GetString(2);
                                GmailHandlerClass obj    = new GmailHandlerClass();
                                string            result = obj.SendEmail(email, "Patient Portal Verification and SinUp Completion", "DEAR" + name + "follow the link");
                                Response.Write(result);
                                ChangeRespondstatus(requestId);
                                BindData();
                            }
                        }
                        connection.Close();
                    }
                }
                catch (Exception ex)
                {
                    Session["Exception"] = ex;
                    Response.Redirect("~/404.aspx");
                }

                break;
            }
            }
        }