예제 #1
0
    private void sendRejectMail(string requestNo, string reason, string rejectLevel)
    {
        CommonMail mail = new CommonMail();

        mail.From_address = "*****@*****.**";

        string requestedUser = "";

        requestedUser   = getRequestedUser(requestNo);
        mail.To_address = getEmailOfUser(requestedUser);



        mail.Bcc_address = "*****@*****.**";



        mail.Subject = "Cover Note Book Requested has been Rejected";
        String BodyText;

        BodyText = "<html>" +
                   "<head>" +
                   "<title>Cover Note Book Requested has been Rejected</title>" +
                   " <body> " +
                   "<table>" +
                   "<tr>" +
                   "<td>" +
                   "Cover Note Book request under request no. " + requestNo + " has been rejected from " + rejectLevel + " level." +
                   "</td>" +
                   "</tr>" +
                   "<tr>" +
                   "<td>" +
                   "Reason for Reject - " + reason +
                   "</td>" +
                   "</tr>" +
                   "</table>" +
                   " </body> " +
                   " </html>";


        try
        {
            mail.Body = BodyText;
            mail.sendMail();



            string notificationMsg = "";
            notificationMsg = "Cover Note Book request under request no. " + requestNo + " has been rejected from " + rejectLevel + " level.";

            NotificationsHub nHub = new NotificationsHub();
            nHub.NotifyClientForCoverNoteBookRequests("Cover Note Book Requested has been Rejected", notificationMsg, requestedUser);
        }
        catch (Exception ee)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true);
        }
    }
예제 #2
0
    private void sendNotifyMailToBookRequester(string requestNo, string coverNoteBookNo)
    {
        CommonMail mail = new CommonMail();

        mail.From_address = "*****@*****.**";

        string requestedUser = "";

        requestedUser   = getRequestedUser(requestNo);
        mail.To_address = getEmailOfUser(requestedUser);



        mail.Bcc_address = "*****@*****.**";



        mail.Subject = "Cover Note Book Issued";
        String BodyText;

        BodyText = "<html>" +
                   "<head>" +
                   "<title>Cover Note Book Requested has been issued</title>" +
                   " <body> " +
                   "<table>" +
                   "<tr>" +
                   "<td>" +
                   "The manual cover note book request made under request number " + requestNo + " is completed and the cover note book number, " + coverNoteBookNo + " has been issued now." +
                   "</td>" +
                   "</tr>" +

                   "<tr>" +
                   "</tr>" +

                   "<tr>" +
                   "<td>" +
                   "Please confirm upon receiving." +
                   "</td>" +
                   "</tr>" +
                   "</table>" +
                   " </body> " +
                   " </html>";


        try
        {
            mail.Body = BodyText;
            mail.sendMail();
        }
        catch (Exception ee)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true);
        }
    }
예제 #3
0
    private void sendNotifyMailToBookIssuers(string requestNo)
    {
        CommonMail mail = new CommonMail();

        mail.From_address = "*****@*****.**";


        mail.To_address = getEmailOfBookIssueUser(System.Configuration.ConfigurationManager.AppSettings["CVR_NOTE_BOOK_ISSUER_MAIL_GROUP_NAME"].ToString());



        mail.Bcc_address = "*****@*****.**";



        string pageURl = "";

        pageURl = "http://192.168.10.103:8045/Views/BookManagement/BookManager.aspx?pagecode=200";


        mail.Subject = "Cover Note Book Ready to Issue";
        String BodyText;

        BodyText = "<html>" +
                   "<head>" +
                   "<title>Cover Note Book Requested has been Approved and ready to issue</title>" +
                   " <body> " +
                   "<table>" +
                   "<tr>" +
                   "<td>" +
                   "Cover Note Book request under request no. " + requestNo + " has been approved and ready to issue" +
                   "</td>" +
                   "</tr>" +
                   "<tr>" +
                   "<td>" +
                   "Click <a href=\"" + pageURl + "\">here</a> to issue the book." +
                   "</td>" +
                   "</tr>" +
                   "</table>" +
                   " </body> " +
                   " </html>";


        try
        {
            mail.Body = BodyText;
            mail.sendMail();
        }
        catch (Exception ee)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true);
        }
    }
        private void sendApprovalNotificationMailOfHNBToHDO()
        {
            ProposalUploadController proposalUploadController = new ProposalUploadController();

            CommonMail mail = new CommonMail();

            mail.From_address = "*****@*****.**";

            mail.To_address = proposalUploadController.getEmailOfBranchStaff("TDA");//HDO FOR HNB

            mail.Cc_address = "*****@*****.**";

            mail.Subject = "Uploaded HNB Proposal Processed and Ready to Print";
            String BodyText;

            BodyText = "<html>" +
                       "<head>" +
                       "<title>Uploaded Proposal Processed and Ready to Print</title>" +
                       " <body> " +
                       "<table>" +
                       "<tr>" +
                       "<td>" +
                       "Uploaded Proposal of Quotation No. " + txtQuotationNo.Text + " Processed and Ready to Print." +
                       "</td>" +
                       "</tr>" +
                       "<tr>" +
                       "<td>" +
                       "TCS Policy No. - " + txtTCSPolicyNo.Text +
                       "</td>" +
                       "</tr>" +
                       "</table>" +
                       " </body> " +
                       " </html>";


            try
            {
                mail.Body = BodyText;
                mail.sendMail();
            }
            catch (Exception ee)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true);
            }
        }
        protected void btnEmail_Click(object sender, EventArgs e)
        {
            if (txtTo.Text == "")
            {
                lblMsg.Text = "To address cannot be empty";
                return;
            }



            CommonMail mail = new CommonMail();

            mail.From_address = "*****@*****.**";


            if (txtTo.Text != "")
            {
                mail.To_address = txtTo.Text;
            }

            if (txtCc.Text != "")
            {
                mail.Cc_address = txtCc.Text;
            }



            mail.Subject = "Motor New Bussiness Documents";
            String BodyText;

            BodyText = "Plese find the attachement";

            mail.Attachment = (new Attachment(txtDocPath.Text, "Document.pdf"));

            mail.Body = BodyText;
            mail.sendMail();

            lblMsg.Text = "Document successfully sent";
        }
예제 #6
0
    private void sendMailToPolicyOwnBranch(string branchCode, string policyNo)
    {
        ProposalUploadController proposalUploadController = new ProposalUploadController();

        CommonMail mail = new CommonMail();

        //  mail.From_address = "*****@*****.**";

        mail.From_address = "*****@*****.**";


        mail.To_address = proposalUploadController.getEmailOfBranchStaff(branchCode);
        // mail.To_address = "*****@*****.**";


        mail.Cc_address = "*****@*****.**";



        //string pageURl = "";
        //pageURl = Request.Url.AbsoluteUri;
        //// pageURl = pageURl.Replace("Quotation.aspx", "MRApprove.aspx");

        //int index = pageURl.LastIndexOf("/");
        //if (index > 0)
        //{
        //    pageURl = pageURl.Substring(0, index + 1);
        //}


        //pageURl = pageURl + "ProposalUploadView.aspx" + "?ProposalUploadId=" + txtProposalUploadId.Text;



        mail.Subject = "Upload Documents for Policy Cancellation";
        String BodyText;

        BodyText = "<html>" +
                   "<head>" +
                   "<title>Upload Documents for Policy Cancellation</title>" +
                   " <body> " +
                   "<table>" +
                   "<tr>" +
                   "<td>" +
                   "Please Upload Documents for Policy Cancellation of Policy No. " + policyNo +
                   "</td>" +
                   "</tr>" +
                   "</table>" +
                   " </body> " +
                   " </html>";


        try
        {
            mail.Body = BodyText;
            mail.sendMail();
        }
        catch (Exception ee)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true);
        }
    }
        private void sendApprovalNotificationMailForCancellation()
        {
            if (txtEnteredBranchCode.Text == "")
            {
                return;
            }


            ProposalUploadController proposalUploadController = new ProposalUploadController();



            CommonMail mail = new CommonMail();

            //  mail.From_address = "*****@*****.**";

            mail.From_address = "*****@*****.**";


            mail.To_address = proposalUploadController.getEmailOfBranchStaff(txtEnteredBranchCode.Text);
            //mail.To_address = "*****@*****.**";


            string enteredUserEmail = "";

            enteredUserEmail = proposalUploadController.getEmailOfUser(txtProposalUploadUserCode.Text);


            if (enteredUserEmail != "")
            {
                mail.Cc_address = enteredUserEmail + ",[email protected]";
            }
            else
            {
                mail.Cc_address = "*****@*****.**";
            }



            mail.Subject = "Uploaded Proposal Cancelled and Ready to Print";
            String BodyText;

            BodyText = "<html>" +
                       "<head>" +
                       "<title>Uploaded Proposal Cancelled and Ready to Print</title>" +
                       " <body> " +
                       "<table>" +
                       "<tr>" +
                       "<td>" +
                       "Uploaded Proposal of Job No. " + txtJobNo.Text + " Cancelled and Ready to Print." +
                       "</td>" +
                       "</tr>" +
                       "<tr>" +
                       "<td>" +
                       "TCS Policy No. - " + txtPolicyNo.Text +
                       "</td>" +
                       "</tr>" +
                       "</table>" +
                       " </body> " +
                       " </html>";


            try
            {
                mail.Body = BodyText;
                mail.sendMail();
            }
            catch (Exception ee)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true);
            }
        }
예제 #8
0
        private void sendRejectionMail(string jobNo)
        {
            if (txtEnteredBranchCode.Text == "")
            {
                return;
            }

            ProposalUploadController proposalUploadController = new ProposalUploadController();



            CommonMail mail = new CommonMail();

            //  mail.From_address = "*****@*****.**";

            mail.From_address = "*****@*****.**";


            mail.To_address = proposalUploadController.getEmailOfBranchStaff(txtEnteredBranchCode.Text);
            //mail.To_address = "*****@*****.**";

            string enteredUserEmail = "";

            enteredUserEmail = proposalUploadController.getEmailOfUser(txtProposalUploadUserCode.Text);


            if (enteredUserEmail != "")
            {
                mail.Cc_address = enteredUserEmail + ",[email protected]";
            }
            else
            {
                mail.Cc_address = "*****@*****.**";
            }



            //string pageURl = "";
            //pageURl = Request.Url.AbsoluteUri;
            //// pageURl = pageURl.Replace("Quotation.aspx", "MRApprove.aspx");

            //int index = pageURl.LastIndexOf("/");
            //if (index > 0)
            //{
            //    pageURl = pageURl.Substring(0, index + 1);
            //}


            //pageURl = pageURl + "ProposalUploadView.aspx" + "?ProposalUploadId=" + txtProposalUploadId.Text;



            mail.Subject = "Uploaded Proposal Details Rejected";
            String BodyText;

            BodyText = "<html>" +
                       "<head>" +
                       "<title>Uploaded Proposal Details Rejected</title>" +
                       " <body> " +
                       "<table>" +
                       "<tr>" +
                       "<td>" +
                       "Uploaded Proposal of Quotation No./Job No. " + jobNo + " Rejected" +
                       "</td>" +
                       "</tr>" +
                       "<tr>" +
                       "<td>" +
                       "Reason for Reject - " + txtScrutinizeRemarks.Text +
                       "</td>" +
                       "</tr>" +
                       "</table>" +
                       " </body> " +
                       " </html>";


            try
            {
                mail.Body = BodyText;
                mail.sendMail();
            }
            catch (Exception ee)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true);
            }
        }
예제 #9
0
    private void sendRequestApprovalMail(string newRequestSeqNo, string requestNo, string branchCode, string newStatus)
    {
        if (newRequestSeqNo == "")
        {
            return;
        }

        string BOOK_REQ_PEND_APPR_BY_ZM  = System.Configuration.ConfigurationManager.AppSettings["BOOK_REQ_PEND_APPR_BY_ZM"].ToString();
        string BOOK_REQ_PEND_APPR_BY_HDO = System.Configuration.ConfigurationManager.AppSettings["BOOK_REQ_PEND_APPR_BY_HDO"].ToString();



        string nextApprovePerson = "";


        if (newStatus == BOOK_REQ_PEND_APPR_BY_ZM)
        {
            nextApprovePerson = getZonalApprovePersonName(branchCode);
        }
        else
        {
            nextApprovePerson = getNextApprovePersonName(branchCode);
        }



        string     UserCode   = "";
        HttpCookie reqCookies = Request.Cookies["userInfo"];

        if (reqCookies != null)
        {
            UserCode = reqCookies["UserCode"].ToString();
        }


        ProposalUploadController proposalUploadController = new ProposalUploadController();



        CommonMail mail = new CommonMail();

        mail.From_address = "*****@*****.**";


        mail.To_address = proposalUploadController.getEmailOfUser(nextApprovePerson);
        // mail.To_address = proposalUploadController.getEmailOfUser(UserCode);

        //string enteredUserEmail = "";
        //enteredUserEmail = proposalUploadController.getEmailOfUser(UserCode);


        mail.Bcc_address = "*****@*****.**";



        string pageURl = "";

        pageURl = "http://192.168.10.103:8045/Views/BookManagement/";

        pageURl = pageURl + "CoverNoteBookRequestApproval.aspx" + "?RequestSeqNo=" + newRequestSeqNo;



        mail.Subject = "Approval need for Cover Note Book Request";
        String BodyText;

        BodyText = "<html>" +
                   "<head>" +
                   "<title>Approval need for Cover Note Book Request</title>" +
                   " <body> " +
                   "<table>" +
                   "<tr>" +
                   "<td>" +
                   "Approval need for Cover Note Book Request under request no.  " + requestNo + " ," +
                   "</td>" +
                   "</tr>" +
                   "<tr>" +
                   "<td>" +
                   "Click <a href=\"" + pageURl + "\">here</a> to Approve/Reject the request." +
                   "</td>" +
                   "</tr>" +
                   "</table>" +
                   " </body> " +
                   " </html>";


        try
        {
            mail.Body = BodyText;
            mail.sendMail();


            string notificationMsg = "";
            notificationMsg = "Approval need for Cover Note Book Request under request no.  " + requestNo + "";

            NotificationsHub nHub = new NotificationsHub();
            nHub.NotifyClientForCoverNoteBookRequests("Approval need for Cover Note Book Request", notificationMsg, nextApprovePerson);
        }
        catch (Exception ee)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true);
        }
    }