protected void btnSumbit_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        //Bill_Sys_CheckoutBO _objcheckOut = new Bill_Sys_CheckoutBO();
        //Bill_Sys_NF3_Template objNF3Template = new Bill_Sys_NF3_Template();
        //string sz_CompanyID = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        //string sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        //string sz_EventID = "5";// Session["AC_INITIAL_EVENT_ID"].ToString();

        ////DataSet dsObj = _objcheckOut.PatientName(sz_EventID);
        //Session["AC_Initial_CaseID"] = "5";//dsObj.Tables[0].Rows[0][1].ToString();
        // Session["ChkOutCaseID"] = "5";
        //int flag = 0;
        //string DoctorImagePath = "";
        ////string PatientImagePath = Session["PatientImagePath"].ToString();
        //string CaseBarcodePath = "";

        Bill_Sys_CheckoutBO   _objcheckOut   = new Bill_Sys_CheckoutBO();
        Bill_Sys_NF3_Template objNF3Template = new Bill_Sys_NF3_Template();
        string sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        string sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        Bill_Sys_CheckoutBO _obj  = new Bill_Sys_CheckoutBO();
        DataSet             dsObj = _obj.PatientName(Session["AC_INITIAL_EVENT_ID"].ToString());

        Session["AC_Initial_CaseID"] = dsObj.Tables[0].Rows[0][1].ToString();

        string sz_EventID      = Session["AC_INITIAL_EVENT_ID"].ToString();
        int    flag            = 0;
        string DoctorImagePath = "";
        //string PatientImagePath = Session["PatientImagePath"].ToString();
        string CaseBarcodePath            = "";
        string sz_BarcodeImagePathlogical = "";
        string CaseBarcodePathlogical     = "";

        try
        {
            String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Initial_CaseID"].ToString() + "/Signs/";
            //Added By-Sunil
            string SaveSignPath = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Initial_CaseID"].ToString() + "/Signs/";
            //end
            if (!Directory.Exists(szDefaultPath))
            {
                Directory.CreateDirectory(szDefaultPath);
            }
            szDefaultPath = szDefaultPath + sz_EventID;
            //Added by --Sunil
            SaveSignPath = SaveSignPath + sz_EventID;
            //end
            if (WebSignature2.ExportToStreamOnly())
            {
                System.IO.MemoryStream imgstream2 = (System.IO.MemoryStream)(WebSignature2.ImageMemoryStream);
                {
                    if (imgstream2 != null)
                    {
                        byte[] imageContent2 = new Byte[imgstream2.Length];
                        imgstream2.Position = 0;
                        imgstream2.Read(imageContent2, 0, (int)imgstream2.Length);
                        Response.ContentType = "image/jpeg";
                        Response.BinaryWrite(imageContent2);
                        Bitmap bmp  = new Bitmap(imgstream2);
                        double size = 0.15;
                        ResizeImage((System.Drawing.Image)bmp, size);
                        DoctorImagePath = szDefaultPath + "_DoctorSign.jpg";
                        //DoctorImagePathlogical = SaveSignPath + "_DoctorSign.jpg";
                        Img.Save(DoctorImagePath);

                        // System.IO.File.WriteAllBytes("C://LawAllies//MBSUpload//docsign.jpg", imageContent2);

                        string  sz_case_id = Session["AC_Initial_CaseID"].ToString();
                        DataSet dset       = new DataSet();
                        dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
                        string sz_NodeId = dset.Tables[0].Rows[0][1].ToString();
                        string sz_CaseId = dset.Tables[0].Rows[0][0].ToString();
                        // string barcodeValue = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
                        //GenerateBarcode(barcodeValue);
                        String sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + sz_case_id + "/Signs/";
                        //Added By-Sunil
                        sz_BarcodeImagePathlogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + sz_case_id + "/Signs/";
                        //end
                        SpecialityPDFBO pdfbo = new SpecialityPDFBO();
                        CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
                        //Added By-Sunil
                        CaseBarcodePathlogical = sz_BarcodeImagePathlogical + "BarcodeImg.jpg";
                        //end
                        //CaseBarcodePath = sz_BarcodeImagePath + "BarcodeImg.jpg";
                        //Img.Save(CaseBarcodePath);
                        //flag = 0;
                    }
                    else
                    {
                        flag = 2;
                    }
                }
            }

            _objcheckOut.updateAccInitialDoctorPath(sz_EventID, DoctorImagePath, CaseBarcodePath);
            //_objcheckOut.updateAccInitialDoctorPath(sz_EventID, DoctorImagePathlogical, CaseBarcodePathlogical);
            //FillPDFValue(sz_EventID, sz_CompanyID, sz_CompanyName);
            SpecialityPDFFill spf = new SpecialityPDFFill();
            ArrayList         obj = new ArrayList();
            spf.sz_EventID     = Session["AC_INITIAL_EVENT_ID"].ToString();
            spf.sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            spf.sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;

            spf.sz_XMLPath = "Accu_Initial_XML_Path";
            spf.sz_PDFPath = "Accu_Initial_PDF_Path";

            spf.sz_Session_Id      = Session["AC_Initial_CaseID"].ToString();
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.SZ_SPECIALITY_NAME = "AC";
            obj = spf.FillPDFValue(spf);
            Response.Redirect(obj[1].ToString(), false);
            //Page.ClientScript.RegisterClientScriptBlock(typeof(GridView), "Msg", "window.open('" + obj[1] + "'); ", true);
            //Response.Write("<script>window.open('" + obj[1] + "')</script>");

            spf.sz_Session_Id      = Session["AC_Initial_CaseID"].ToString();;
            spf.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            spf.sz_EventID         = Session["AC_INITIAL_EVENT_ID"].ToString();
            spf.SZ_PT_FILE_NAME    = obj[0].ToString();
            spf.SZ_PT_FILE_PATH    = obj[2].ToString();
            spf.SZ_SPECIALITY_CODE = "NFMAC";
            spf.SZ_SPECIALITY_NAME = "AC";
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.savePDFForminDocMang(spf);
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        _objcheckOut = new Bill_Sys_CheckoutBO();
        DigitalSign signobj = new DigitalSign();

        objNF3Template = new Bill_Sys_NF3_Template();
        // DataSet dsObj = _objcheckOut.PatientName(Session["IMEventID"].ToString());
        //  Session["PhysicalCaseID"] = dsObj.Tables[0].Rows[0][1].ToString();
        sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        sz_EventID     = Session["IMEventID"].ToString();
        int flag = 0;

        try
        {
            String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["PhysicalCaseID"].ToString() + "/Signs/";
            if (!Directory.Exists(szDefaultPath))
            {
                Directory.CreateDirectory(szDefaultPath);
            }
            szDefaultPath = szDefaultPath + sz_EventID;
            signobj.SignSave(Request.Form["hiddenpatient"], szDefaultPath + "_PatientSign.jpg");
            _objcheckOut.UpdatePatientPhyscalTherapySign(sz_EventID, szDefaultPath + "_PatientSign.jpg");
            DoctorImagePath = szDefaultPath + "_DoctorSign.jpg";
            signobj.SignSave(Request.Form["hidden"], DoctorImagePath);

            #region " "Barcode functionality
            DataSet dset = new DataSet();
            dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
            string          sz_NodeId           = dset.Tables[0].Rows[0][1].ToString();
            string          sz_CaseId           = dset.Tables[0].Rows[0][0].ToString();
            string          barcodeValue        = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
            String          sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["PhysicalCaseID"].ToString() + "/Signs/";
            SpecialityPDFBO pdfbo = new SpecialityPDFBO();
            CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
            #endregion

            _objcheckOut.UpdatePhysicaltherapySignPath(sz_EventID, DoctorImagePath, CaseBarcodePath);
            FillPDFValue(sz_EventID, sz_CompanyID, sz_CompanyName);
        }
        catch (Exception ex)
        {
            Label1.Text = "Page Laod :" + ex.ToString();
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        #region "check version readonly or not"
        string app_status = ((Bill_Sys_BillingCompanyObject)Session["APPSTATUS"]).SZ_READ_ONLY.ToString();
        if (app_status.Equals("True"))
        {
            Bill_Sys_ChangeVersion cv = new Bill_Sys_ChangeVersion(this.Page);
            cv.MakeReadOnlyPage("Bill_Sys_Image_Save.aspx");
        }
        #endregion
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    protected void btnSavePrint_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        Bill_Sys_CheckoutBO _objcheckOut = new Bill_Sys_CheckoutBO();

        objNF3Template = new Bill_Sys_NF3_Template();
        string sz_CompanyID = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_COMAPNY_ID;
        string sz_EventID   = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;

        try
        {
            SaveOperation _objsave = new SaveOperation();
            _objsave.WebPage  = this.Page;
            _objsave.Xml_File = "Test_Facility_Intake.xml";
            _objsave.SaveMethod();

            #region " "Barcode functionality
            DataSet dset = new DataSet();
            dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
            string sz_NodeId                  = dset.Tables[0].Rows[0][1].ToString();
            string sz_CaseId                  = dset.Tables[0].Rows[0][0].ToString();
            string barcodeValue               = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
            String sz_BarcodeImagePath        = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID + "/Signs/";
            string sz_BarcodeImagePathLogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID + "/Signs/";
            sz_BarcodeImagePathLogical = sz_BarcodeImagePathLogical + "BarcodeImg.jpg";
            if (!Directory.Exists(sz_BarcodeImagePath))
            {
                Directory.CreateDirectory(sz_BarcodeImagePath);
            }

            SpecialityPDFBO pdfbo = new SpecialityPDFBO();
            CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);

            #endregion

            //_objcheckOut.LienPatientPath(sz_EventID, "", CaseBarcodePath, "", "");
            //_objcheckOut.TestIntakeMri(sz_EventID, CaseBarcodePath, "", "", "", "");
            _objcheckOut.TestIntakeMri(sz_EventID, sz_BarcodeImagePathLogical, "", "", "", "");
            PrintPatientIntakeFillPDFValue(sz_EventID, sz_CompanyID, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME);
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        _objcheckOut = new Bill_Sys_CheckoutBO();
        DigitalSign signobj = new DigitalSign();

        objNF3Template = new Bill_Sys_NF3_Template();
        // DataSet dsObj = _objcheckOut.PatientName(Session["IMEventID"].ToString());
        Session["ChkCaseID"] = ((SpecialityPDFDAO)Session["SPECIALITY_PDF_OBJECT"]).CaseID;
        sz_CompanyID         = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        sz_CompanyName       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        sz_EventID           = ((SpecialityPDFDAO)Session["SPECIALITY_PDF_OBJECT"]).EventID;
        int flag = 0;

        try
        {
            String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["ChkCaseID"].ToString() + "/Signs/";
            //Added By-Sunil
            string SaveSignPath = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["ChkCaseID"].ToString() + "/Signs/";
            //end
            if (!Directory.Exists(szDefaultPath))
            {
                Directory.CreateDirectory(szDefaultPath);
            }
            szDefaultPath = szDefaultPath + sz_EventID;
            //Added By-Sunil
            SaveSignPath           = SaveSignPath + sz_EventID;
            DoctorImagePathlogical = SaveSignPath + "_DoctorSign.jpg";
            //end

            DoctorImagePath = szDefaultPath + "_DoctorSign.jpg";
            signobj.SignSave(Request.Form["hiddenPatient"], szDefaultPath + "_Patient.jpg");
            //_objcheckOut.UpdatePatientChairoSign(sz_EventID, szDefaultPath + "_Patient.jpg");
            _objcheckOut.UpdatePatientChairoSign(sz_EventID, SaveSignPath + "_Patient.jpg");
            signobj.SignSave(Request.Form["hidden"], DoctorImagePath);

            #region " "Barcode functionality
            DataSet dset = new DataSet();
            dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
            string sz_NodeId           = dset.Tables[0].Rows[0][1].ToString();
            string sz_CaseId           = dset.Tables[0].Rows[0][0].ToString();
            string barcodeValue        = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
            String sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["ChkCaseID"].ToString() + "/Signs/";
            //Added By-Sunil
            string sz_BarcodeImagePathlogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["ChkCaseID"].ToString() + "/Signs/";
            //end
            SpecialityPDFBO pdfbo = new SpecialityPDFBO();
            CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
            //Added By-Sunil
            string CaseBarcodePathlogical = sz_BarcodeImagePathlogical + "BarcodeImg.jpg";
            //end
            #endregion

            // _objcheckOut.UpdateChairoSign(sz_EventID, DoctorImagePath, CaseBarcodePath);
            _objcheckOut.UpdateChairoSign(sz_EventID, DoctorImagePathlogical, CaseBarcodePathlogical);
            FillPDFValue(sz_EventID, sz_CompanyID, sz_CompanyName);
            #region
            //string sz_CaseID = ((SpecialityPDFDAO)Session["SPECIALITY_PDF_OBJECT"]).CaseID;
            //PDFValueReplacement.PDFValueReplacement objValueReplacement = new PDFValueReplacement.PDFValueReplacement();
            //string pdffilepath;
            //string strGenFileName = "";
            //try
            //{
            //   // Bill_Sys_NF3_Template objNF3Template = new Bill_Sys_NF3_Template();
            //    string xmlpath = ConfigurationManager.AppSettings["MST_CHIRO_CA_XML_Path"].ToString();
            //    string pdfpath = ConfigurationManager.AppSettings["MST_CHIRO_CA_PDF_Path"].ToString();

            //     szDefaultPath = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + sz_CaseID + "/Packet Document/";
            //    String szDestinationDir = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + sz_CaseID + "/No Fault File/Medicals/CH/";

            //    strGenFileName = objValueReplacement.ReplacePDFvalues(xmlpath, pdfpath, sz_EventID, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME, sz_CaseID);

            //    if (File.Exists(objNF3Template.getPhysicalPath() + szDefaultPath + strGenFileName))
            //    {
            //        if (!Directory.Exists(objNF3Template.getPhysicalPath() + szDestinationDir))
            //        {
            //            Directory.CreateDirectory(objNF3Template.getPhysicalPath() + szDestinationDir);
            //        }
            //        File.Copy(objNF3Template.getPhysicalPath() + szDefaultPath + strGenFileName, objNF3Template.getPhysicalPath() + szDestinationDir + strGenFileName);
            //    }

            //    Bill_Sys_CheckoutBO objCheckoutBO = new Bill_Sys_CheckoutBO();
            //    ArrayList objAL = new ArrayList();
            //    objAL.Add(sz_CaseID);
            //    objAL.Add(strGenFileName);
            //    objAL.Add(szDestinationDir);
            //    objAL.Add(((Bill_Sys_UserObject)Session["USER_OBJECT"]) + sz_CaseID);
            //    objAL.Add(sz_CompanyID);
            //    objAL.Add(sz_EventID);
            //    objCheckoutBO.save_CHIRO_DocMang(objAL);
            //    // Open file
            //    String szOpenFilePath = "";
            //    szOpenFilePath = ConfigurationSettings.AppSettings["DocumentManagerURL"].ToString() + szDestinationDir + strGenFileName;
            //    Response.Redirect(szOpenFilePath, false);
            //    //Page.ClientScript.RegisterClientScriptBlock(typeof(GridView), "Msg", "window.open('" + szOpenFilePath + "'); ", true);

            //}
            //catch (Exception _ex)
            //{
            //    Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            //}
            #endregion
        }
        catch (Exception ex)
        {
            Label1.Text = "Page Laod :" + ex.ToString();

            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        #region "check version readonly or not"
        string app_status = ((Bill_Sys_BillingCompanyObject)Session["APPSTATUS"]).SZ_READ_ONLY.ToString();
        if (app_status.Equals("True"))
        {
            Bill_Sys_ChangeVersion cv = new Bill_Sys_ChangeVersion(this.Page);
            cv.MakeReadOnlyPage("Bill_Sys_Image_Save.aspx");
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        #endregion
    }
    protected void btnSumbit_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        Bill_Sys_CheckoutBO   _objcheckOut   = new Bill_Sys_CheckoutBO();
        Bill_Sys_NF3_Template objNF3Template = new Bill_Sys_NF3_Template();
        string sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        string sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        string sz_EventID     = Session["IM_FW_EVENT_ID"].ToString();


        int    flag            = 0;
        string DoctorImagePath = "";
        //string PatientImagePath = Session["PatientImagePath"].ToString();
        string CaseBarcodePath = "";

        try
        {
            String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["IM_FOLLOWUP_CaseID"].ToString() + "/Signs/";
            //Added By-Sunil
            string SaveSignPath = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["IM_FOLLOWUP_CaseID"].ToString() + "/Signs/";
            //end
            if (!Directory.Exists(szDefaultPath))
            {
                Directory.CreateDirectory(szDefaultPath);
            }
            szDefaultPath = szDefaultPath + sz_EventID;
            //Added By-Sunil
            SaveSignPath = SaveSignPath + sz_EventID;
            //end
            if (WebSignature2.ExportToStreamOnly())
            {
                System.IO.MemoryStream imgstream2 = (System.IO.MemoryStream)(WebSignature2.ImageMemoryStream);
                {
                    if (imgstream2 != null)
                    {
                        byte[] imageContent2 = new Byte[imgstream2.Length];
                        imgstream2.Position = 0;
                        imgstream2.Read(imageContent2, 0, (int)imgstream2.Length);
                        Response.ContentType = "image/jpeg";
                        Response.BinaryWrite(imageContent2);
                        Bitmap bmp  = new Bitmap(imgstream2);
                        double size = 0.15;
                        ResizeImage((System.Drawing.Image)bmp, size);
                        DoctorImagePath = szDefaultPath + "_DoctorSign.jpg";
                        Img.Save(DoctorImagePath);
                        DataSet dset = new DataSet();
                        dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);

                        string sz_NodeId = dset.Tables[0].Rows[0][1].ToString();
                        string sz_CaseId = dset.Tables[0].Rows[0][0].ToString();

                        String          sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["IM_FOLLOWUP_CaseID"].ToString() + "/Signs/";
                        SpecialityPDFBO pdfbo = new SpecialityPDFBO();
                        CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
                    }
                    else
                    {
                        flag = 2;
                    }
                }
            }
            string DoctorImagePathlogical = SaveSignPath + "_DoctorSign.jpg";
            //Added By-Sunil
            string sz_BarcodeImagePathlogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
            //end
            //Added By-Sunil
            string CaseBarcodePathlogical = sz_BarcodeImagePathlogical + "BarcodeImg.jpg";
            //end
            // _objcheckOut.SaveIMFollowupSignPath(sz_EventID, DoctorImagePath, CaseBarcodePath);
            _objcheckOut.SaveIMFollowupSignPath(sz_EventID, DoctorImagePathlogical, CaseBarcodePathlogical);

            SpecialityPDFFill spf = new SpecialityPDFFill();
            ArrayList         obj = new ArrayList();
            spf.sz_EventID     = Session["IM_FW_EVENT_ID"].ToString();
            spf.sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            spf.sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;

            spf.sz_XMLPath = "IM_FOLLOWUP_XML_Path";
            spf.sz_PDFPath = "IM_FOLLOWUP_PDF_Path";

            spf.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.SZ_SPECIALITY_NAME = "IM";
            obj = spf.FillPDFValue(spf);

            // Page.ClientScript.RegisterClientScriptBlock(typeof(GridView), "Msg", "window.open('" + obj[1] + "'); ", true);
            Response.Redirect(obj[1].ToString(), false);

            spf.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();;
            spf.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            spf.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
            spf.SZ_PT_FILE_NAME    = obj[0].ToString();
            spf.SZ_PT_FILE_PATH    = obj[2].ToString();
            spf.SZ_SPECIALITY_CODE = "NFMIM";
            spf.SZ_SPECIALITY_NAME = "IM";
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.savePDFForminDocMang(spf);
            //Code To generate pdf according to check box value and Visit Status
            Bill_Sys_CheckoutBO ChkBo = new Bill_Sys_CheckoutBO();
            if (ChkBo.ChekVisitStaus(Convert.ToInt32(Session["IM_FW_EVENT_ID"].ToString()), ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID) == "2")
            {
                ArrayList         ObjalGetVal = new ArrayList();
                ArrayList         objal1      = new ArrayList();
                SpecialityPDFFill SPDFF       = new SpecialityPDFFill();
                ObjalGetVal = ChkBo.ChekCheckBoxStaus(Convert.ToInt32(Session["IM_FW_EVENT_ID"].ToString()));
                //CHK_REFERRALS_CHIROPRACTOR
                if (ObjalGetVal[0].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "CH";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMCH";
                    SPDFF.sz_XMLPath         = "Refferal_IM_FOLLOWUP_XML_Path";
                    SPDFF.sz_PDFPath         = "CO_Refferal_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMCH";
                    SPDFF.SZ_SPECIALITY_NAME = "CH";
                    SPDFF.IMG_ID_COLUMN_CODE = "CH_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }
                //CHK_REFERRALS_PHYSICAL_THERAPIST
                if (ObjalGetVal[1].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "PT";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMPT";
                    SPDFF.sz_XMLPath         = "Refferal_IM_FOLLOWUP_XML_Path";
                    SPDFF.sz_PDFPath         = "CO_Refferal_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMPT";
                    SPDFF.SZ_SPECIALITY_NAME = "PT";
                    SPDFF.IMG_ID_COLUMN_CODE = "PT_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }

                //CHK_REFERRALS_OCCUPATIONAL_THERAPIST
                if (ObjalGetVal[14].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "OT";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMOT";
                    SPDFF.sz_XMLPath         = "Refferal_IM_FOLLOWUP_XML_Path";
                    SPDFF.sz_PDFPath         = "CO_Refferal_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMOT";
                    SPDFF.SZ_SPECIALITY_NAME = "OT";
                    SPDFF.IMG_ID_COLUMN_CODE = "OT_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }

                //CHK_TEST_EMG_NCV
                if (ObjalGetVal[15].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "EMG";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMEMG";
                    SPDFF.sz_XMLPath         = "MST_ECG_IM_FOLLOWUP_XML_Path";
                    SPDFF.sz_PDFPath         = "MST_ECG_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMEMG";
                    SPDFF.SZ_SPECIALITY_NAME = "EMG";
                    SPDFF.IMG_ID_COLUMN_CODE = "VSNCT_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }


                //CHK_SUPPLIES_EMS_UNIT TO CHK_SUPPLIES_BIOFEEDBACK_TRAINING_SESSIONS
                if (ObjalGetVal[2].ToString().Equals("True") || ObjalGetVal[3].ToString().Equals("True") || ObjalGetVal[4].ToString().Equals("True") || ObjalGetVal[5].ToString().Equals("True") || ObjalGetVal[6].ToString().Equals("True") || ObjalGetVal[7].ToString().Equals("True") || ObjalGetVal[8].ToString().Equals("True") || ObjalGetVal[9].ToString().Equals("True") || ObjalGetVal[10].ToString().Equals("True") || ObjalGetVal[11].ToString().Equals("True") || ObjalGetVal[12].ToString().Equals("True") || ObjalGetVal[13].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "SP";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMSP";
                    SPDFF.sz_XMLPath         = "Supplies_XML_Path";
                    SPDFF.sz_PDFPath         = "Supplies_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMSP";
                    SPDFF.SZ_SPECIALITY_NAME = "SP";
                    SPDFF.IMG_ID_COLUMN_CODE = "SUPPLIES_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }
            }
            //End Code
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        _objcheckOut = new Bill_Sys_CheckoutBO();
        DigitalSign signobj = new DigitalSign();

        objNF3Template = new Bill_Sys_NF3_Template();
        DataSet dsObj = _objcheckOut.PatientName(Session["AC_EventID"].ToString());

        Session["AC_CaseID"] = dsObj.Tables[0].Rows[0][1].ToString();
        sz_CompanyID         = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        sz_CompanyName       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        sz_EventID           = Session["AC_EventID"].ToString();
        int flag = 0;

        try
        {
            String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_CaseID"].ToString() + "/Signs/";
            //Added By-Sunil
            string SaveSignPathlogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_CaseID"].ToString() + "/Signs/";
            //end
            if (!Directory.Exists(szDefaultPath))
            {
                Directory.CreateDirectory(szDefaultPath);
            }
            szDefaultPath = szDefaultPath + sz_EventID;
            //Added By-Sunil
            SaveSignPathlogical = SaveSignPathlogical + sz_EventID;
            //end
            DoctorImagePath        = szDefaultPath + "_DoctorSign.jpg";
            DoctorImagePathlogical = SaveSignPathlogical + "_DoctorSign.jpg";
            signobj.SignSave(Request.Form["hidden"], DoctorImagePath);

            #region " "Barcode functionality
            DataSet dset = new DataSet();
            dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
            string sz_NodeId           = dset.Tables[0].Rows[0][1].ToString();
            string sz_CaseId           = dset.Tables[0].Rows[0][0].ToString();
            string barcodeValue        = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
            String sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_CaseID"].ToString() + "/Signs/";
            //Added By-Sunil
            string sz_BarcodeImagePathlogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_CaseID"].ToString() + "/Signs/";
            //end
            SpecialityPDFBO pdfbo = new SpecialityPDFBO();
            CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
            //Added By-Sunil
            string CaseBarcodePathlogical = sz_BarcodeImagePathlogical + "BarcodeImg.jpg";
            //end
            #endregion

            //_objcheckOut.UpdateIMSignPathACCU_REEVAL(sz_EventID, DoctorImagePath, CaseBarcodePath);
            _objcheckOut.UpdateIMSignPathACCU_REEVAL(sz_EventID, DoctorImagePathlogical, CaseBarcodePathlogical);
            SpecialityPDFFill spf = new SpecialityPDFFill();
            ArrayList         obj = new ArrayList();
            spf.sz_EventID     = Session["AC_EventID"].ToString();
            spf.sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            spf.sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;

            spf.sz_XMLPath = "AC_REEVAL_XML_Path";
            spf.sz_PDFPath = "AC_REEVAL_PDF_Path";

            spf.sz_Session_Id      = Session["AC_CaseID"].ToString();
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.SZ_SPECIALITY_NAME = "AC";
            obj = spf.FillPDFValue(spf);
            Response.Redirect(obj[1].ToString(), false);
            //Page.ClientScript.RegisterClientScriptBlock(typeof(GridView), "Msg", "window.open('" + obj[1] + "'); ", true);
            //Response.Write("<script>window.open('" + obj[1] + "')</script>");

            spf.sz_Session_Id      = Session["AC_CaseID"].ToString();;
            spf.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            spf.sz_EventID         = Session["AC_EventID"].ToString();
            spf.SZ_PT_FILE_NAME    = obj[0].ToString();
            spf.SZ_PT_FILE_PATH    = obj[2].ToString();
            spf.SZ_SPECIALITY_CODE = "AC";
            spf.SZ_SPECIALITY_NAME = "NFMAC";
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.savePDFForminDocMang(spf);
        }
        catch (Exception ex)
        {
            Label1.Text = "Page Laod :" + ex.ToString();
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        #region "check version readonly or not"
        string app_status = ((Bill_Sys_BillingCompanyObject)Session["APPSTATUS"]).SZ_READ_ONLY.ToString();
        if (app_status.Equals("True"))
        {
            Bill_Sys_ChangeVersion cv = new Bill_Sys_ChangeVersion(this.Page);
            cv.MakeReadOnlyPage("Bill_Sys_Image_Save.aspx");
        }
        #endregion
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        try
        {
            _objcheckOut = new Bill_Sys_CheckoutBO();
            DigitalSign signobj = new DigitalSign();
            objNF3Template = new Bill_Sys_NF3_Template();

            if (Session["AC_SYNAPTIC_EVENT_ID"] != "" && Session["AC_SYNAPTIC_EVENT_ID"] != null)
            {
                DataSet dsObj = new DataSet();
                dsObj = _objcheckOut.PatientName(Session["AC_SYNAPTIC_EVENT_ID"].ToString());
                Session["AC_Followup_CaseID"] = dsObj.Tables[0].Rows[0][1].ToString();
                sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                sz_EventID     = Session["AC_SYNAPTIC_EVENT_ID"].ToString();
                int flag = 0;

                String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
                //Added By-Sunil
                string SaveSignPath = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
                //end
                if (!Directory.Exists(szDefaultPath))
                {
                    Directory.CreateDirectory(szDefaultPath);
                }
                szDefaultPath = szDefaultPath + sz_EventID;
                //Added By-Sunil
                SaveSignPath = SaveSignPath + sz_EventID;
                //end
                signobj.SignSave(Request.Form["hiddenPatient"], szDefaultPath + "_PatientSign.jpg");

                //_objcheckOut.updateSYNFollowupPatientPath(sz_EventID, szDefaultPath + "_PatientSign.jpg");
                _objcheckOut.updateSYNFollowupPatientPath(sz_EventID, SaveSignPath + "_PatientSign.jpg");
                //TUSHAR:- No Doctor Sign Is required For SYN Doctor Screen
                //DoctorImagePath = szDefaultPath + "_DoctorSign.jpg";
                //signobj.SignSave(Request.Form["hidden"], DoctorImagePath);
                //End
                #region " "Barcode functionality
                DataSet dset = new DataSet();
                dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
                string          sz_NodeId           = dset.Tables[0].Rows[0][1].ToString();
                string          sz_CaseId           = dset.Tables[0].Rows[0][0].ToString();
                string          barcodeValue        = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
                String          sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
                SpecialityPDFBO pdfbo = new SpecialityPDFBO();
                CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
                #endregion
                //TUSHAR:- No Doctor Sign Is required For SYN Doctor Screen
                //_objcheckOut.updateSYNFollowupProviderPath(sz_EventID, DoctorImagePath, CaseBarcodePath);
                //End
            }
            else
            {
                DataSet dsObj = new DataSet();
                dsObj = _objcheckOut.PatientName(Session["AC_FOLLOWUP_EVENT_ID"].ToString());
                Session["AC_Followup_CaseID"] = dsObj.Tables[0].Rows[0][1].ToString();
                sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                sz_EventID     = Session["AC_FOLLOWUP_EVENT_ID"].ToString();
                int flag = 0;

                String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
                //Added By-Sunil
                string SaveSignPathlogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
                //end
                if (!Directory.Exists(szDefaultPath))
                {
                    Directory.CreateDirectory(szDefaultPath);
                }
                szDefaultPath = szDefaultPath + sz_EventID;
                //Added By-Sunil
                SaveSignPathlogical = SaveSignPathlogical + sz_EventID;
                //end
                signobj.SignSave(Request.Form["hiddenPatient"], szDefaultPath + "_PatientSign.jpg");
                // _objcheckOut.updateAccFollowupPatientPath(sz_EventID, szDefaultPath + "_PatientSign.jpg");
                _objcheckOut.updateAccFollowupPatientPath(sz_EventID, SaveSignPathlogical + "_PatientSign.jpg");
                DoctorImagePath = szDefaultPath + "_DoctorSign.jpg";
                string DoctorImagePathlogical = SaveSignPathlogical + "_DoctorSign.jpg";
                signobj.SignSave(Request.Form["hidden"], DoctorImagePath);


                #region " "Barcode functionality
                DataSet dset = new DataSet();
                dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
                string sz_NodeId           = dset.Tables[0].Rows[0][1].ToString();
                string sz_CaseId           = dset.Tables[0].Rows[0][0].ToString();
                string barcodeValue        = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
                String sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
                //Added By-Sunil
                string sz_BarcodeImagePathlogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
                //end
                SpecialityPDFBO pdfbo = new SpecialityPDFBO();
                CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
                #endregion
                //Added By-Sunil
                string CaseBarcodePathlogical = sz_BarcodeImagePathlogical + "BarcodeImg.jpg";
                //end
                // _objcheckOut.updateAccFollowupProviderPath(sz_EventID, DoctorImagePath, CaseBarcodePath);
                _objcheckOut.updateAccFollowupProviderPath(sz_EventID, DoctorImagePathlogical, CaseBarcodePathlogical);
            }
        }
        catch (Exception ex)
        {
            Label1.Text = "Page Laod :" + ex.ToString();
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        #region "check version readonly or not"
        string app_status = ((Bill_Sys_BillingCompanyObject)Session["APPSTATUS"]).SZ_READ_ONLY.ToString();
        if (app_status.Equals("True"))
        {
            Bill_Sys_ChangeVersion cv = new Bill_Sys_ChangeVersion(this.Page);
            cv.MakeReadOnlyPage("Bill_Sys_Image_Save.aspx");
        }
        #endregion
        Page.RegisterStartupScript("mm", "<script type='text/javascript'>window.close()</script>");
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        _objcheckOut = new Bill_Sys_CheckoutBO();
        DigitalSign signobj = new DigitalSign();

        SIGPLUSLib.SigPlus sigObj_Patient1 = new SIGPLUSLib.SigPlus();
        objNF3Template = new Bill_Sys_NF3_Template();
        // DataSet dsObj = _objcheckOut.PatientName(Session["IMEventID"].ToString());
        //Session["ChkCaseID"] = ((SpecialityPDFDAO)Session["SPECIALITY_PDF_OBJECT"]).CaseID;

        if (((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).BT_REFERRING_FACILITY == true && ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_COMAPNY_ID != ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID)
        {
            sz_CompanyID = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_COMAPNY_ID;
            Bill_Sys_NF3_Template obj1 = new Bill_Sys_NF3_Template();
            sz_CompanyName = obj1.GetCompanyName(sz_CompanyID);
        }
        else
        {
            sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        }



        sz_EventID = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;
        try
        {
            String szDefaultPath = (objNF3Template.getPhysicalPath()) + sz_CompanyName + "/" + ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID + "/Signs/";
            //Added By-Sunil
            string SaveSignPathlogical = sz_CompanyName + "/" + ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID + "/Signs/";
            //end
            if (!Directory.Exists(szDefaultPath))
            {
                Directory.CreateDirectory(szDefaultPath);
            }
            szDefaultPath = szDefaultPath + sz_EventID;
            //Added By-Sunil
            SaveSignPathlogical = SaveSignPathlogical + sz_EventID;
            //end
            DoctorImagePath        = szDefaultPath + "_DoctorSign.jpg";
            DoctorImagePathlogical = SaveSignPathlogical + "_DoctorSign.jpg";
            string sz_Patient_path                      = szDefaultPath + "_Patient.jpg";
            string sz_Patient_path_logical              = SaveSignPathlogical + "_Patient.jpg";
            string sz_Attorney_Path                     = szDefaultPath + "_Attoreny.jpg";
            string sz_Attorney_Path_logical             = SaveSignPathlogical + "_Attoreny.jpg";
            string sz_ParentOfMinorPatient_path         = szDefaultPath + "_ParentOfMinorPatient.jpg";
            string sz_ParentOfMinorPatient_path_logical = SaveSignPathlogical + "_ParentOfMinorPatient.jpg";
            string sz_Gardian_Path                      = szDefaultPath + "_Gardian.jpg";
            string sz_Gardian_Path_logical              = SaveSignPathlogical + "_Gardian.jpg";
            signobj.SignSave(Request.Form["hiddenPatient"], sz_Patient_path);
            signobj.SignSave(Request.Form["hidden"], sz_Attorney_Path);
            string RepresebtiveSign  = Request.Form["hiddenParentOfMinorPatient"].ToString();
            string RepresebtiveSign1 = Request.Form["hiddenGardian"].ToString();

            if (!RepresebtiveSign.Equals("FFFFFFFFF58841040500000004000000CF35D06FEE8E6C74CF35D06FEE8E6C74CF35D06FEE8E6C74CF35D06FEE8E6C74CF35D06FEE8E6C74"))
            {
                signobj.SignSave(Request.Form["hiddenParentOfMinorPatient"], sz_ParentOfMinorPatient_path);
            }
            else
            {
                signobj.SignSave(Request.Form["hiddenPatient"], sz_ParentOfMinorPatient_path);
            }


            if (!RepresebtiveSign1.Equals("FFFFFFFFF58841040500000004000000CF35D06FEE8E6C74CF35D06FEE8E6C74CF35D06FEE8E6C74CF35D06FEE8E6C74CF35D06FEE8E6C74"))
            {
                signobj.SignSave(Request.Form["hiddenGardian"], sz_Gardian_Path);
            }

            #region " "Barcode functionality
            DataSet dset = new DataSet();
            dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
            string          sz_NodeId                   = dset.Tables[0].Rows[0][1].ToString();
            string          sz_CaseId                   = dset.Tables[0].Rows[0][0].ToString();
            string          barcodeValue                = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
            String          sz_BarcodeImagePath         = (objNF3Template.getPhysicalPath()) + sz_CompanyName + "/" + ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID + "/Signs/";
            string          sz_BarcodeImagePath_logical = sz_CompanyName + "/" + ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID + "/Signs/";
            SpecialityPDFBO pdfbo = new SpecialityPDFBO();
            CaseBarcodePath             = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
            sz_BarcodeImagePath_logical = sz_BarcodeImagePath_logical + "BarcodeImg.jpg";
            #endregion
            //_objcheckOut.TestIntakeMri(sz_EventID, CaseBarcodePath, sz_Patient_path, sz_Attorney_Path, sz_ParentOfMinorPatient_path, sz_Gardian_Path);
            _objcheckOut.TestIntakeMri(sz_EventID, sz_BarcodeImagePath_logical, sz_Patient_path_logical, sz_Attorney_Path_logical, sz_ParentOfMinorPatient_path_logical, sz_Gardian_Path_logical);
            SpecialityPDFFill spf = new SpecialityPDFFill();
            ArrayList         obj = new ArrayList();
            spf.sz_EventID     = "";
            spf.sz_CompanyID   = sz_CompanyID;//spf.sz_CompanyID = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_COMAPNY_ID;
            spf.sz_CompanyName = sz_CompanyName;

            spf.sz_XMLPath = "MRI_INTAKE_XML_Path";
            spf.sz_PDFPath = "MRI_INTAKE_PDF_Path";

            spf.sz_Session_Id      = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.SZ_SPECIALITY_NAME = "MRI";
            obj = FillPDFValue(spf);
            Response.Redirect(obj[1].ToString(), false);
            Page.ClientScript.RegisterClientScriptBlock(typeof(GridView), "Msg", "window.open('" + obj[1] + "'); ", true);
            Response.Write("<script>window.open('" + obj[1] + "')</script>");

            spf.sz_Session_Id      = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;;
            spf.sz_CompanyID       = sz_CompanyID;
            spf.sz_EventID         = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;
            spf.SZ_PT_FILE_NAME    = obj[0].ToString();
            spf.SZ_PT_FILE_PATH    = obj[2].ToString();
            spf.SZ_SPECIALITY_CODE = "ININT";
            spf.SZ_SPECIALITY_NAME = "Intake Sheet";
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.savePDFForminDocMang(spf);
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
示例#9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        _objcheckOut = new Bill_Sys_CheckoutBO();
        DigitalSign signobj = new DigitalSign();

        objNF3Template = new Bill_Sys_NF3_Template();
        DataSet dsObj = _objcheckOut.PatientName(Session["IM_FW_EVENT_ID"].ToString());

        Session["IM_FOLLOWUP_CaseID"] = dsObj.Tables[0].Rows[0][1].ToString();
        sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        sz_EventID     = Session["IM_FW_EVENT_ID"].ToString();
        int flag = 0;

        try
        {
            String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["IM_FOLLOWUP_CaseID"].ToString() + "/Signs/";
            //Added By-Sunil
            string SaveSignPath = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["IM_FOLLOWUP_CaseID"].ToString() + "/Signs/";
            //end
            if (!Directory.Exists(szDefaultPath))
            {
                Directory.CreateDirectory(szDefaultPath);
            }
            szDefaultPath = szDefaultPath + sz_EventID;
            //Added By-Sunil
            SaveSignPath = SaveSignPath + sz_EventID;
            //end
            DoctorImagePath        = szDefaultPath + "_DoctorSign.jpg";
            DoctorImagePathlogical = SaveSignPath + "_DoctorSign.jpg";
            signobj.SignSave(Request.Form["hidden"], DoctorImagePath);

            #region " "Barcode functionality
            DataSet dset = new DataSet();
            dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);
            string          sz_NodeId           = dset.Tables[0].Rows[0][1].ToString();
            string          sz_CaseId           = dset.Tables[0].Rows[0][0].ToString();
            string          barcodeValue        = sz_CompanyID + "@" + sz_CaseId + "@" + sz_NodeId;
            String          sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["IM_FOLLOWUP_CaseID"].ToString() + "/Signs/";
            SpecialityPDFBO pdfbo = new SpecialityPDFBO();
            //Added By-Sunil
            string sz_BarcodeImagePathlogical = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["AC_Followup_CaseID"].ToString() + "/Signs/";
            //end
            //Added By-Sunil
            string CaseBarcodePathlogical = sz_BarcodeImagePathlogical + "BarcodeImg.jpg";
            //end
            CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
            #endregion

            //_objcheckOut.SaveIMFollowupSignPath(sz_EventID, DoctorImagePath, CaseBarcodePath);
            _objcheckOut.SaveIMFollowupSignPath(sz_EventID, DoctorImagePathlogical, CaseBarcodePathlogical);
            SpecialityPDFFill spf = new SpecialityPDFFill();
            ArrayList         obj = new ArrayList();
            spf.sz_EventID     = Session["IM_FW_EVENT_ID"].ToString();
            spf.sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            spf.sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;

            spf.sz_XMLPath = "IM_FOLLOWUP_XML_Path";
            spf.sz_PDFPath = "IM_FOLLOWUP_PDF_Path";

            spf.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.SZ_SPECIALITY_NAME = "IM";
            obj = spf.FillPDFValue(spf);
            Response.Redirect(obj[1].ToString(), false);
            spf.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();;
            spf.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            spf.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
            spf.SZ_PT_FILE_NAME    = obj[0].ToString();
            spf.SZ_PT_FILE_PATH    = obj[2].ToString();
            spf.SZ_SPECIALITY_CODE = "NFMIM";
            spf.SZ_SPECIALITY_NAME = "IM";
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.savePDFForminDocMang(spf);

            //Code To generate pdf according to check box value and Visit Status
            Bill_Sys_CheckoutBO ChkBo = new Bill_Sys_CheckoutBO();
            if (ChkBo.ChekVisitStaus(Convert.ToInt32(Session["IM_FW_EVENT_ID"].ToString()), ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID) == "2")
            {
                ArrayList         ObjalGetVal = new ArrayList();
                ArrayList         objal1      = new ArrayList();
                SpecialityPDFFill SPDFF       = new SpecialityPDFFill();
                ObjalGetVal = ChkBo.ChekCheckBoxStaus(Convert.ToInt32(Session["IM_FW_EVENT_ID"].ToString()));
                //CHK_REFERRALS_CHIROPRACTOR
                if (ObjalGetVal[0].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "CH";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMCH";
                    SPDFF.sz_XMLPath         = "Refferal_IM_FOLLOWUP_XML_Path";
                    SPDFF.sz_PDFPath         = "CO_Refferal_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMCH";
                    SPDFF.SZ_SPECIALITY_NAME = "CH";
                    SPDFF.IMG_ID_COLUMN_CODE = "CH_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }
                //CHK_REFERRALS_PHYSICAL_THERAPIST
                if (ObjalGetVal[1].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "PT";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMPT";
                    SPDFF.sz_XMLPath         = "Refferal_IM_FOLLOWUP_XML_Path";
                    SPDFF.sz_PDFPath         = "CO_Refferal_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMPT";
                    SPDFF.SZ_SPECIALITY_NAME = "PT";
                    SPDFF.IMG_ID_COLUMN_CODE = "PT_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }

                //CHK_REFERRALS_OCCUPATIONAL_THERAPIST
                if (ObjalGetVal[14].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "OT";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMOT";
                    SPDFF.sz_XMLPath         = "Refferal_IM_FOLLOWUP_XML_Path";
                    SPDFF.sz_PDFPath         = "CO_Refferal_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMOT";
                    SPDFF.SZ_SPECIALITY_NAME = "OT";
                    SPDFF.IMG_ID_COLUMN_CODE = "OT_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }

                //CHK_TEST_EMG_NCV
                if (ObjalGetVal[15].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "EMG";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMEMG";
                    SPDFF.sz_XMLPath         = "MST_ECG_IM_FOLLOWUP_XML_Path";
                    SPDFF.sz_PDFPath         = "MST_ECG_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMEMG";
                    SPDFF.SZ_SPECIALITY_NAME = "EMG";
                    SPDFF.IMG_ID_COLUMN_CODE = "VSNCT_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }


                //CHK_SUPPLIES_EMS_UNIT TO CHK_SUPPLIES_BIOFEEDBACK_TRAINING_SESSIONS
                if (ObjalGetVal[2].ToString().Equals("True") || ObjalGetVal[3].ToString().Equals("True") || ObjalGetVal[4].ToString().Equals("True") || ObjalGetVal[5].ToString().Equals("True") || ObjalGetVal[6].ToString().Equals("True") || ObjalGetVal[7].ToString().Equals("True") || ObjalGetVal[8].ToString().Equals("True") || ObjalGetVal[9].ToString().Equals("True") || ObjalGetVal[10].ToString().Equals("True") || ObjalGetVal[11].ToString().Equals("True") || ObjalGetVal[12].ToString().Equals("True") || ObjalGetVal[13].ToString().Equals("True"))
                {
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_CompanyName     = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
                    SPDFF.SZ_SPECIALITY_NAME = "SP";
                    SPDFF.SZ_SPECIALITY_CODE = "NFMSP";
                    SPDFF.sz_XMLPath         = "Supplies_XML_Path";
                    SPDFF.sz_PDFPath         = "Supplies_PDF_Path";
                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    objal1 = SPDFF.FillPDFValue(SPDFF);



                    SPDFF.sz_Session_Id      = Session["IM_FOLLOWUP_CaseID"].ToString();
                    SPDFF.sz_CompanyID       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    SPDFF.sz_EventID         = Session["IM_FW_EVENT_ID"].ToString();
                    SPDFF.SZ_PT_FILE_NAME    = objal1[0].ToString();
                    SPDFF.SZ_PT_FILE_PATH    = objal1[2].ToString();
                    SPDFF.SZ_SPECIALITY_CODE = "NFMSP";
                    SPDFF.SZ_SPECIALITY_NAME = "SP";
                    SPDFF.IMG_ID_COLUMN_CODE = "SUPPLIES_FU_REFERRAL";
                    SPDFF.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
                    SPDFF.savePDFForminDocMang(SPDFF);
                }
            }
            else
            {
                //signature has not been returned successfully!
            }
        }
        catch (Exception ex)
        {
            Label1.Text = "Page Laod :" + ex.ToString();

            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        #region "check version readonly or not"
        string app_status = ((Bill_Sys_BillingCompanyObject)Session["APPSTATUS"]).SZ_READ_ONLY.ToString();
        if (app_status.Equals("True"))
        {
            Bill_Sys_ChangeVersion cv = new Bill_Sys_ChangeVersion(this.Page);
            cv.MakeReadOnlyPage("Bill_Sys_Image_Save.aspx");
        }
        #endregion
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    protected void btnSumbit_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        Bill_Sys_CheckoutBO   _objcheckOut   = new Bill_Sys_CheckoutBO();
        Bill_Sys_NF3_Template objNF3Template = new Bill_Sys_NF3_Template();
        string sz_CompanyID   = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        string sz_CompanyName = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME;
        string sz_EventID     = Session["CO_Refferal_Event_Id"].ToString();
        string XML_Path;
        string PDF_Path;

        int    flag            = 0;
        string DoctorImagePath = "";
        //string PatientImagePath = Session["PatientImagePath"].ToString();
        string CaseBarcodePath = "";

        try
        {
            string sz_NodeId;
            string sz_CaseId;
            String sz_BarcodeImagePath;
            string sz_Session_Id;
            String szDefaultPath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["CO_Refferal_CaseID"].ToString() + "/Signs/";
            if (!Directory.Exists(szDefaultPath))
            {
                Directory.CreateDirectory(szDefaultPath);
            }
            szDefaultPath = szDefaultPath + sz_EventID;
            if (WebSignature2.ExportToStreamOnly())
            {
                System.IO.MemoryStream imgstream2 = (System.IO.MemoryStream)(WebSignature2.ImageMemoryStream);
                {
                    if (imgstream2 != null)
                    {
                        byte[] imageContent2 = new Byte[imgstream2.Length];
                        imgstream2.Position = 0;
                        imgstream2.Read(imageContent2, 0, (int)imgstream2.Length);
                        Response.ContentType = "image/jpeg";
                        Response.BinaryWrite(imageContent2);
                        Bitmap bmp  = new Bitmap(imgstream2);
                        double size = 0.15;
                        ResizeImage((System.Drawing.Image)bmp, size);
                        DoctorImagePath = szDefaultPath + "_PhysicianSign.jpg";
                        Img.Save(DoctorImagePath);
                        DataSet dset = new DataSet();
                        dset = _objcheckOut.GetNodeID(sz_CompanyID, sz_EventID);

                        sz_NodeId = dset.Tables[0].Rows[0][1].ToString();
                        sz_CaseId = dset.Tables[0].Rows[0][0].ToString();


                        sz_BarcodeImagePath = (objNF3Template.getPhysicalPath()) + ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + Session["CO_Refferal_CaseID"].ToString() + "/Signs/";



                        //code by tushar to centralise barcode generation process
                        SpecialityPDFBO pdfbo = new SpecialityPDFBO();
                        CaseBarcodePath = pdfbo.GetBarCodePath(sz_CompanyID, sz_CaseId, sz_NodeId, sz_BarcodeImagePath);
                        //end of code
                    }
                    else
                    {
                        flag = 2;
                    }
                }
            }


            _objcheckOut.SaveCORefferalSignPath(sz_EventID, DoctorImagePath, CaseBarcodePath);


            // Code by tushar to centralise pdf generation process
            SpecialityPDFFill spf = new SpecialityPDFFill();
            ArrayList         obj = new ArrayList();
            spf.sz_EventID         = sz_EventID;
            spf.sz_CompanyID       = sz_CompanyID;
            spf.sz_CompanyName     = sz_CompanyName;
            XML_Path               = "CO_Refferal_XML_Path";
            PDF_Path               = "CO_Refferal_PDF_Path";
            spf.sz_XMLPath         = XML_Path.ToString();
            spf.sz_PDFPath         = PDF_Path.ToString();
            sz_Session_Id          = Session["CO_Refferal_Event_Id"].ToString();
            spf.sz_Session_Id      = sz_Session_Id.ToString();
            spf.SZ_USER_NAME       = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME;
            spf.SZ_SPECIALITY_NAME = "CH";
            obj = spf.FillPDFValue(spf);

            Page.ClientScript.RegisterClientScriptBlock(typeof(GridView), "Msg", "window.open('" + obj[1] + "'); ", true);
            Response.Write("<script>window.open('" + obj[1] + "')</script>");
            //end of code
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }