protected void btnUploadFile1_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_NF3_Template objNF3Template = new Bill_Sys_NF3_Template();
        ArrayList             arrUpload      = new ArrayList();
        ArrayList             arr_ImgID      = new ArrayList();

        try
        {
            if (!fuUploadReport.HasFile)
            {
                Page.RegisterStartupScript("ss", "<script language='javascript'> alert('please select file from upload Report !');showUploadFilePopup();</script>");
                return;
            }

            Bill_Sys_UploadFile _obj = (Bill_Sys_UploadFile)ViewState["VSUpload"];
            _obj.sz_FileName = fuUploadReport.FileName;
            _obj.sz_File     = fuUploadReport.FileBytes;

            FileUpload _FileUpload = new FileUpload();
            arr_ImgID = _FileUpload.UploadFile(_obj);



            if (arr_ImgID != null)
            {
                objNF3Template.InsertPaymentImage(Session["BillNo"].ToString(), txtCompanyID.Text, arr_ImgID[0].ToString(), ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID, Session["VERID"].ToString(), "VERIFICATIONPOPUP");
            }

            usrMessage.PutMessage("File Upload Successfully!");
            usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
            usrMessage.Show();

            BindGridforDenial();
        }
        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 btnUploadFile_Click(object sender, EventArgs e)
    {//Logging Start
        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_NF3_Template objNF3Template = new Bill_Sys_NF3_Template();

        try
        {
            if (!fuUploadReport.HasFile)
            {
                Page.RegisterStartupScript("ss", "<script language='javascript'> alert('please select file from upload Report !');showUploadFilePopup();</script>");

                return;
            }

            String szDefaultPath    = objNF3Template.getPhysicalPath();
            int    ImageId          = 0;
            String szDestinationDir = "";

            szDestinationDir = objNF3Template.GetCompanyName(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);

            Bill_Sys_BillTransaction_BO _obj = new Bill_Sys_BillTransaction_BO();

            string NodeId = _obj.GetNodeIDMST_Nodes(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, Session["NODETYPE"].ToString());

            RequiredDocuments.Bill_Sys_RequiredDocumentBO bo = new RequiredDocuments.Bill_Sys_RequiredDocumentBO();
            string szNodePath = bo.GetNodePath(NodeId, ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
            szDestinationDir = szNodePath + "\\";
            szDestinationDir = szDestinationDir.Replace("\\", "/");
            strLinkPath      = szDestinationDir + fuUploadReport.FileName;
            if (!Directory.Exists(szDefaultPath + szDestinationDir))
            {
                Directory.CreateDirectory(szDefaultPath + szDestinationDir);
            }

            fuUploadReport.SaveAs(szDefaultPath + szDestinationDir + fuUploadReport.FileName);


            ArrayList objAL = new ArrayList();

            objAL.Add(((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID);
            objAL.Add("");
            objAL.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);

            objAL.Add(fuUploadReport.FileName);
            objAL.Add(szDestinationDir);
            objAL.Add(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME.ToString());
            objAL.Add(NodeId);


            string ImgId = objNF3Template.SaveDocumentData(objAL);

            if (!ImgId.Equals(""))
            {
                objNF3Template.InsertPaymentImage(Session["BillNo"].ToString(), txtCompanyID.Text, ImgId, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID, Session["VERID"].ToString(), "VERIFICATIONPOPUP");
            }

            usrMessage1.PutMessage("File Upload Successfully!");
            usrMessage1.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
            usrMessage1.Show();

            BindGrid();
        }
        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());
            }
        }
    }