//New Order (Req. CUS03561) - Planson Customer Portal
        public EmailFormatDTO NewOrder(EmailFormatDTO model)
        {
            //  model.ReferenceNo = "CUS03561";
            //model.Link = "https://www.plansonintl.com/portal/request/view?id=4084";
            //model.AddOffice = "Cambridge, United States";
            //model.CreatedBy = "*****@*****.**";
            //model.ApprovedBy = "*****@*****.**";

            StringBuilder sb = new StringBuilder();

            string strtemplate = "<p>A new Planson Customer Portal Request has been approved to become an order. </p> <br/><br/>";

            sb.Append(strtemplate);



            string link = "<p> Reference: : <a href='" + model.Link + "' target ='_blank'> <b> " + model.ReferenceNo + " </b> </a>  <br/><br/> </p>";

            sb.Append(link);

            string office = "<p> Office: " + model.AddOffice + " </p>";

            sb.Append(office);

            string CreatedBy = "<p> Created By: " + model.CreatedBy + " </p>";

            sb.Append(CreatedBy);

            string ApprovedBy = "<p>  Approved By: " + model.ApprovedBy + " </p>";

            string notice = "<p  style='align-items:center' >Notice Of Shipment </p>  <br/><br/>";

            sb.Append(notice);

            string thanks = "<p>Regards, </p> <p> Your Planson Team  </p>";

            sb.Append(thanks);

            model.Subject = "Request created Ref. No.  " + model.ReferenceNo + "  with request details";
            string strfinaltemplate = sb.ToString();

            model.Message = strfinaltemplate;

            emailDTO.Subject    = model.Subject;
            emailDTO.Message    = model.Message;
            emailDTO.To         = model.To;
            emailDTO.CC         = model.CC;
            emailDTO.BCC        = model.BCC;
            emailDTO.From       = model.From;
            emailDTO.IsBodyHtml = model.IsBodyHtml;
            emailDTO.MainBody   = strfinaltemplate;


            int val = EmailManager.SendEmail(emailDTO);

            contactUsData.ContactInsert(model); //for table datastore

            model.StatusEmail = val;
            return(model);
        }
        //email sent
        public JsonResult SendEmailData(EmailFormatDTO model)
        {
            var AllStatus = orderApproverData.SendEmail(model);

            return(new JsonResult {
                Data = AllStatus, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        //Your Request CUS03561 was Approved - Planson Customer Portal
        public EmailFormatDTO RequestApproved(EmailFormatDTO model)
        {
            //model.ReferenceNo = "CUS03561";
            //model.Link = "https://www.plansonintl.com/portal/request/view?id=4084";
            //model.ApprovedBy = "*****@*****.**";


            StringBuilder sb = new StringBuilder();

            string strtemplate = "<p>Your request with reference <b> " + model.ReferenceNo + " </b> has been approved by the Financial Reviewer and is now being processed as an order. No further action is required at this time. You can view your order at any time by clicking <a href='" + model.Link + "' target ='_blank'>here</a>   </p> <br/><br/>";

            sb.Append(strtemplate);

            string link = "Approved by: <a href='mailto:" + model.ApprovedBy + "' target ='_blank'> [email protected] </a>  <br/><br/>";

            sb.Append(link);

            string order = "<p>Thank you for this order </p>";

            sb.Append(order);

            string thanks = "<p>Regards, </p>  <br/><br/><p> Your Planson Team  </p>";

            sb.Append(thanks);


            string strfinaltemplate = sb.ToString();

            model.Message       = strfinaltemplate;
            model.Subject       = "Request  Approved for  Ref. No. " + model.ReferenceNo + " with request details";
            emailDTO.Subject    = model.Subject;
            emailDTO.Message    = model.Message;
            emailDTO.To         = model.To;
            emailDTO.CC         = model.CC;
            emailDTO.BCC        = model.BCC;
            emailDTO.From       = model.From;
            emailDTO.IsBodyHtml = model.IsBodyHtml;
            emailDTO.MainBody   = strfinaltemplate;



            int val = EmailManager.SendEmail(emailDTO);

            contactUsData.ContactInsert(model); //for table datastore

            model.StatusEmail = val;
            return(model);
        }
        //Freight Quote Required (Req. CUS03550) - Planson Customer Portal
        public EmailFormatDTO ShipOrderOrder(EmailFormatDTO model)
        {
            //model.RequestNo = "CUS03550";
            //model.Link = "https://www.plansonintl.com/portal/admin/freight?id=4073";

            StringBuilder sb = new StringBuilder();


            string strtemplate = "<p>Planson Customer Portal Request <a href='" + model.Link + "' target ='_blank'> <b> " + model.RequestNo + " </b> </a> requires a Review Order. </p> <br/><br/>";

            sb.Append(strtemplate);


            string questions = "<p><b> IMPORTANT:</b> Be sure to include insurance charges in your quoted freight rate. </p>";

            sb.Append(questions);


            string thanks = "<p>Thank you. </p>";

            sb.Append(thanks);

            model.Subject = "Ship Order for Request No. " + model.RequestNo + " and in details it will give out details of Request";
            string strfinaltemplate = sb.ToString();

            model.Message = strfinaltemplate;

            emailDTO.Subject    = model.Subject;
            emailDTO.Message    = model.Message;
            emailDTO.To         = model.To;
            emailDTO.CC         = model.CC;
            emailDTO.BCC        = model.BCC;
            emailDTO.From       = model.From;
            emailDTO.IsBodyHtml = model.IsBodyHtml;
            emailDTO.MainBody   = strfinaltemplate;



            int val = EmailManager.SendEmail(emailDTO);

            contactUsData.ContactInsert(model); //for table datastore

            ///contactus datarepo call here
            model.StatusEmail = val;
            return(model);
        }
        //Freight Quoted for Req. CUS03569
        public EmailFormatDTO GetFreightQuoted(EmailFormatDTO model)
        {
            string strval = System.Configuration.ConfigurationManager.AppSettings["EmailLink"];

            // model.ReferenceNo = "CUS03569";
            model.Link = strval + "?redirect=request%2Ffinalize%3Fid%3D4092";


            StringBuilder sb = new StringBuilder();

            string strtemplate = "<p>Freight charges have been quoted for your request <b> " + model.ReferenceNo + " </b> . The final step is to assign budget codes to your request. </p> <br/><br/>";

            sb.Append(strtemplate);

            string link = "<a href='" + model.Link + "' target ='_blank'> Click here to assign budget codes </a>  <br/><br/>";

            sb.Append(link);

            string thanks = "<p>Many thanks, </p>  <br/><br/><p> Your Planson Team  </p>";

            sb.Append(thanks);


            string strfinaltemplate = sb.ToString();

            model.Subject = "Request created Ref. No. " + model.ReferenceNo + " with request details";
            model.Message = strfinaltemplate;


            emailDTO.Subject    = model.Subject;
            emailDTO.Message    = model.Message;
            emailDTO.To         = model.To;
            emailDTO.CC         = model.CC;
            emailDTO.BCC        = model.BCC;
            emailDTO.From       = model.From;
            emailDTO.IsBodyHtml = model.IsBodyHtml;
            emailDTO.MainBody   = strfinaltemplate;


            int val = EmailManager.SendEmail(emailDTO);

            contactUsData.ContactInsert(model);    //for table datastore

            model.StatusEmail = val;
            return(model);
        }
        public int ContactInsert(EmailFormatDTO model)
        {
            ContactUsDTO contactUsDTO = new ContactUsDTO();


            contactUsDTO.CustId    = model.CustId;
            contactUsDTO.UserId    = model.UserId;
            contactUsDTO.OrderId   = model.OrderId;
            contactUsDTO.AddressTo = model.To;
            contactUsDTO.Subject   = model.Subject;
            contactUsDTO.Contents  = model.Message;
            contactUsDTO.Type      = model.Type;


            AddUpdateContactUs(contactUsDTO);
            return(0);
        }
        //Raphael Lokeny Requests Your Approval for Req. CUS03569 - Planson Partner Portal
        public EmailFormatDTO RequestsApproval(EmailFormatDTO model)
        {
            string strval = System.Configuration.ConfigurationManager.AppSettings["ApproveEmailLink"];

            //  model.Link = "https://www.plansonintl.com/portal/review/answer1?id=4092&key=2f94967c8b58e50e9e18663f294d95c7";
            model.Link = strval + "RequestOrder?Oval=" + model.EncOrderNo + "&AppId=" + model.EncOrderApproverNo;
            StringBuilder sb = new StringBuilder();

            string strtemplate = "<p>You are listed as the approving user for a request made on the Planson Partner Portal. Please use the following link to review the request and submit your  </p> <br/><br/>";

            sb.Append(strtemplate);

            string link = "<p> decision:<a href='" + model.Link + "' target ='_blank'> " + (model.Link) + " </a>  </p> <br/><br/>";

            sb.Append(link);

            string thanks = "<p>Thank you, </p>  <br/><br/><p> Your Planson Team  </p>";

            sb.Append(thanks);


            string strfinaltemplate = sb.ToString();

            model.Message = strfinaltemplate;
            model.Subject = "Request pending for Approval for  Ref. No. " + model.ReferenceNo + " with request details";

            emailDTO.Subject    = model.Subject;
            emailDTO.Message    = model.Message;
            emailDTO.To         = model.To;
            emailDTO.CC         = model.CC;
            emailDTO.BCC        = model.BCC;
            emailDTO.From       = model.From;
            emailDTO.IsBodyHtml = model.IsBodyHtml;
            emailDTO.MainBody   = strfinaltemplate;


            int val = EmailManager.SendEmail(emailDTO);

            contactUsData.ContactInsert(model); //for table datastore

            model.StatusEmail = val;
            return(model);
        }
        public EmailFormatDTO ContactInfo(EmailFormatDTO model)
        {
            emailDTO.Subject    = model.Subject;
            emailDTO.Message    = model.Message;
            emailDTO.To         = model.To;
            emailDTO.CC         = model.CC;
            emailDTO.BCC        = model.BCC;
            emailDTO.From       = model.From;
            emailDTO.IsBodyHtml = model.IsBodyHtml;
            emailDTO.MainBody   = model.Message;



            int val = EmailManager.SendEmail(emailDTO);

            contactUsData.ContactInsert(model); //for table datastore

            ///contactus datarepo call here
            model.StatusEmail = val;
            return(model);
        }
        public List <dynamic> SendEmail(EmailFormatDTO emailFormatDTO)
        {
            EmailTemplate  emailTemplate      = new EmailTemplate();
            List <dynamic> objGetOrderDetails = new List <dynamic>();
            List <dynamic> objDynamic         = new List <dynamic>();

            objGetOrderDetails = GetOrderDetails(SecurityHelper.Decrypt(emailFormatDTO.strOrderID, false));
            string AprEmail = string.Empty, AprName = string.Empty, SupportingEmail = string.Empty;

            emailFormatDTO.ReferenceNo = objGetOrderDetails[0][0].ReferenceNo;
            emailFormatDTO.Status      = objGetOrderDetails[0][0].StatusID;
            emailFormatDTO.FirstName   = objGetOrderDetails[0][0].FirstName;
            emailFormatDTO.LastName    = objGetOrderDetails[0][0].LastName;
            emailFormatDTO.CreatedBy   = objGetOrderDetails[0][0].UserName;
            emailFormatDTO.AddOffice   = objGetOrderDetails[0][0].Department;
            emailFormatDTO.UserId      = 0;
            List <OrderSupportingEmail> OrderSupportingEmail = objGetOrderDetails[11];

            for (int i = 0; i < OrderSupportingEmail.Count; i++)
            {
                if (OrderSupportingEmail.Count == 1)
                {
                    SupportingEmail = OrderSupportingEmail[i].email;
                }
                else
                {
                    SupportingEmail = SupportingEmail + "," + OrderSupportingEmail[i].email;
                }
            }
            if (OrderSupportingEmail.Count > 1)
            {
                SupportingEmail = SupportingEmail.Substring(1);
            }
            emailFormatDTO.To = SupportingEmail;
            emailTemplate.ContactInfo(emailFormatDTO);
            objDynamic.Add(0);
            return(objDynamic);
        }
        public List <dynamic> SaveConfirmOrder(SaveOrder SaveOrder)
        {
            List <dynamic> objDynamic = new List <dynamic>();

            Int64 intOrderID = 0, intCustomerID = 0, intUserID = 0, intConfirmOrderID = 0;

            try
            {
                if (!string.IsNullOrEmpty(SaveOrder.strorderID))
                {
                    intOrderID = Convert.ToInt64(SaveOrder.strorderID);
                }
                if (!string.IsNullOrEmpty(SaveOrder.strCustId))
                {
                    intCustomerID = Convert.ToInt64(SaveOrder.strCustId);
                }
                if (!string.IsNullOrEmpty(UserID))
                {
                    intUserID = Convert.ToInt64(UserID);
                }
                intConfirmOrderID = orddata.AddConfirmOrderDetail(intOrderID, intCustomerID, intUserID, SaveOrder.type);

                string strencOrderID = securityHelper.Encrypt(intConfirmOrderID.ToString(), false);
                objDynamic.Add(strencOrderID);
                objDynamic.Add(custOrderData.GetCustOrderDetailList(intConfirmOrderID));
                if (true)
                {
                }
                EmailTemplate  emailTemplate  = new EmailTemplate();
                EmailFormatDTO emailFormatDTO = GetEmailDetails(intConfirmOrderID.ToString(), string.Empty, string.Empty);
            }
            catch (Exception ex)
            {
            }
            return(objDynamic);
        }
        public EmailFormatDTO GetEmailDetails(String OrderID, String EmailID, String Status)
        {
            EmailFormatDTO emailFormatDTO     = new EmailFormatDTO();
            EmailTemplate  emailTemplate      = new EmailTemplate();
            List <dynamic> objGetOrderDetails = new List <dynamic>();

            try
            {
                objGetOrderDetails = orderApprovalData.GetOrderDetails(OrderID);
                string AprEmail = string.Empty, AprName = string.Empty, SupportingEmail = string.Empty;
                emailFormatDTO.ReferenceNo = objGetOrderDetails[0][0].ReferenceNo;
                emailFormatDTO.Status      = objGetOrderDetails[0][0].StatusID;
                emailFormatDTO.FirstName   = objGetOrderDetails[0][0].FirstName;
                emailFormatDTO.LastName    = objGetOrderDetails[0][0].LastName;
                emailFormatDTO.CreatedBy   = objGetOrderDetails[0][0].UserName;
                emailFormatDTO.AddOffice   = objGetOrderDetails[0][0].Department;
                emailFormatDTO.UserId      = Convert.ToInt64(UserID);
                emailFormatDTO.OrderId     = Convert.ToInt64(OrderID);
                List <ApproverDetails> ApproverDetails = objGetOrderDetails[1];
                for (int i = 0; i < ApproverDetails.Count; i++)
                {
                    if (!string.IsNullOrEmpty(ApproverDetails[i].AprEmail))
                    {
                        if (ApproverDetails.Count == 1)
                        {
                            AprEmail = ApproverDetails[i].AprEmail;
                            AprName  = ApproverDetails[i].AprName;
                        }
                        else
                        {
                            AprEmail = AprEmail + ";" + ApproverDetails[i].AprEmail;
                            AprName  = AprEmail + " And   " + ApproverDetails[i].AprName;
                        }
                    }
                }
                emailFormatDTO.ApprovedBy = AprName;

                if (objGetOrderDetails[11] != null)
                {
                    List <OrderSupportingEmail> OrderSupportingEmail = objGetOrderDetails[11];

                    for (int i = 0; i < OrderSupportingEmail.Count; i++)
                    {
                        if (OrderSupportingEmail.Count == 1)
                        {
                            SupportingEmail = OrderSupportingEmail[i].email;
                        }
                        else
                        {
                            SupportingEmail = SupportingEmail + "," + OrderSupportingEmail[i].email;
                        }
                    }
                    if (OrderSupportingEmail.Count > 1)
                    {
                        SupportingEmail = SupportingEmail.Substring(1);
                    }
                    //  emailFormatDTO.CC = SupportingEmail;
                }


                Int64 instatus = 0;
                if (!string.IsNullOrEmpty(Status))
                {
                    instatus = Convert.ToInt64(Status);
                }
                else
                {
                    instatus = emailFormatDTO.Status;
                }
                switch (instatus)
                {
                case 1:
                {
                    emailFormatDTO.To = objGetOrderDetails[0][0].UserName;
                    emailFormatDTO.CC = SupportingEmail;
                    emailTemplate.NewOrder(emailFormatDTO);
                    break;
                }

                case 2:
                {
                    emailFormatDTO.To = objGetOrderDetails[0][0].UserName;
                    emailFormatDTO.CC = SupportingEmail;
                    emailTemplate.QuoteRequired(emailFormatDTO);
                    break;
                }

                case 6:
                {
                    for (int i = 0; i < ApproverDetails.Count; i++)
                    {
                        if (!string.IsNullOrEmpty(ApproverDetails[i].AprEmail))
                        {
                            emailFormatDTO.EncOrderApproverNo = securityHelper.Encrypt(ApproverDetails[i].OAID.ToString(), true);

                            emailFormatDTO.EncOrderNo = securityHelper.Encrypt(OrderID, true);
                            emailTemplate.RequestsApproval(emailFormatDTO);
                        }
                    }


                    break;
                }

                case 8:
                {
                    emailFormatDTO.To = objGetOrderDetails[0][0].UserName;
                    emailFormatDTO.CC = SupportingEmail;
                    emailTemplate.RequestApproved(emailFormatDTO);
                    break;
                }

                case 9:
                {
                    emailFormatDTO.To = objGetOrderDetails[0][0].UserName;
                    emailFormatDTO.CC = SupportingEmail;
                    emailTemplate.RequestDenied(emailFormatDTO);
                    break;
                }

                case 10:
                {
                    emailFormatDTO.To = objGetOrderDetails[0][0].UserName;
                    emailTemplate.ReviewingOrder(emailFormatDTO);
                    break;
                }

                case 99:
                {
                    emailFormatDTO.To = EmailID;
                    emailTemplate.ShipOrderOrder(emailFormatDTO);
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                log.logErrorMessage("CustRequestData.GetEmailDetails");
                log.logErrorMessage(ex.StackTrace);
            }


            return(emailFormatDTO);
        }
        //Please Submit Your Invoice to appropriate Accounts Payable For Payment
        public EmailFormatDTO InvoiceAppropriate(EmailFormatDTO model)
        {
            //model.OrderNo = "SLS23882 / CUS03525";
            //model.Link = "https://www.plansonintl.com/portal/request/view?id=4066";
            //model.Name = "Daniel Thomas";
            //model.CreatedBy = "*****@*****.**";
            //model.ApprovedBy = "*****@*****.**";
            //model.Courier = "Fedex";


            StringBuilder sb = new StringBuilder();

            string ord = "<p> Order #   " + model.ReferenceNo + " </p>";

            sb.Append(ord);


            string Nam = "<p> Dear  " + model.Name + " </p>";

            sb.Append(Nam);

            string start = "<p>I hope this mail finds you well.</p>";

            sb.Append(start);

            string strtemplate = "<p>According to <b> " + model.Courier + " </b> , your order has been fully delivered. Kindly proceed with the next steps in completing this order.  </p> <br/><br/>";

            sb.Append(strtemplate);


            string questions = "<p> Please contact us if you have any questions. </p>";

            sb.Append(questions);


            string thanks = "<p>Thank you. </p>";

            sb.Append(thanks);


            string strfinaltemplate = sb.ToString();

            model.Message = strfinaltemplate;


            emailDTO.Subject    = model.Subject;
            emailDTO.Message    = model.Message;
            emailDTO.To         = model.To;
            emailDTO.CC         = model.CC;
            emailDTO.BCC        = model.BCC;
            emailDTO.From       = model.From;
            emailDTO.IsBodyHtml = model.IsBodyHtml;
            emailDTO.MainBody   = strfinaltemplate;



            int val = EmailManager.SendEmail(emailDTO);

            contactUsData.ContactInsert(model); //for table datastore

            model.StatusEmail = val;
            return(model);
        }
        //Your Order # SLS23914 / CUS03543 Has Been Delivered - Please Submit GRN
        public EmailFormatDTO Delivered(EmailFormatDTO model)
        {
            //model.OrderNo = "SLS23914 / CUS03543";
            //model.Link = "https://www.plansonintl.com/portal/request/view?id=4066";
            //model.Name = "Daniel Thomas";
            //model.CreatedBy = "*****@*****.**";
            //model.ApprovedBy = "*****@*****.**";

            StringBuilder sb = new StringBuilder();

            string ord = "<p> Order #   " + model.ReferenceNo + " </p>";

            sb.Append(ord);

            string Nam = "<p> Dear  " + model.Name + " </p>";

            sb.Append(Nam);

            string start = "<p>I hope this mail finds you well.</p>";

            sb.Append(start);

            string strtemplate = "<p>Your order has been delivered. Please confirm that all goods have been received and are complete and correct. Then submit your GRN by clicking  <a href='" + model.Link + "' target ='_blank'> <b> here </b> </a> </p> <br/><br/>";

            sb.Append(strtemplate);



            string link = "<p> Reference: : <a href='" + model.Link + "' target ='_blank'> <b> " + model.ReferenceNo + " </b> </a>  <br/><br/> </p>";

            sb.Append(link);

            string questions = "<p> Please contact us if you have any questions. </p>";

            sb.Append(questions);


            string thanks = "<p>Thank you. </p>";

            sb.Append(thanks);


            string strfinaltemplate = sb.ToString();

            model.Message = strfinaltemplate;

            emailDTO.Subject    = model.Subject;
            emailDTO.Message    = model.Message;
            emailDTO.To         = model.To;
            emailDTO.CC         = model.CC;
            emailDTO.BCC        = model.BCC;
            emailDTO.From       = model.From;
            emailDTO.IsBodyHtml = model.IsBodyHtml;
            emailDTO.MainBody   = strfinaltemplate;



            int val = EmailManager.SendEmail(emailDTO);

            contactUsData.ContactInsert(model); //for table datastore

            model.StatusEmail = val;
            return(model);
        }
        public EmailFormatDTO GetEmailDetails(String OrderID)
        {
            EmailFormatDTO emailFormatDTO     = new EmailFormatDTO();
            EmailTemplate  emailTemplate      = new EmailTemplate();
            List <dynamic> objGetOrderDetails = new List <dynamic>();

            objGetOrderDetails = GetOrderDetails(OrderID);
            string AprEmail = string.Empty, AprName = string.Empty, SupportingEmail = string.Empty;

            emailFormatDTO.ReferenceNo = objGetOrderDetails[0][0].ReferenceNo;
            emailFormatDTO.Status      = objGetOrderDetails[0][0].StatusID;
            emailFormatDTO.FirstName   = objGetOrderDetails[0][0].FirstName;
            emailFormatDTO.LastName    = objGetOrderDetails[0][0].LastName;
            emailFormatDTO.CreatedBy   = objGetOrderDetails[0][0].UserName;
            emailFormatDTO.AddOffice   = objGetOrderDetails[0][0].Department;
            emailFormatDTO.EncOrderNo  = SecurityHelper.Encrypt(OrderID, false);
            emailFormatDTO.OrderId     = Convert.ToInt64(OrderID);
            List <ApproverDetails> ApproverDetails = objGetOrderDetails[1];

            for (int i = 0; i < ApproverDetails.Count; i++)
            {
                if (!string.IsNullOrEmpty(ApproverDetails[i].AprEmail))
                {
                    if (ApproverDetails.Count == 1)
                    {
                        AprEmail = ApproverDetails[i].AprEmail;
                        AprName  = ApproverDetails[i].AprName;
                    }
                    else
                    {
                        AprEmail = AprEmail + "," + ApproverDetails[i].AprEmail;
                        AprName  = AprEmail + " And   " + ApproverDetails[i].AprName;
                    }
                }
            }
            emailFormatDTO.ApprovedBy = AprName;
            if (!string.IsNullOrEmpty(AprEmail))
            {
                emailFormatDTO.To = objGetOrderDetails[0][0].UserName + "," + AprEmail;
            }
            else
            {
                emailFormatDTO.To = objGetOrderDetails[0][0].UserName;
            }

            List <OrderSupportingEmail> OrderSupportingEmail = objGetOrderDetails[11];

            ;
            for (int i = 0; i < OrderSupportingEmail.Count; i++)
            {
                if (OrderSupportingEmail.Count == 1)
                {
                    SupportingEmail = OrderSupportingEmail[i].email;
                }
                else
                {
                    SupportingEmail = SupportingEmail + "," + OrderSupportingEmail[i].email;
                }
            }
            if (OrderSupportingEmail.Count > 1)
            {
                SupportingEmail = SupportingEmail.Substring(1);
            }
            //  emailFormatDTO.CC = SupportingEmail;
            switch (emailFormatDTO.Status)
            {
            case 1:
            {
                emailTemplate.NewOrder(emailFormatDTO);
                break;
            }

            case 2:
            {
                emailTemplate.QuoteRequired(emailFormatDTO);
                break;
            }

            case 6:
            {
                emailTemplate.RequestsApproval(emailFormatDTO);
                break;
            }

            case 8:
            {
                emailFormatDTO.To = objGetOrderDetails[0][0].UserName;
                emailFormatDTO.CC = SupportingEmail;
                emailTemplate.RequestApproved(emailFormatDTO);
                break;
            }

            case 9:
            {
                emailFormatDTO.To = objGetOrderDetails[0][0].UserName;
                emailFormatDTO.CC = SupportingEmail;
                emailTemplate.RequestDenied(emailFormatDTO);
                break;
            }
            }

            return(emailFormatDTO);
        }