public void PermanentUserSendEmail(string Username, string Email, string MRNO, string Password, string MobileNo, string TemplateName)
    {
        List <Parameters> lstParameters = new List <Parameters>();


        lstParameters.Add(new Parameters {
            ShortCodeName = "Username", ShortCodeValue = user.DisplayName
        });
        lstParameters.Add(new Parameters {
            ShortCodeName = "Email", ShortCodeValue = user.Email
        });
        lstParameters.Add(new Parameters {
            ShortCodeName = "MRNO", ShortCodeValue = MRNO
        });
        lstParameters.Add(new Parameters {
            ShortCodeName = "Password", ShortCodeValue = Password
        });

        DataSet ds = new DataSet();

        ds = null;
        ds = (DataSet)objBusinessLogic.GetFormsEmailDetail(AppGlobal.EmailFormPermanentRegistration);

        string EmailToId = Convert.ToString(ds.Tables[0].Rows[0]["EmailToId"]);
        string EmailCCId = Convert.ToString(ds.Tables[0].Rows[0]["EmailCCId"]);

        lsEmailStatus = objMailer.SendEmail(TemplateName, lstParameters, EmailToId, EmailCCId);
        TemplateName  = TemplateName + "_user";
        lsEmailStatus = objMailer.SendEmail(TemplateName, lstParameters, user.Email, EmailCCId);
        if (TemplateName == "PermanentRegistration_user")
        {
            lsSmsStatus = objMailer.SendSms(TemplateName, lstParameters, MobileNo);
        }
        lstParameters = null;
    }
Esempio n. 2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Boolean           DSFlag        = false;
        JaslokMailer      objMailer     = new JaslokMailer();
        List <Parameters> lstParameters = new List <Parameters>();
        string            lsEmailStatus = string.Empty;
        string            lsSmsStatus   = string.Empty;

        try
        {
            UserInfo objuser = UserController.Instance.GetCurrentUserInfo();
            // DataSet dsUsername = objBusinessLogic.IsExistMRNumber(objuser.Username);
            bool check = false;
            if (!string.IsNullOrEmpty(objuser.Username))
            {
                check = objBusinessLogic.IsExistMrNo(objuser.Username.Trim());
            }
            //int count=dsUsername.Tables[0].Rows.Count;
            //if (dsUsername.Tables[0].Rows.Count > 0)
            //{

            /*if (Captcha1.UserValidated)
             * {*/

            //objDAEntities.DoctorScheduleId = Convert.ToInt32(hdnDoctorId.Value);
            //objDAEntities.DoctorId = Convert.ToInt32(Request.QueryString["DI"]);

            int SpecialtyId = 0;
            Int32.TryParse(drpSpecialty.SelectedValue, out SpecialtyId);
            objDAEntities.SpecialtyId = Convert.ToInt32(drpSpecialty.SelectedValue);
            TimeSpan time = DateTime.ParseExact(drpTimeSlot.SelectedValue, "h:mm tt", CultureInfo.InvariantCulture).TimeOfDay;
            objDAEntities.TimeDate        = DateTime.ParseExact(ddlAppointMentDate.SelectedValue, "dd/MM/yyyy", CultureInfo.InvariantCulture) + time;
            objDAEntities.Name            = txtName.Text;
            objDAEntities.Day             = Convert.ToDateTime(txtdob.SelectedDate).ToString("dd/MM/yyyy");//Convert.ToString(txtdob.SelectedDate);
            objDAEntities.DOB             = Convert.ToDateTime(txtdob.SelectedDate);
            objDAEntities.Email           = txtEmail.Text;
            objDAEntities.PhoneNo         = txtPhoneNo.Text;
            objDAEntities.MobileNo        = txtMobileNo.Text;
            objDAEntities.Location        = ddlCountry.SelectedItem.Text;
            objDAEntities.Address         = txtState.Text;
            objDAEntities.Description     = txtInquiry.Text;
            objDAEntities.AppointmentType = ((Request.RawUrl.ToLower().Contains("/consultationappointment/follow-up") == true) ? "Follow-Up" : "New");

            LinkButton objButtonClicked = (LinkButton)sender;

            switch (objButtonClicked.Text.ToLower())
            {
            case "pay later":
                objBusinessLogic.SaveBookAppointment(objDAEntities);

                // CommonFn.SendSMS(txtMobileNo.Text, "Your appointment date is: " + ddlAppointMentDate.SelectedValue);
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Username", ShortCodeValue = txtName.Text.Trim()
                });
                //lsEmailStatus = objMailer.SendEmail("fixanappointment", lstParameters, txtEmail.Text);
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Username", ShortCodeValue = txtName.Text.Trim()
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Day", ShortCodeValue = objDAEntities.Day
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Email", ShortCodeValue = txtEmail.Text.Trim()
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "PhoneNo", ShortCodeValue = txtPhoneNo.Text.Trim()
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "MobileNo", ShortCodeValue = txtMobileNo.Text.Trim()
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Location", ShortCodeValue = ddlCountry.SelectedItem.Text
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Username", ShortCodeValue = txtName.Text.Trim()
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Address", ShortCodeValue = txtState.Text.Trim()
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Description", ShortCodeValue = txtInquiry.Text.Trim()
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Apponintment", ShortCodeValue = objDAEntities.TimeDate.ToString("dd-MMM-yyyy hh:mm tt")
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "DoctorName", ShortCodeValue = lblDoctorName.Text.Trim()
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "AppointmentType", ShortCodeValue = objDAEntities.AppointmentType
                });
                lstParameters.Add(new Parameters {
                    ShortCodeName = "Speciality", ShortCodeValue = lblDocotrSpecialty.Text.Trim()
                });
                lsSmsStatus = objMailer.SendSms("fixanappointment", lstParameters, txtMobileNo.Text);

                DataSet ds = new DataSet();
                ds = null;
                ds = (DataSet)objBusinessLogic.GetFormsEmailDetail(AppGlobal.EmailFormFixAnappointment);

                string EmailToId = Convert.ToString(ds.Tables[0].Rows[0]["EmailToId"]);
                string EmailCCId = Convert.ToString(ds.Tables[0].Rows[0]["EmailCCId"]);

                lsEmailStatus = objMailer.SendEmail("fixanappointment", lstParameters, objDAEntities.Email, EmailCCId);
                lsEmailStatus = objMailer.SendEmail("fixanappointment_Admin", lstParameters, AppGlobal.FixAppointmentEmailAddress);
                //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('We have received your appointment request, you should receive a reply or a call shortly');", true);
                PlaceMessage.Visible   = true;
                placeRightPart.Visible = false;
                Clear();
                break;

            case "pay now":

                objDAEntities.FacilityName          = "Consultation Appointment";
                objDAEntities.ConsultingCharge      = Convert.ToInt32(dsDoctorDetail.Tables[0].Rows[0]["ConsultingCharge"]);
                objDAEntities.FollowUpCharge        = Convert.ToInt32(dsDoctorDetail.Tables[0].Rows[0]["FollowUpCharge"]);
                objDAEntities.AppointmentTypeCharge = ((Request.RawUrl.ToLower().Contains("/consultationappointment/follow-up")) == true) ? objDAEntities.FollowUpCharge : objDAEntities.ConsultingCharge;
                objDAEntities.dName    = lblDoctorName.Text;
                objDAEntities.MRNumber = objuser.Username;
                //Session["Amount"] = lblAppointmentType.Text;
                //Session["Amount"] = "10";
                //Session["ConsultationAppointment"] = objDAEntities;
                objDAEntities.Amount       = Convert.ToInt32(lblAppointmentType.Text);
                objDAEntities.FacilityName = "Consultation Appointment";
                objDAEntities.Guid         = System.Guid.NewGuid().ToString();
                Session["Guid"]            = "App-" + objDAEntities.Guid;
                objBusinessLogic.SaveAppointmentInfoGuid(objDAEntities);

                if (CommonFn.UserID <= 0)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$(document).ready(function(){loadUserPopup();});", true);
                }
                else if (check == true)
                {
                    PlaceMessage.Visible   = true;
                    placeRightPart.Visible = false;
                    Clear();
                    string amount = HttpUtility.UrlEncode(objBusinessLogic.Encrypt(objDAEntities.Amount.ToString()));
                    Response.Redirect("/Payment.aspx?amount=" + amount);
                    // Response.Redirect("/PaymentResponse.aspx");
                    //string pageurl = "/Payment.aspx";
                    //Response.Write("<script> window.open('" + pageurl + "','_blank'); </script>");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$(document).ready(function(){PermanentRegReminderBox();});", true);
                }

                break;
            }


            /*}
             * else
             *  FillCapctha();*/
            //}
            //else
            //{
            //    Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$(document).ready(function(){PermanentRegReminderBox();});", true);

            //}
        }
        catch (Exception ex)
        {
            //Response.Write(ex.ToString());
        }
    }
Esempio n. 3
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Boolean           DSFlag        = false;
        JaslokMailer      objMailer     = new JaslokMailer();
        List <Parameters> lstParameters = new List <Parameters>();
        string            lsEmailStatus = string.Empty;
        string            lsSmsStatus   = string.Empty;

        try
        {
            /*if (Captcha1.UserValidated)
             * {*/

            //objDAEntities.DoctorScheduleId = Convert.ToInt32(hdnDoctorId.Value);
            objDAEntities.DoctorId = Convert.ToInt32(Request.QueryString["DI"]);

            int SpecialtyId = 0;
            Int32.TryParse(drpSpecialty.SelectedValue, out SpecialtyId);
            objDAEntities.SpecialtyId = Convert.ToInt32(drpSpecialty.SelectedValue);
            TimeSpan time = DateTime.ParseExact(drpTimeSlot.SelectedValue, "h:mm tt", CultureInfo.InvariantCulture).TimeOfDay;
            objDAEntities.TimeDate    = DateTime.ParseExact(ddlAppointMentDate.SelectedValue, "dd/MM/yyyy", CultureInfo.InvariantCulture) + time;
            objDAEntities.Name        = txtName.Text;
            objDAEntities.Day         = Convert.ToDateTime(txtdob.SelectedDate).ToString("dd/MM/yyyy");//Convert.ToString(txtdob.SelectedDate);
            objDAEntities.Email       = txtEmail.Text;
            objDAEntities.PhoneNo     = txtPhoneNo.Text;
            objDAEntities.MobileNo    = txtMobileNo.Text;
            objDAEntities.Location    = ddlCountry.SelectedItem.Text;
            objDAEntities.Address     = txtState.Text;
            objDAEntities.Description = txtInquiry.Text;

            objDAEntities.AppointmentType = (drpAppointmentType.SelectedValue == "Follow-Up") ? "Follow-Up" : "New";

            objBusinessLogic.SaveBookAppointment(objDAEntities);

            lstParameters.Add(new Parameters {
                ShortCodeName = "Date", ShortCodeValue = objDAEntities.TimeDate.ToString()
            });
            //lsSmsStatus = objMailer.SendSms("fixanappointment", lstParameters, txtMobileNo.Text);
            // CommonFn.SendSMS(txtMobileNo.Text, "Your appointment date is: " + ddlAppointMentDate.SelectedValue);


            lstParameters.Add(new Parameters {
                ShortCodeName = "Username", ShortCodeValue = txtName.Text.Trim()
            });
            //lsEmailStatus = objMailer.SendEmail("fixanappointment", lstParameters, txtEmail.Text);
            lstParameters.Add(new Parameters {
                ShortCodeName = "Username", ShortCodeValue = txtName.Text.Trim()
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "Day", ShortCodeValue = objDAEntities.Day
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "Email", ShortCodeValue = txtEmail.Text.Trim()
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "PhoneNo", ShortCodeValue = txtPhoneNo.Text.Trim()
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "MobileNo", ShortCodeValue = txtMobileNo.Text.Trim()
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "Location", ShortCodeValue = ddlCountry.SelectedItem.Text
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "Username", ShortCodeValue = txtName.Text.Trim()
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "Address", ShortCodeValue = txtState.Text.Trim()
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "Description", ShortCodeValue = txtInquiry.Text.Trim()
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "Apponintment", ShortCodeValue = objDAEntities.TimeDate.ToString("dd-MMM-yyyy hh:mm tt")
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "DoctorName", ShortCodeValue = lblDoctorName.Text.Trim()
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "AppointmentType", ShortCodeValue = objDAEntities.AppointmentType
            });
            lstParameters.Add(new Parameters {
                ShortCodeName = "Speciality", ShortCodeValue = lblDocotrSpecialty.Text.Trim()
            });
            lsSmsStatus = objMailer.SendSms("fixanappointment", lstParameters, txtMobileNo.Text);


            DataSet ds = new DataSet();
            ds = null;
            ds = (DataSet)objBusinessLogic.GetFormsEmailDetail(AppGlobal.EmailFormFixAnappointment);

            string EmailToId = Convert.ToString(ds.Tables[0].Rows[0]["EmailToId"]);
            string EmailCCId = Convert.ToString(ds.Tables[0].Rows[0]["EmailCCId"]);



            lsEmailStatus = objMailer.SendEmail("fixanappointment", lstParameters, EmailCCId, objDAEntities.Email);
            lsEmailStatus = objMailer.SendEmail("fixanappointment_Admin", lstParameters, AppGlobal.FixAppointmentEmailAddress);
            //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('We have received your appointment request, you should receive a reply or a call shortly');", true);
            PlaceMessage.Visible   = true;
            placeRightPart.Visible = false;
            Clear();

            /*}
             * else
             *  FillCapctha();*/
        }
        catch (Exception ex)
        {
            //Response.Write(ex.ToString());
        }
    }