protected void btnSendSMS_Click(object sender, EventArgs e)
 {
     try
     {
         SMSCAPI obj = new SMSCAPI();
         string  strPostResponse;
         StudentRegistrationDAL d = new StudentRegistrationDAL();
         //strPostResponse = obj.SendSMS("", "", "+" + d.GetCheckMobileContact(Request.QueryString["LinkId"].ToString()), "Dear Student, The result of the placement exam is published and can be checked through the student portal.");
         SendEmail1.SendEmail("*****@*****.**", d.GetCheckMailContact(Request.QueryString["LinkId"].ToString()), "Placement Result", "Dear Student, The result of the placement exam is published and can be checked through the student portal.", "");
     }
     catch
     {
     }
 }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            StudentRegistrationDAL s = new StudentRegistrationDAL();
            if (s.IsRegNoUsed(txtRegNo.Text) == 0)
            {
                int LinkId = 0;
                try
                {
                    LinkId = int.Parse(Request.QueryString["Id"].ToString());
                }
                catch
                {
                }
                lblMesag.Text = "";
                if (!IsMobileNoUsed())
                {
                    if (txtRegNo.Text != GeTLastRegNo())
                    {
                        if (ddlNationality.SelectedValue == "0".ToString())

                        {
                            lblMesag.Text      = "Nationality required";
                            lblMesag.ForeColor = System.Drawing.Color.Red;
                            return;
                        }
                        DateTime Dob = DateTime.Now;
                        if (txtDobDate.Text != "")
                        {
                            Dob = DateTime.Parse(txtDobYear.Text + "/" + txtDobMonth.Text + "/" + txtDobDate.Text);
                        }
                        string RegisterNo = s.InsertStudentDetails(LinkId, txtRegNo.Text, DateTime.Parse(txtCallDate.Text),
                                                                   int.Parse(ddlGender.SelectedValue), int.Parse(ddlTitle.SelectedValue), txtFirstName.Text, txtMiddleName.Text, txtLastName.Text, txtArabicFirstName.Text,
                                                                   txtArabicMiddleName.Text, txtArabicLastName.Text, ddlNationality.SelectedValue, Session["EMPID"].ToString(), "0",
                                                                   "0", "", "New Registration", "1", "4", "", txtMobileNo.Text,
                                                                   txtEmailID.Text, "0", "0", "0", Session["EmpId"].ToString(), "", "", txtPhoneNo.Text, "",
                                                                   "", "", "", "", "", "", "", "", "1", txtMotherTongue.Text, ddlProficiencyInEnglish.SelectedValue, Dob, ddlBloodGroup.SelectedValue, "0", ddlInternationalStudent.SelectedItem.Text, "0", chkaptitude.Checked);



                        lblMesag.Text      = "Sucessfully Submitted!!!";
                        lblMesag.ForeColor = System.Drawing.Color.Blue;
                        if (RegisterNo == "")
                        {
                            lblMesag.Text      = "Please Try Again!!!";
                            lblMesag.ForeColor = System.Drawing.Color.Red;
                            return;
                        }
                        SMSCAPI obj = new SMSCAPI();
                        string  strPostResponse;
                        //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for Enrolling with SUC. For further assistance feel free to contact us +97165441155");
                        //Response.Redirect("StudentRegistration.aspx", false);
                        //ResetField();
                        //this.FillGridViewAll();
                        btnSave.Enabled    = false;
                        btnCancel.Visible  = true;
                        btnDetails.Visible = true;
                        if (LinkId == 0)
                        {
                            DataTable dt = s.GetLinkId(0);
                            foreach (DataRow ro in dt.Rows)
                            {
                                LinkId = int.Parse(ro["Id"].ToString());
                            }
                        }
                        Response.Redirect(string.Format("StudentRegistration.aspx?Id={0}", LinkId), false);
                    }
                    else
                    {
                        lblMesag.Text      = txtRegNo.Text + " is booked by other User Plz Submit Again!";
                        lblMesag.ForeColor = System.Drawing.Color.Red;
                        txtRegNo.Text      = GeTRegNo();
                    }
                }
                else
                {
                    lblMesag.Text      = "This Mobile No is already Registered!";
                    lblMesag.ForeColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                lblMesag.Text      = txtRegNo.Text + " is booked by other User Plz Submit Again!";
                lblMesag.ForeColor = System.Drawing.Color.Red;
                txtRegNo.Text      = GeTRegNo();
            }
        }
        catch (Exception ex)
        {
            lblMesag.Text      = "Please Try Again!!!";
            lblMesag.ForeColor = System.Drawing.Color.Red;
        }
    }
    public void SendEmail()
    {
        //For Email
        string  ToEmail = txtEmailID.Text;
        string  Name    = txtFirstName.Text + ",";
        string  Mesag   = "";
        SMSCAPI obj     = new SMSCAPI();
        string  strPostResponse;

        if (ddlStudentStatus.SelectedValue == "2")
        {
            Mesag = "<table>";
            Mesag = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>Greetings from Skyline University College (SUC)! ";
            Mesag = Mesag + "</td></tr><tr><td>";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for calling Skyline University College, we hope that you were able to get all necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor, if you need further information kindly feel free to get in touch with " + txtAttendedBy.Text + ". Looking forward to seeing you at the University";
            Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for calling us. We hope that you were able to get all necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text + " Looking forward to seeing you at the University.";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";
            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for enquiring about our Programs at SUC. For more information, please visit us between 9:30am and  9:30pm or visit  www.skylineuniversity.ac.ae");
            //strPostResponse = obj.SendSMS("", "", "+971556460999" , "Thank you for enquiring about our Programs at SUC. For more information, please visit us between 9:30am and  9:30pm or visit  www.skylineuniversity.ac.ae");
        }
        if (ddlStudentStatus.SelectedValue == "1")
        {
            string eventname = "";
            Mesag     = "<table>";
            Mesag     = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr> <tr><td>Greetings from Skyline University College (SUC)!";
            Mesag     = Mesag + "</td></tr><tr><td>";
            eventname = ddlExhibition.SelectedItem.Text;
            try
            {
                if ((eventname == "SELECT") || (eventname == "Select"))
                {
                    Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
                }
                else
                {
                    Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at " + eventname + " . We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
                }
            }
            catch
            {
                Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
            }
            //Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
            //Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";
            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            //SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            try
            {
                if ((eventname == "SELECT") || (eventname == "Select"))
                {
                    //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for visiting us at "+ eventname +". For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
                }
                else
                {
                    //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for enquiring about our Programs at `SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
                }
            }
            catch
            {
                //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for enquiring about our Programs at `SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
            }

            //strPostResponse = obj.SendSMS("", "", "+971556460999", "Thank you for enquiring about our Programs at SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
        }


        if (ddlStudentStatus.SelectedValue == "9")
        {
            string eventname = "";
            Mesag     = "<table>";
            Mesag     = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr> <tr><td>Greetings from Skyline University College (SUC)!";
            Mesag     = Mesag + "</td></tr><tr><td>";
            eventname = ddlExhibition.SelectedItem.Text;
            try
            {
                Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at " + eventname + " . We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with " + txtAttendedBy.Text;
            }
            catch
            {
                Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with " + txtAttendedBy.Text;
            }
            //Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
            //Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";
            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            //SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            try
            {
                //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for visiting us at " + eventname + ". For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
            }
            catch
            {
                //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for enquiring about our Programs at `SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
            }

            //strPostResponse = obj.SendSMS("", "", "+971556460999", "Thank you for enquiring about our Programs at SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
        }
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            //pnlForStudent.Visible = true;
            StudentRegistrationDAL s = new StudentRegistrationDAL();
            int submenuid            = 0;

            try
            {
                if (int.Parse(ddlStudentStatus.SelectedValue) == 6)
                {
                    if (int.Parse(DrpNQ.SelectedValue) == 0)
                    {
                        lblMesag.Text      = "Please Select  Not Interested Reason!";
                        lblMesag.ForeColor = System.Drawing.Color.Red;
                        return;
                    }
                    else
                    {
                        submenuid = int.Parse(DrpNQ.SelectedValue);
                    }
                }
                else
                {
                    submenuid = 0;
                }
            }

            catch
            {
                submenuid = 0;
            }


            if (txtRemarks.Text != "")
            {
                try
                {
                    string Result = s.InsertFollowUpExisting(Request.QueryString["Id"].ToString(), DateTime.Parse(txtCallDate.Text), ddlStudentStatus.SelectedValue, ddlForwardedTo1.SelectedValue, txtRemarks.Text, int.Parse(Session["EMPID"].ToString()), submenuid);

                    if (Result == "error")
                    {
                        lblMesag.Text      = "Try again !!!";
                        lblMesag.ForeColor = System.Drawing.Color.Red;
                        return;
                    }


                    try
                    {
                        string MissedCall = Request.QueryString["A"].ToString();
                        if (Request.QueryString["A"] != null)
                        {
                            if (MissedCall == "F")
                            {
                                string Result1 = s.UpdateFollowUpschedule(Request.QueryString["Id"].ToString());
                            }



                            if (MissedCall == "V")
                            {
                                string Result2 = s.UpdateVisitschedule(Request.QueryString["Id"].ToString());
                            }
                        }
                    }
                    catch
                    {
                    }



                    try
                    {
                        s.InsertOtherFollowup(int.Parse(Request.QueryString["Id"].ToString()), chkPaymentMode.Checked, chkProvCerticate.Checked, int.Parse(Session["EmpId"].ToString()));
                        s.InsertFollowupschedule(int.Parse(Request.QueryString["Id"].ToString()), txtFromDate.Text, int.Parse(Session["EmpId"].ToString()));
                    }
                    catch
                    {
                    }

                    try
                    {
                        if (int.Parse(ddlStudentStatus.SelectedValue) == 1)
                        {
                            s.InsertVisitschedule(int.Parse(Request.QueryString["Id"].ToString()), txtVisitDate.Text, int.Parse(Session["EmpId"].ToString()));
                        }
                    }
                    catch
                    {
                    }


                    string confirmValue = Request.Form["confirm_value"];
                    if (confirmValue == "Yes")
                    {
                        if (chkEmail.Checked == true)
                        {
                            string ToEmail = txtEmailID.Text;
                            string Name    = txtFirstName.Text + ",";
                            string Mesag   = "";
                            Mesag = "<table>";
                            Mesag = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr> <tr><td> Greetings from Skyline University College (SUC)!";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for sparing your time for the follow up call made by  " + txtAttendedBy.Text + "your admission counselor from SUC. We hope that all your queries have been answered. We look forward to receiving you at the university for further guidance on your pursuit of higher education.";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
                            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
                            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";

                            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Registration Follow Up", Mesag, "");
                            //SendEmails.SendEmail2("*****@*****.**", ToEmail, "Registration Follow Up", Mesag, "");
                        }


                        if (chkEmail1.Checked == true)
                        {
                            string ToEmail = txtEmailID.Text;
                            string Name    = txtFirstName.Text + ",";
                            string Mesag   = "";
                            Mesag = "<table>";
                            Mesag = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr> <tr><td> Greetings from Skyline University College (SUC)!";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>" + "we were unable to reach you and follow up on your admission query. Kindly feel free to contact us for any clarification. Call +97165441155 Thank you";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
                            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
                            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";
                            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Registration Follow Up", Mesag, "");
                        }


                        if (chkSms.Checked == true)
                        {
                            SMSCAPI obj = new SMSCAPI();
                            string  strPostResponse;
                            //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for attending " + txtAttendedBy.Text + "'s call. We are glad to guide you further.  Visit  www.skylineuniversity.ac.ae for more information.");
                            //strPostResponse = obj.SendSMS("", "", "+971556460999", "Thank you for attending " + txtAttendedBy.Text + "'s call. We are glad to guide you further.  Visit  www.skylineuniversity.ac.ae for more information.");
                        }
                        if (chkSms1.Checked == true)
                        {
                            string  Name = txtFirstName.Text + ",";
                            SMSCAPI obj  = new SMSCAPI();
                            string  strPostResponse;
                            //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, " We were unable to reach you and follow up on your admission query. Kindly feel free to contact us for any clarification. Call +97165441155 Thank you..Visit  www.skylineuniversity.ac.ae for more information.");
                            //strPostResponse = obj.SendSMS("", "", "+971503530812", "we were unable to reach you and follow up on your admission query. Kindly feel free to contact us for any clarification. Call +97165441155 Thank you.Visit  www.skylineuniversity.ac.ae for more information.");
                        }
                    }
                }

                catch
                {
                }
                lblMesag.Text      = "Sucessfully Updated!!!";
                lblMesag.ForeColor = System.Drawing.Color.Blue;
                //alertmessage.Show("Data Updated Successfully!");
                //Response.Redirect("FollowUpReport.aspx", false);
                FillGridView();
            }
            else
            {
                lblMesag.Text      = "Remarks Required";
                lblMesag.ForeColor = System.Drawing.Color.Red;
                return;
            }
        }
        catch
        {
            //alertmessage.Show("Please Try Again!");
            lblMesag.Text      = "Try Again!";
            lblMesag.ForeColor = System.Drawing.Color.Red;
        }
    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        // for email
        try
        {
            string  SMSResponse      = "";
            SMSCAPI obj              = new SMSCAPI();
            StudentRegistrationDAL s = new StudentRegistrationDAL();
            string ToEmail           = "";
            for (int i = 0; i < gvStudentList.Rows.Count; i++)
            {
                GridViewRow row           = gvStudentList.Rows[i];
                Label       lblEmail      = (Label)row.FindControl("lblEmail");
                HiddenField hdMobile      = (HiddenField)row.FindControl("hdMobile");
                LinkButton  lnkId         = (LinkButton)row.FindControl("lnkId");
                CheckBox    chkAll        = (CheckBox)row.FindControl("chkAll");
                bool        EmailResponse = false;
                //string SMSResponse = "";
                if (chkAll.Checked == true)
                {
                    ToEmail = lblEmail.Text;
                    if (chkEmail.Checked == true)
                    {
                        try
                        {
                            if (ToEmail != "")
                            {
                                EmailResponse = SendEmail1.SendBulkEmail(txtFromEmail.Text, ToEmail, txtSubject.Text, editor.Content, "");
                                //EmailResponse = SendEmail1.SendBulkEmail(txtFromEmail.Text, "", txtSubject.Text, editor.Content, "");
                            }
                        }
                        catch
                        {
                        }
                    }
                    if (chkSendSMS.Checked == true)
                    {
                        //for sms
                        try
                        {
                            SMSResponse = obj.SendSMS("", "", "+" + hdMobile.Value, txtSmsContent.Text);
                        }
                        catch
                        {
                        }
                    }
                    try
                    {
                        string RegisterNo = s.InsertMailLog(lnkId.CommandArgument.ToString(), EmailResponse.ToString(), SMSResponse, txtSmsContent.Text, editor.Content);
                        if (RegisterNo == "RegisterNo")
                        {
                            lblMessage.Text      = "Send Sucessfully!";
                            lblMessage.ForeColor = System.Drawing.Color.Blue;
                        }
                    }
                    catch
                    {
                    }
                }
            }

            try
            {
                SMSResponse = obj.SendSMS("", "", "+" + "+971505240146", txtSmsContent.Text);
                SMSResponse = obj.SendSMS("", "", "+" + "+971554783385", txtSmsContent.Text);
            }
            catch
            {
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text      = "Send Sucessfully!";
            lblMessage.ForeColor = System.Drawing.Color.Blue;
        }
    }