protected void btnConfirm_Click(object sender, EventArgs e)
        {
            try
            {
                if (Session["Student_Exam"] != null && Request.QueryString["Type"] == "Schedule")
                {
                    BStudent  objBStudent  = new BStudent();
                    BEStudent objBEStudent = (BEStudent)Session["Student_Exam"];
                    objBEStudent.IntUserID   = Convert.ToInt32(Session[BaseClass.EnumPageSessions.USERID].ToString());
                    objBEStudent.strUserName = Session["EmailID"].ToString();
                    objBEStudent.dtExam      = Convert.ToDateTime(lblDAte.Text.ToString() + " " + lblSlot.Text.ToString());
                    objBEStudent.strTimeZone = Session["SchTime"].ToString();
                    objBStudent.BScheduleAnExam(objBEStudent);
                    trButtons.Visible     = false;
                    trMessage.Visible     = true;
                    Session["TimeZoneID"] = Session["SchTime"].ToString();
                    switch (Session["SchTime"].ToString())
                    {
                    case "1": Session["TimeZone"] = "CT";
                        break;

                    case "2": Session["TimeZone"] = "ET";
                        break;

                    case "3": Session["TimeZone"] = "PT";
                        break;

                    case "4": Session["TimeZone"] = "MT";
                        break;
                    }
                    LinkButton lblTzone = this.Master.FindControl("lbtnTimeZone") as LinkButton;
                    lblTzone.Text = "[ " + Session["TimeZone"].ToString() + " ]";
                    //lblMsg.Text = "Your Exam is Scheduled Successfully. An email has been sent to you providing instructions";
                    lblMsg.Text           = Resources.ResMessages.Student_ExamdetConfirmSchedule;
                    lblTransactionID.Text = objBEStudent.IntTransID.ToString();
                    //try
                    //{
                    //    EmailMsg obj = new EmailMsg();
                    //    obj.StudentExamReceipt(Convert.ToInt32(objBEStudent.IntTransID.ToString()), objBEStudent.IntUserID, objBEStudent.strUserName);
                    //    obj = null;
                    //}
                    //catch
                    //{
                    //}

                    try
                    {
                        BEMail objBEMail = new BEMail();
                        BMail  objBMail  = new BMail();
                        objBEMail.IntUserID       = 0;
                        objBEMail.IntTransID      = objBEStudent.IntTransID;
                        objBEMail.StrTemplateName = BaseClass.EnumEmails.StudentExamReceipt.ToString();

                        //objBMail.BSendEmail(objBEMail);
                        //objBEMail.StrTemplateName = BaseClass.EnumEmails.ExamConfirmationProctorFYI.ToString();

                        objBMail.BSendEmail(objBEMail);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                else if (Session["Student_ReExam"] != null && Request.QueryString["Type"] == "Schedule")
                {
                    BStudent  objBStudent  = new BStudent();
                    BEStudent objBEStudent = (BEStudent)Session["Student_ReExam"];
                    objBEStudent.dtExam      = Convert.ToDateTime(Request.QueryString["ScheduleDetails"].ToString());
                    objBEStudent.IntTransID  = Convert.ToInt64(lblTransactionID.Text.Trim().ToString());
                    objBEStudent.IntUserID   = Convert.ToInt32(Session[BaseClass.EnumPageSessions.USERID].ToString());
                    objBEStudent.strUserName = Session["EmailID"].ToString();
                    objBEStudent.strTimeZone = Session["SchTime"].ToString();
                    objBStudent.BReScheduleAnExam(objBEStudent);
                    trButtons.Visible     = false;
                    trMessage.Visible     = true;
                    Session["TimeZoneID"] = Session["SchTime"].ToString();
                    switch (Session["SchTime"].ToString())
                    {
                    case "1": Session["TimeZone"] = "CT";
                        break;

                    case "2": Session["TimeZone"] = "ET";
                        break;

                    case "3": Session["TimeZone"] = "PT";
                        break;

                    case "4": Session["TimeZone"] = "MT";
                        break;
                    }
                    LinkButton lblTzone = this.Master.FindControl("lbtnTimeZone") as LinkButton;
                    lblTzone.Text = "[ " + Session["TimeZone"].ToString() + " ]";
                    //lblMsg.Text = "Your Exam is ReScheduled Successfully. An email has been sent to you providing instructions";
                    lblMsg.Text = Resources.ResMessages.Student_ExamdetConfirmReSchedule;

                    try
                    {
                        BEMail objBEMail = new BEMail();
                        BMail  objBMail  = new BMail();
                        objBEMail.IntUserID       = 0;
                        objBEMail.IntTransID      = Convert.ToInt64(lblTransactionID.Text.Trim().ToString());
                        objBEMail.StrTemplateName = BaseClass.EnumEmails.ReScheduleConfirmation.ToString();

                        //objBMail.BSendEmail(objBEMail);
                        //objBEMail.StrTemplateName = BaseClass.EnumEmails.ReScheduleConfirmationProctorFYI.ToString();

                        objBMail.BSendEmail(objBEMail);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                    //try
                    //{
                    //    EmailMsg obj = new EmailMsg();
                    //    obj.StudentExamRescheduleReceipt(Convert.ToInt32(AppSecurity.Decrypt(Request.QueryString["ReTransID"].ToString())), objBEStudent.IntUserID, objBEStudent.strUserName);
                    //    obj = null;
                    //}
                    //catch
                    //{
                    //}
                }
            }
            catch (Exception)
            {
                //  ErrorLog.WriteError(Ex);
            }
        }