Beispiel #1
0
    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["IMEventID"].ToString();
        //String sz_EventID = "7";
        //  Session["PhysicalCaseID"] = "11900";
        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["PhysicalCaseID"].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 + "_Doctor.jpg";
                        Img.Save(DoctorImagePath);
                        System.IO.File.WriteAllBytes("C://LawAllies//MBSUpload//docsign.jpg", imageContent2);

                        string  sz_case_id = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]) + Session["PhysicalCaseID"].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 + "/" + Session["PhysicalCaseID"].ToString() + "/Signs/";
                        CaseBarcodePath = sz_BarcodeImagePath + "BarcodeImg.jpg";
                        Img.Save(CaseBarcodePath);
                        flag = 0;
                    }
                    else
                    {
                        flag = 2;
                    }
                }
            }

            _objcheckOut.UpdatePhysicaltherapySignPath(sz_EventID, DoctorImagePath, CaseBarcodePath);
            FillPDFValue(sz_EventID, sz_CompanyID, sz_CompanyName);
        }
        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 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 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 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());
        }
    }