//Begin PC Phase II changes CH1 - Removed the ImageButton "btnConfirmReissue" attributes and methods.

        /* #region btnConfirmReissue_Click
         * protected void btnConfirmReissue_Click(object sender, System.Web.UI.ImageClickEventArgs e)
         * {
         *      //Calls the Receipt_Reissue SP
         *      OrderClasses.ReportCriteria ReceiptCrit1 = (OrderClasses.ReportCriteria)Session["ReissueInfo"];
         *      TurninClasses.Service.Turnin TurninService = new TurninClasses.Service.Turnin();
         *      string strNewReceiptNumber = "";
         *      strNewReceiptNumber = TurninService.ReceiptReIssue(ReceiptCrit1);
         *
         *      if (strNewReceiptNumber.Length > 0)
         *      {
         *              //Clear all the sessions when the operation is complete.
         *              Session["ReissueInfo"] = null;
         *              Session["VoidInfo"] = null;
         *              Session["PaymentType"] = null;
         *              Response.Redirect ("Reissue_Confirmation.aspx?ReceiptNumber=" + strNewReceiptNumber.ToString(),true);
         *      }
         *      else
         *      {
         *              InsRptLibrary InsMessage = new InsRptLibrary();
         *              InsMessage.SetMessage(lblErrMsg,"Reissue Failed",true);
         *              lblErrMsg.Visible = true;
         *      }
         *
         * }
         #endregion
         */
        //End PC Phase II changes CH1 - Removed the ImageButton "btnConfirmReissue" attributes and methods.
        #region btnConfirmVoid_Click
        protected void btnConfirmVoid_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            //Calls the Receipt_Void SP
            OrderClasses.ReportCriteria  ReceiptCrit1  = (OrderClasses.ReportCriteria)Session["VoidInfo"];
            TurninClasses.Service.Turnin TurninService = new TurninClasses.Service.Turnin();
            //Begin PC Phase II changes CH2 - Modified the Void flow by validating APDS application to existing flow else invoke PC IDPReversal service.
            string Appname = TurninService.PCVoidFlowCheck(ReceiptCrit1.ReceiptNumber);

            if (Appname.ToUpper().Equals(CSAAWeb.Constants.PC_APPID_PAYMENT_TOOL))
            {
                int NoOfRowsAffected = TurninService.ReceiptVoid(ReceiptCrit1);
                if (NoOfRowsAffected > 0)
                {
                    //Clear all the sessions when the operation is complete.
                    Session["ReissueInfo"] = null;
                    Session["VoidInfo"]    = null;
                    Session["PaymentType"] = null;
                    //PC Security Defect Fix CH1 -Added the below line to re-direct to the first page on success Turn-in
                    Response.Redirect("SalesTurnIn_Report.aspx");
                }
                else
                {
                    InsRptLibrary InsMessage = new InsRptLibrary();
                    InsMessage.SetMessage(lblErrMsg, "Void Failed", true);
                    lblErrMsg.Visible = true;
                }
            }
            else
            {
                List <string> IDPReversal_Response = new List <string>();
                string        msg = "";
                OrderClassesII.IssueDirectPaymentWrapper IDPWrapper = new OrderClassesII.IssueDirectPaymentWrapper();
                IDPReversal_Response = IDPWrapper.IDPReversal(ReceiptCrit1.ReceiptNumber, CSAAWeb.Constants.PC_VOID_STATUS, Page.User.Identity.Name.ToString());
                if (IDPReversal_Response.Count > 0)
                {
                    Session["BackBtnFlow"] = "PCONLINE";
                    btnConfirmVoid.Enabled = false;
                    A1.Disabled            = true;
                    if (IDPReversal_Response[0].ToString().Equals("SUCC"))
                    {
                        msg = "The receipt number " + ReceiptCrit1.ReceiptNumber + " has been voided. The voided receipt number is " + IDPReversal_Response[1].ToString();
                        InsRptLibrary InsMessage = new InsRptLibrary();
                        InsMessage.SetMessage(lblErrMsg, msg, true);
                        lblErrMsg.Visible = true;
                        //PC Security Defect Fix CH2 -Added the below line to re-direct to the first page on success Turn-in
                        Response.Redirect("SalesTurnIn_Report.aspx");
                    }
                    else
                    {
                        msg = IDPReversal_Response[0] + " " + IDPReversal_Response[1];
                        InsRptLibrary InsMessage = new InsRptLibrary();
                        InsMessage.SetMessage(lblErrMsg, msg, true);
                        lblErrMsg.Visible = true;
                    }
                }
            }
            //PC Security Defect Fix CH3 -Commented the below line to re-direct to the first page on success Turn-in and to retain on the same page for failure turn-in process
            //Response.Redirect("SalesTurnIn_Report.aspx");
            VoidAck.Visible    = false;
            lblVoidAck.Visible = false;


            //End PC Phase II changes CH2 - Modified the Void flow by validating APDS application to existing flow else invoke PC IDPReversal service.
        }