protected void btnApprove_Click(object sender, EventArgs e)
        {
            string strTransID = string.Empty;

            //foreach (GridViewRow row in gvAuditorInbox.Rows)
            //{
            //    CheckBox chk = (CheckBox)row.Cells[0].FindControl("chkSelect");
            //    if (chk.Checked == true)
            //    {
            //        Label lbl = (Label)row.Cells[1].FindControl("lblExamID");
            //        strTransID = strTransID + lbl.Text.ToString() + "$";
            //    }
            //}

            foreach (GridDataItem item in gvAuditorInbox.Items)
            {
                CheckBox chk = (CheckBox)item.Cells[0].FindControl("chkSelect");
                if (chk.Checked == true)
                {
                    Label lbl = (Label)item.Cells[1].FindControl("lblExamID");
                    strTransID = strTransID + lbl.Text.ToString() + "$";
                }
            }
            if (strTransID != string.Empty)
            {
                strTransID = strTransID.Substring(0, strTransID.Length - 1);
                BEAuditor objBEAuditor = new BEAuditor();
                BAuditor  objBAuditor  = new BAuditor();
                objBEAuditor.strTransID    = strTransID;
                objBEAuditor.IntEmployeeID = Convert.ToInt32(Session[BaseClass.EnumPageSessions.USERID]);
                objBAuditor.BApproveTransaction(objBEAuditor);
                objBEAuditor = null;
                objBAuditor  = null;
                //foreach (GridDataItem item in gvAuditorInbox.Items)
                //{
                //    CheckBox chk = (CheckBox)item.Cells[0].FindControl("chkSelect");
                //    //EmailMsg obj;
                //    if (chk.Checked == true)
                //    {
                BEAuditor objBEAuditor1 = new BEAuditor();
                BAuditor  objBAuditor1  = new BAuditor();
                objBEAuditor1.strTransID = strTransID;

                objBAuditor1.BGetAuditorProviderDetails(objBEAuditor1);
                if (objBEAuditor1.DsResult.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < objBEAuditor1.DsResult.Tables[0].Rows.Count; i++)
                    {
                        DataTable objDT = new DataTable();

                        objDT = objBEAuditor1.DsResult.Tables[0];

                        objBEAuditor1.IntUserID = Convert.ToInt32(objDT.Rows[i]["ExamProviderID"]);

                        objBEAuditor1.IntProviderID = Convert.ToInt32(objDT.Rows[i]["UserID"]);

                        objBEAuditor1.IntTransID = Convert.ToInt64(objDT.Rows[i]["TransID"]);


                        BEMail objBEMail = new BEMail();
                        BMail  objBMail  = new BMail();
                        objBEMail.IntTransID = objBEAuditor1.IntTransID;
                        string FYI = "FYI";
                        //string mail = "Mail";
                        //if (mail == "Mail")
                        //{
                        //    objBEMail.IntUserID = objBEAuditor1.IntUserID;
                        //    objBEMail.StrTemplateName = BaseClass.EnumEmails.ExamApprovedbyAuditor.ToString();
                        //    objBMail.BSendEmail(objBEMail);

                        //}

                        if (FYI == "FYI")
                        {
                            BECommon objBECommon = new BECommon();
                            BCommon  objBCommon  = new BCommon();
                            objBECommon.IntTransID = objBEAuditor1.IntTransID;
                            objBCommon.BAuditorCheckEmailForApproval(objBECommon);

                            if (objBECommon.IntstatusFlag == 1)
                            {
                                objBEMail.IntUserID = objBEAuditor1.IntUserID;

                                objBEMail.StrTemplateName = BaseClass.EnumEmails.ExamApprovedbyAuditorFYI.ToString();
                                objBMail.BSendEmail(objBEMail);
                            }
                        }
                    }



                    // Label lbl = (Label)item.Cells[1].FindControl("lblExamID");
                }


                lblSuccess.Text = Resources.ResMessages.Audit_TransApprove;

                // this.LoadData();
                gvAuditorInbox.Rebind();
            }

            else
            {
                lblSuccess.Text = Resources.ResMessages.Audit_TransSelect;
            }
        }
        protected void Confirm_Click(object sender, EventArgs e)
        {
            try
            {
                BECommon objBECommon = new BECommon();
                BCommon  objBCommon  = new BCommon();
                if (Request.QueryString["type"].ToString() == "1")
                {
                    objBECommon.IntTransID = Convert.ToInt64(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString()));
                    objBCommon.BGetExamProviderDetails(objBECommon);
                    if (objBECommon.DsResult.Tables[0].Rows.Count > 0)
                    {
                        //  objBECommon.StrEmailID = objBECommon.DsResult.Tables[0].Rows[0]["StudentEmail"].ToString();
                        objBECommon.IntUserID     = Convert.ToInt32(objBECommon.DsResult.Tables[0].Rows[0]["UserID"]);
                        objBECommon.IntProviderID = Convert.ToInt32(objBECommon.DsResult.Tables[0].Rows[0]["ProviderUserID"]);
                        // objBECommon.strProviderEmailID = objBECommon.DsResult.Tables[0].Rows[0]["ExamProviderEmail"].ToString();
                    }

                    Approve_Transaction(1);

                    try
                    {
                        //EmailMsg obj = new EmailMsg();
                        //obj.ExamApprovedStudent(Convert.ToInt32(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString())),"Approved");
                        //obj.ExamApprovedProvider(Convert.ToInt32(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString())),"Approved");
                        //obj = null;

                        BEMail objBEMail = new BEMail();
                        BMail  objBMail  = new BMail();
                        objBEMail.IntTransID = objBECommon.IntTransID;
                        string FYI = "FYI";
                        //string mail = "Mail";
                        //if (mail == "Mail")
                        //{
                        //    objBEMail.IntUserID = objBECommon.IntUserID;

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

                        //}

                        if (FYI == "FYI")
                        {
                            objBECommon.IntTransID = Convert.ToInt64(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString()));
                            objBCommon.BAuditorCheckEmailForApproval(objBECommon);
                            if (objBECommon.IntstatusFlag == 1)
                            {
                                objBEMail.IntUserID = objBECommon.IntProviderID;

                                objBEMail.StrTemplateName = BaseClass.EnumEmails.ExamApprovedbyAuditorFYI.ToString();
                                objBMail.BSendEmail(objBEMail);
                            }
                        }
                    }

                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }
            catch (Exception)
            {
            }
        }