protected void btnUpdate_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());
        }

        try
        {
            _bill_Sys_FileType_Settings = new Bill_Sys_FileType_Settings();
            _bill_Sys_FileType_Settings.UpdateSettings(extDisplayType.Text, extDisplayPosition.Text, txtDescription.Text, txtCompanyID.Text);
            lblMsg.Text = "Updated Successfully!";
        }
        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());
        }
    }
Example #2
0
    protected void btnUPdate_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());
        }

        bool docSelected = true;

        try
        {
            bool chkDocCategory = true;


            if (extddlSpecialty.Visible && extddlSpecialty.Text == "NA")
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "ds42d", "alert('Please Select Specialty.');", true);

                return;
            }
            for (int i = 0; i < grdViewDocuments.Items.Count; i++)
            {
                if (((CheckBox)(grdViewDocuments.Items[i].Cells[0].FindControl("chkView"))).Checked == true)
                {
                    docSelected = true;
                    if (((DropDownList)(grdViewDocuments.Items[i].Cells[4].FindControl("ddlreport"))).SelectedValue == "8")
                    {
                        chkDocCategory = false;
                    }
                }
            }
            if (chkDocCategory == false)
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "ds42d", "alert('Please Select Document Category.');", true);

                return;
            }


            // ScriptManager.RegisterClientScriptBlock(this, GetType(), "ds4", "alert('Doctor assign successfully.');", true);
            if (docSelected == true)
            {
                objNF3Template = new Bill_Sys_NF3_Template();
                String szDefaultPath = objNF3Template.getPhysicalPath();
                int    ImageId       = 0;
                string PathNotFound  = "";
                foreach (DataGridItem drg in grdViewDocuments.Items)
                {
                    CheckBox     drp       = (CheckBox)drg.Cells[0].FindControl("chkView");
                    DropDownList drpReport = (DropDownList)drg.Cells[0].FindControl("ddlreport");
                    if (drp.Checked == true)
                    {
                        String szDestinationDir = "";

                        //if (((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).BT_REFERRING_FACILITY == true)
                        if (objSessionBillingCompany.BT_REFERRING_FACILITY == true)
                        {
                            //szDestinationDir = objNF3Template.GetCompanyName(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                            szDestinationDir = objNF3Template.GetCompanyName(objSessionBillingCompany.SZ_COMPANY_ID);
                        }
                        else
                        {
                            //szDestinationDir = objNF3Template.GetCompanyName(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                            szDestinationDir = objNF3Template.GetCompanyName(objSessionBillingCompany.SZ_COMPANY_ID);
                        }
                        // szDestinationDir = szDestinationDir + "/" + txtCaseId.Text + "/No Fault File/Medicals/" + txtSpecility.Text + "/";
                        if (drpReport.SelectedValue == "0")
                        {
                            szDestinationDir = szDestinationDir + "/" + txtCaseID.Text + "/No Fault File/Medicals/" + hdnmdltxtSpeciality.Text + "/";
                        }
                        else if (drpReport.SelectedValue == "1")
                        {
                            szDestinationDir = szDestinationDir + "/" + txtCaseID.Text + "/No Fault File/Medicals/" + hdnmdltxtSpeciality.Text + "/Referral/";
                        }

                        else if (drpReport.SelectedValue == "2")
                        {
                            szDestinationDir = szDestinationDir + "/" + txtCaseID.Text + "/No Fault File/AOB/";
                        }
                        else if (drpReport.SelectedValue == "3")
                        {
                            szDestinationDir = szDestinationDir + "/" + txtCaseID.Text + "/No Fault File/Comp Authorization/";
                        }
                        else if (drpReport.SelectedValue == "4")
                        {
                            szDestinationDir = szDestinationDir + "/" + txtCaseID.Text + "/No Fault File/HIPPA Consent/";
                        }
                        else if (drpReport.SelectedValue == "5")
                        {
                            szDestinationDir = szDestinationDir + "/" + txtCaseID.Text + "/No Fault File/Lien Form/";
                        }
                        else if (drpReport.SelectedValue == "6")
                        {
                            szDestinationDir = szDestinationDir + "/" + txtCaseID.Text + "/No Fault File/MISC/";
                        }
                        else if (drpReport.SelectedValue == "7")
                        {
                            szDestinationDir = szDestinationDir + "/" + txtCaseID.Text + "/No Fault File/MISC/";
                        }


                        strLinkPath = drg.Cells[2].Text + drg.Cells[3].Text;
                        if (!Directory.Exists(szDefaultPath + szDestinationDir))
                        {
                            Directory.CreateDirectory(szDefaultPath + szDestinationDir);
                        }



                        Bill_Sys_FileType_Settings _Bill_Sys_FileType_Settings = new Bill_Sys_FileType_Settings();
                        DataSet dscode = new DataSet();
                        dscode = _Bill_Sys_FileType_Settings.GET_IMAGE_ID(txtEventProcID.Text, drg.Cells[3].Text, txtCompanyID.Text);
                        if (dscode.Tables[0].Rows.Count > 0)
                        {
                            for (int i = 0; i < dscode.Tables[0].Rows.Count; i++)
                            {
                                ArrayList arr = new ArrayList();
                                arr.Add(dscode.Tables[0].Rows[i]["I_ID"].ToString());
                                arr.Add(txtEventProcID.Text);
                                _Bill_Sys_FileType_Settings.LhrDeleteDocuments(arr);
                            }

                            for (int i = 0; i < dscode.Tables[0].Rows.Count; i++)
                            {
                                // Bill_Sys_FileType_Settings _Bill_Sys_FileType_Settings = new Bill_Sys_FileType_Settings();
                                DataSet dsimageid = new DataSet();
                                dsimageid = _Bill_Sys_FileType_Settings.GET_IMAGE_ID_LHR(dscode.Tables[0].Rows[i]["I_IMAGE_ID"].ToString());
                                string sz_path = ConfigurationManager.AppSettings["BASEPATH"].ToString() + dscode.Tables[0].Rows[0]["SZ_FILE_PATH"].ToString() + dscode.Tables[0].Rows[0]["SZ_FILE_NAME"].ToString();
                                string szFinal = sz_path.Replace("/", "\\");
                                if (dsimageid.Tables[0].Rows.Count > 0)
                                {
                                }
                                else
                                {
                                    ArrayList arr = new ArrayList();
                                    arr.Add(dscode.Tables[0].Rows[i]["I_IMAGE_ID"].ToString());
                                    arr.Add(drg.Cells[3].Text);
                                    _Bill_Sys_FileType_Settings.Deletelhrdocuments(arr);
                                    string FinalPath = "";
                                    //szDefaultPath;
                                    try
                                    {
                                        System.IO.File.Move(@szFinal, @szFinal + ".deleted");
                                    }
                                    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);
                                    }
                                }
                            }
                        }


                        if (File.Exists(szDefaultPath + strLinkPath))
                        {
                            File.Copy(szDefaultPath + strLinkPath, szDefaultPath + szDestinationDir + drg.Cells[3].Text, true);
                            ArrayList objAL = new ArrayList();
                            //if (((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).BT_REFERRING_FACILITY == true)
                            if (objSessionBillingCompany.BT_REFERRING_FACILITY == true)
                            {
                                objAL.Add(objSessionBillingCompany.SZ_COMPANY_ID);
                            }
                            else
                            {
                                //objAL.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                                objAL.Add(objSessionBillingCompany.SZ_COMPANY_ID);
                            }

                            objAL.Add(txtCaseID.Text);
                            objAL.Add(drg.Cells[3].Text);
                            objAL.Add(szDestinationDir);
                            //objAL.Add(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME);
                            objAL.Add(objSessionUser.SZ_USER_NAME);
                            objAL.Add(hdnmdltxtSpeciality.Text);
                            // ImageId = objNF3Template.saveReportInDocumentManager(objAL);

                            if (drpReport.SelectedValue == "0")
                            {
                                ImageId = objNF3Template.saveReportInDocumentManager(objAL);
                            }
                            else if (drpReport.SelectedValue == "1")
                            {
                                ImageId = objNF3Template.saveReportInDocumentManager_Referral(objAL);
                            }
                            else if (drpReport.SelectedValue == "2")
                            {
                                ImageId = objNF3Template.saveReportInDocumentManager_AOB(objAL);
                            }
                            else if (drpReport.SelectedValue == "3")
                            {
                                ImageId = objNF3Template.saveReportInDocumentManager_NFCA(objAL);
                            }
                            else if (drpReport.SelectedValue == "4")
                            {
                                ImageId = objNF3Template.saveReportInDocumentManager_NFHC(objAL);
                            }
                            else if (drpReport.SelectedValue == "5")
                            {
                                ImageId = objNF3Template.saveReportInDocumentManager_NFLF(objAL);
                            }
                            else if (drpReport.SelectedValue == "6")
                            {
                                ImageId = saveReportInDocumentManager_NFMIS(objAL);
                            }
                            else if (drpReport.SelectedValue == "7")
                            {
                                if (File.Exists(szDefaultPath + strLinkPath))
                                {
                                    string szImgID           = "";
                                    string szDestinationDir2 = "";
                                    szDestinationDir2 = drg.Cells[2].Text.Replace("/", "\\");
                                    szImgID           = objNF3Template.GetImageID(drg.Cells[3].Text, drg.Cells[2].Text, szDestinationDir2);
                                    ImageId           = Convert.ToInt32(szImgID);
                                }
                            }

                            if ((ImageId.ToString().Trim() != "0") && (ImageId.ToString().Trim() != ""))
                            {
                                _bill_Sys_ProcedureCode_BO = new Bill_Sys_ProcedureCode_BO();
                                _bill_Sys_ProcedureCode_BO.assignLHRDocument(objAL, ImageId, drpReport.SelectedValue, Convert.ToInt32(txtEventProcID.Text));
                            }

                            // End :   Save report under document manager.
                            //}
                            if (drpReport.SelectedValue == "0")
                            {
                                Bill_Sys_ReferalEvent _bill_Sys_ReferalEvent;
                                ArrayList             arrOBJ;

                                _bill_Sys_ProcedureCode_BO = new Bill_Sys_ProcedureCode_BO();
                                _bill_Sys_ProcedureCode_BO.UpdateReportProcedureCodeList(Convert.ToInt32(txtEventProcID.Text), strLinkPath, ImageId);
                            }
                            //ScriptManager.RegisterClientScriptBlock(this, GetType(), "ds7", "alert('Document Received  successfully.');", true);
                        }
                        else
                        {
                            if (PathNotFound == "")
                            {
                                PathNotFound = szDefaultPath + strLinkPath + ",\n";
                            }
                            else
                            {
                                PathNotFound = PathNotFound + szDefaultPath + strLinkPath + ",\n";
                            }
                        }
                    }
                }
                if (PathNotFound != "")
                {
                    usrMessage.PutMessage("These file are not available.");
                    usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage);
                    usrMessage.Show();

                    // ScriptManager.RegisterClientScriptBlock(this, GetType(), "ds10", "alert('These file are not available');", true);
                    return;
                }
            }
            string notAdded = "";
            if (notAdded == "")
            {
                usrMessage.PutMessage(" Document Saved  successfully.");
            }
            usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
            usrMessage.Show();
            //ScriptManager.RegisterClientScriptBlock(this, GetType(), "ds28", "alert('Saved  successfully.');", true);
        }
        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());
        }
        try
        {
            btnUpdate.Attributes.Add("onclick", "return formValidator('frmFileTypeSettings','extDisplayType,extDisplayPosition,txtDescription');");
            txtCompanyID.Text = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            if (Session["Flag"] != null && Session["Flag"].ToString() == "true")
            {
                TreeMenuControl1.Visible = false;
            }
            else
            {
                TreeMenuControl1.ROLE_ID = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ROLE;
                if (!IsPostBack)
                {
                    _bill_Sys_FileType_Settings = new Bill_Sys_FileType_Settings();
                    DataSet dtTable = _bill_Sys_FileType_Settings.GET_Settings(txtCompanyID.Text);
                    if (dtTable.Tables.Count > 0)
                    {
                        extDisplayType.Text     = dtTable.Tables[0].Rows[0].ItemArray.GetValue(0).ToString();
                        extDisplayPosition.Text = dtTable.Tables[0].Rows[0].ItemArray.GetValue(1).ToString();
                        txtDescription.Text     = dtTable.Tables[0].Rows[0].ItemArray.GetValue(2).ToString();
                        if (extDisplayType.Text == "CI_0000003")
                        {
                            trDescription.Visible     = false;
                            trDisplayPosition.Visible = false;
                            txtDescription.Text       = "";
                            extDisplayPosition.Text   = "NA";
                        }
                        else if (extDisplayType.Text == "CI_0000004")
                        {
                            trDescription.Visible     = false;
                            trDisplayPosition.Visible = true;
                            txtDescription.Text       = "";
                        }
                        else if (extDisplayType.Text == "CI_0000005")
                        {
                            trDescription.Visible     = true;
                            trDisplayPosition.Visible = true;
                        }
                    }
                }
            }
            lblMsg.Text = "";
        }
        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);
        }

        #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_FileTypeSettings.aspx");
        }
        #endregion
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }