private void ConfigDetails()
    {
        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_LoginBO = new Bill_Sys_LoginBO();
        try
        {
            DataTable _dt = _bill_Sys_LoginBO.GetConfigSettings(txtCompanyID.Text, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ROLE);
            Session["SYSTEM_OBJECT"] = "";
            Bill_Sys_SystemObject _bill_Sys_SystemObject = new Bill_Sys_SystemObject();
            foreach (DataRow dr in _dt.Rows)
            {
                switch (dr["SZ_CONFIGURATION"].ToString())
                {
                case "SOFT DELETE":
                    _bill_Sys_SystemObject.SZ_SOFT_DELETE = "True";
                    break;

                case "HARD DELETE":
                    _bill_Sys_SystemObject.SZ_HARD_DELETE = "True";
                    break;

                case "NEW BILLS":
                    _bill_Sys_SystemObject.SZ_NEW_BILL = "True";
                    break;

                case "VIEW BILLS":
                    _bill_Sys_SystemObject.SZ_VIEW_BILL = "True";
                    break;
                }
            }
            Session["SYSTEM_OBJECT"] = _bill_Sys_SystemObject;
        }
        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());
        }
    }
Exemple #2
0
    protected void SetDefaultSettigns()
    {
        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_LoginBO nbo = new Bill_Sys_LoginBO();

        try
        {
            this._bill_Sys_SystemObject = (Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"];
            this._bill_Sys_SystemObject.SZ_DEFAULT_LAW_FIRM               = nbo.getDefaultSettings(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, "SS00003");
            this._bill_Sys_SystemObject.SZ_CHART_NO                       = nbo.getDefaultSettings(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, "SS00004");
            this._bill_Sys_SystemObject.SZ_LOCATION                       = nbo.getDefaultSettings(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, "SS00007");
            this._bill_Sys_SystemObject.SZ_CHECKINVALUE                   = nbo.getDefaultSettings(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, "SS00008");
            this._bill_Sys_SystemObject.SZ_SHOW_PATIENT_PHONE             = nbo.getDefaultSettings(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, "SS00018");
            this._bill_Sys_SystemObject.SZ_SHOW_PATIENT_SIGNATURE_FOR_NF3 = nbo.getDefaultSettings(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, "SS00019");
            this._bill_Sys_SystemObject.SZ_SHOW_DOCTOR_SIGNATURE_FOR_NF3  = nbo.getDefaultSettings(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, "SS00020");
            this.Session["SYSTEM_OBJECT"] = this._bill_Sys_SystemObject;
        }
        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());
        }
    }
Exemple #3
0
    protected void Page_Load(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());
        }
        log.Debug("Search case page_load");
        String scriptFunc  = "";
        String scriptFunc2 = "";

        //Page.Title = (String)GetLocalResourceObject("page_title");
        utxtUserId.Text = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID;
        scriptFunc      = "<script language=JavaScript> " + "function autoComplete (field, select, property, forcematch) {" + "var found = false;" + "for (var i = 0; i < select.options.length; i++) {" + "if (select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase()) == 0) {" + "		found=true; break;"+ "}" + "}" + "if (found) { " + "select.selectedIndex = i; " + "}else {" + "select.selectedIndex = -1;" + "}" + "if (field.createTextRange) {" + "if (forcematch && !found) {" + "field.value=field.value.substring(0,field.value.length-1); " + "return;" + "}" + "var cursorKeys ='8;46;37;38;39;40;33;34;35;36;45;';" + "if (cursorKeys.indexOf(event.keyCode+';') == -1) {" + "var r1 = field.createTextRange();" + "var oldValue = r1.text;" + "var newValue = found ? select.options[i][property] : oldValue;" + "if (newValue != field.value) {" + "field.value = newValue;" + "var rNew = field.createTextRange();" + "rNew.moveStart('character', oldValue.length) ;" + "rNew.select();" + "}" + "}" + "}" + "} </script>";
        RegisterClientScriptBlock("ClientScript", scriptFunc);
        ajAutoIns.ContextKey  = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        ajAutoName.ContextKey = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        btnSoftDelete.Attributes.Add("onclick", "return Validate()");
        //ValidateExportBill
        btnExportToExcel.Attributes.Add("onclick", "return ValidateExportBill()");
        // txtPatientName.Attributes.Add("onKeyUp", "autoComplete(this,this.form.ctl00_ContentPlaceHolder1_extddlPatient,'text',true);");
        // txtInsuranceCompany.Attributes.Add("onKeyUp", "autoComplete(this,this.form.ctl00_ContentPlaceHolder1_extddlInsurance,'text',true);");
        //if (Session["CASE_LIST_GO_BUTTON"] != null)
        //{
        //    utxtCaseNo.Text = Session["CASE_LIST_GO_BUTTON"].ToString();
        //    Session["CASE_LIST_GO_BUTTON"] = null;
        //}


        if (!IsPostBack)
        {
            try
            {
                DataSet dsBit41 = new System.Data.DataSet();
                Bill_Sys_ProcedureCode_BO objPBO_1 = new Bill_Sys_ProcedureCode_BO();
                dsBit41 = objPBO_1.Get_Sys_Key("SS00041", ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                if (dsBit41.Tables.Count > 0 && dsBit41.Tables[0].Rows.Count > 0)
                {
                    string szBitVal1 = dsBit41.Tables[0].Rows[0][0].ToString();
                    if (szBitVal1 == "0")
                    {
                        Session["SendPatientToDoctor"] = false;
                    }
                    else
                    {
                        Session["SendPatientToDoctor"] = true;
                    }
                }
            }
            catch (Exception ex)
            {
                Session["SendPatientToDoctor"] = false;
                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);
            }
        }

        StringBuilder szExportoExcelColumname = new StringBuilder();
        StringBuilder szExportoExcelField     = new StringBuilder();

        szExportoExcelColumname.Append("Case #,");
        if (((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).BT_REFERRING_FACILITY == true)
        {
            szExportoExcelField.Append("SZ_RECASE_NO,");
            //grdPatientList.Columns[25].Visible = true;
        }
        else
        {
            szExportoExcelField.Append("SZ_CASE_NO,");
        }
        if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_CHART_NO == "1")
        {
            szExportoExcelColumname.Append("Chart No,");
            szExportoExcelField.Append("SZ_CHART_NO,");
        }

        if ((((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_LOCATION) != "1")
        {
            extddlLocation.Visible = false;
            lblLocation.Visible    = false;
        }
        else
        {
            extddlLocation.Visible = true;
            lblLocation.Visible    = true;
        }
        szExportoExcelColumname.Append("Patient Name,Accident Date,Open Date,Insurance Name,Claim Number,Policy Number,Case Type,Case Status");
        szExportoExcelField.Append("SZ_PATIENT_NAME,DT_DATE_OF_ACCIDENT,DT_DATE_OPEN,SZ_INSURANCE_NAME,SZ_CLAIM_NUMBER,SZ_POLICY_NUMBER,SZ_CASE_TYPE,SZ_STATUS_NAME");
        if (((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ROLE_NAME.ToLower().Equals("admin"))
        {
            szExportoExcelColumname.Append(",Total,Paid,Pending");
            szExportoExcelField.Append(",Total,Paid,Pending");
        }
        else
        {
            szExportoExcelColumname.Append(",Patient Phone");
            szExportoExcelField.Append(",SZ_PATIENT_PHONE");
        }



        Bill_Sys_LoginBO _bill_Sys_LoginBO = new Bill_Sys_LoginBO();
        string           str = _bill_Sys_LoginBO.getconfiguration(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ROLE, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);

        if (str != "" && str != null)
        {
            //grdPatientList.Columns[27].Visible = true;//change 28 to 27
            //grdPatientList.Columns[28].Visible = true;//change 29 to 28

            szExportoExcelColumname.Append(",Case Type");
            szExportoExcelField.Append(",SZ_CASE_TYPE");
            szExportoExcelColumname.Append(",Case Status");
            szExportoExcelField.Append(",SZ_STATUS_NAME");
        }
        else
        {
            //grdPatientList.Columns[27].Visible = false;//change 28 to 27
            //grdPatientList.Columns[28].Visible = false;
        }



        if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_SHOW_PROCEDURE_CODE_ON_INTEGRATION == "1")
        {
            //grdPatientList.Columns[29].Visible = true;
            szExportoExcelColumname.Append(",Patient ID");
            szExportoExcelField.Append(",SZ_PATIENT_ID_LHR");
        }
        else
        {
            //grdPatientList.Columns[29].Visible = false;
        }
        if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_SHOW_DATE_OF_FIRST_TREATMENT == "1")
        {
            //grdPatientList.Columns[30].Visible = true;
            szExportoExcelColumname.Append(",Date Of First Treatment");
            szExportoExcelField.Append(",DT_FIRST_TREATMENT");
        }
        else
        {
            //grdPatientList.Columns[30].Visible = false;
        }


        //grdPatientList.ExportToExcelColumnNames = szExportoExcelColumname.ToString();
        ////grdPatientList.Con = xcon;
        //grdPatientList.ExportToExcelFields = szExportoExcelField.ToString();
        //log.Debug("start Xgridbind.");
        //this.con.SourceGrid = grdPatientList;
        //this.txtSearchBox.SourceGrid = grdPatientList;
        //this.grdPatientList.Page = this.Page;
        //this.grdPatientList.PageNumberList = this.con;
        //log.Debug("End Xgridbind.");
        if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_CHART_NO == "1")
        {
            //grdPatientList.Columns[4].Visible = true;//chart no col
            txtChartNo.Visible = true;
            lblChart.Visible   = true;
        }
        else
        {
            //grdPatientList.Columns[4].Visible = false;//chart no col
            txtChartNo.Visible = false;
            lblChart.Visible   = false;
        }
        if (!IsPostBack)
        { //Taking Login Company Id
            if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_SHOW_PROCEDURE_CODE_ON_INTEGRATION != "1")
            {
                lblpatientid.Visible = false;
                txtpatientid.Visible = false;
            }
            else
            {
                lblpatientid.Visible = true;
                txtpatientid.Visible = true;
            }
            txtCompanyID.Text       = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            extddlInsurance.Visible = false;
            extddlPatient.Visible   = false;
            //  utxtCompanyID.Text = txtCompanyID.Text;
            fillcontrol();

            //  extddlPatient.Flag_ID = txtCompanyID.Text.ToString();
            extddlCaseStatus.Flag_ID = txtCompanyID.Text.ToString();
            extddlCaseType.Flag_ID   = txtCompanyID.Text.ToString();
            //  extddlInsurance.Flag_ID = txtCompanyID.Text.ToString();
            extddlLocation.Flag_ID = txtCompanyID.Text.ToString();
            CaseDetailsBO _objCaseDetailsBO = new CaseDetailsBO();
            string        szCaseStatausID   = _objCaseDetailsBO.GetCaseSatusId(txtCompanyID.Text);
            extddlCaseStatus.Text = szCaseStatausID;
            fillcontrol();
            if (Session["CASE_LIST_GO_BUTTON"] != null)
            {
                utxtPatientName.Text           = Session["CASE_LIST_GO_BUTTON"].ToString();
                Session["CASE_LIST_GO_BUTTON"] = null;
            }
            //string ConnectionString = ConfigurationSettings.AppSettings["Connection_String"].ToString();
            //SqlConnection con = new SqlConnection(ConnectionString);
            //SqlCommand cmd = new SqlCommand("sp_get_patientlist_agent", con);
            //cmd.CommandType = CommandType.StoredProcedure;
            //cmd.Parameters.AddWithValue("@SZ_COMPANY_ID", txtCompanyID.Text);
            //cmd.Parameters.AddWithValue("@sz_user_id", ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID);
            //SqlDataAdapter da = new SqlDataAdapter(cmd);
            //DataTable dt = new DataTable();
            //da.Fill(dt);
            //grdPatientList.DataSource = dt;
            //grdPatientList.DataBind();


            //grdPatientList.XGridBind();
            //grdPatientList.XGridBindSearch();
            log.Debug("Page_Load grdPatientList.XGridBindSearch() Completed");

            //int i = grdPatientList.Rows.Count;

            clearcontrol();

            //   ExportToExcelFields="SZ_CASE_NO,SZ_CHART_NO,SZ_PATIENT_NAME,DT_DATE_OF_ACCIDENT,DT_DATE_OPEN,SZ_INSURANCE_NAME,SZ_CLAIM_NUMBER,SZ_POLICY_NUMBER,Total,Paid,Pending" ;
            //ExportToExcelColumnNames="Case #,Chart No,Patient Name,Accident Date,Open Date,Insurance Name,Claim Number,Policy Number,Total,Paid,Pending"
        }
        // SoftDelete();

        if (((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).BT_REFERRING_FACILITY == true)
        {
            //grdPatientList.Columns[3].Visible = true;
            //grdPatientList.Columns[19].Visible = false;
            //grdPatientList.Columns[20].Visible = false;
            //grdPatientList.Columns[21].Visible = true;
            //grdPatientList.Columns[23].Visible = true;//doctor name column
            //grdPatientList.Columns[24].Visible = true;//office name column
            //Provider name column
        }
        else
        {
            //grdPatientList.Columns[23].Visible = false;//doctor name column
            //grdPatientList.Columns[24].Visible = false;//office name column
            //grdPatientList.Columns[2].Visible = true;
            //grdPatientList.Columns[21].Visible = false;
            //grdPatientList.Columns[22].Visible = true;//location column
        }
        string strlocation = _bill_Sys_LoginBO.getconfigurationlocation(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ROLE, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);

        if (strlocation != "" && strlocation != null)
        {
            //grdPatientList.Columns[22].Visible = false;
        }
        ///Check for chart no seting
        //((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ROLE
        //txtCompanyID.Text


        //check for Total ,Paid and Pending
        if (((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ROLE_NAME.ToLower().Equals("admin"))
        {
            //grdPatientList.Columns[12].Visible = true;//total col
            //grdPatientList.Columns[13].Visible = true;//paid col
            //grdPatientList.Columns[14].Visible = true;//pending col
            //grdPatientList.Columns[6].Visible = false;//6
        }
        else
        {
            //grdPatientList.Columns[6].Visible = true;//6
            //grdPatientList.Columns[12].Visible = false;
            //grdPatientList.Columns[13].Visible = false;
            //grdPatientList.Columns[14].Visible = false;
        }
        if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_SHOW_PATIENT_PHONE == "1")
        {
            //grdPatientList.Columns[6].Visible = true;//6
        }

        //Check for Check in  and Check out
        if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_CHECKINVALUE == "1")
        {
            //grdPatientList.Columns[17].Visible = true;//check in col
            //grdPatientList.Columns[18].Visible = true;//check out col
        }


        DataSet dsBit = new System.Data.DataSet();
        Bill_Sys_ProcedureCode_BO objPBO = new Bill_Sys_ProcedureCode_BO();

        dsBit = objPBO.Get_Sys_Key("SS00040", txtCompanyID.Text);
        if (dsBit.Tables.Count > 0 && dsBit.Tables[0].Rows.Count > 0)
        {
            string szBitVal = dsBit.Tables[0].Rows[0][0].ToString();
            if (szBitVal == "0")
            {
                //grdPatientList.Columns[32].Visible = false;
            }
        }
        //Check For Soft Delete Button and delete checkbox

        if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_SOFT_DELETE == "True")
        {
            //grdPatientList.Columns[33].Visible = true;//delete checkbox//change 26 to 27 then 29// 30 to 31//32 to 33 --atul
            btnSoftDelete.Visible = true;
        }
        ///for Quick Bill Entry  link
        if (Request.QueryString["Type"] != null)
        {
            if (Request.QueryString["Type"].ToString() == "Quick" && (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_NEW_BILL == "True" || ((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_VIEW_BILL == "True"))
            {
                //grdPatientList.Columns[15].Visible = true;//Bills column

                //for (int i = 0; i < grdPatientList.Rows.Count; i++)
                //{
                //    HyperLink lnkN = (HyperLink)grdPatientList.Rows[i].Cells[15].FindControl("lnkNew");
                //    HyperLink lnkV = (HyperLink)grdPatientList.Rows[i].Cells[15].FindControl("lnkView");
                //    if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_NEW_BILL == "True")
                //    {
                //        lnkN.Visible = true;
                //    }
                //    if (((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_VIEW_BILL == "True")
                //    {
                //        lnkV.Visible = true;
                //    }

                //}
            }
        }

        // extddlCaseType.Selected_Text = "OPEN";
        // used for  export to excel open not refresh grid
        fillcontrol();
        //grdPatientList.Columns[28].Visible = false;
        //grdPatientList.Columns[29].Visible = false;

        //SetTitle(this.Page);



        if (!IsPostBack)
        {
            if (Session["REMINDER"] != null)
            {
                Session["REMINDER"] = null;
                ReminderBO objReminder = null;
                DataSet    dsReminder  = null;
                DataSet    addReminder = null;
                string     strUserId   = "";
                DateTime   dtCurrent_Date;
                objReminder    = new ReminderBO();
                dsReminder     = new DataSet();
                strUserId      = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID;
                dtCurrent_Date = Convert.ToDateTime(System.DateTime.Now.ToShortDateString());
                dsReminder     = objReminder.LoadReminderDetails(strUserId, dtCurrent_Date);
                addReminder    = objReminder.LoadReminderDetailsforAdd(strUserId, dtCurrent_Date, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                if (dsReminder.Tables[0].Rows.Count > 0 || dsReminder.Tables[1].Rows.Count > 0 || addReminder.Tables[0].Rows.Count > 0)
                {
                    Page.RegisterStartupScript("ss", "<script language='javascript'> ReminderPopup();</script>");
                }
            }

            //ReminderBO _ReminderBO = new ReminderBO();
            //DataSet dssetting = new DataSet();
            //dssetting = _ReminderBO.IMSetting("SS00015", txtCompanyID.Text);
            //if (dssetting.Tables[0].Rows.Count > 0)
            //{
            //    if (dssetting.Tables[0].Rows[0]["SZ_SYS_SETTING_VALUE"].ToString() == "1")
            //    {
            //        if (Session["IMDETAILS"] != null)
            //        {
            //            Session["IMDETAILS"] = null;
            //            ReminderBO objim = null;
            //            DataSet dsIM = null;
            //            objim = new ReminderBO();
            //            dsIM = new DataSet();
            //            dsIM = objim.LoadCheckimDetails(txtCompanyID.Text);
            //            if (dsIM.Tables[0].Rows.Count > 0)
            //            {
            //                Page.RegisterStartupScript("im", "<script language='javascript'> showimcheckPopup();</script>");
            //            }
            //        }
            //    }
            //}
        }



        //Method End

        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
Exemple #4
0
    protected void btnSave_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());
        }
        string strConfirmPassword, strdays, NextExpiry, UID;

        if (txtNewPassword.Text == "" || txtConfirmPassword.Text == "")
        {
            lblMsg.Text = "Please enter new password.";
            return;
        }
        //if (!rdbPrompt.Checked && !rdbNeverExp.Checked)
        //{
        //    lblMsg.Text = "Please select at least one condition.";
        //    return;
        //}
        //if (rdbPrompt.Checked)
        //{
        //    if (txtdays.Value == "")
        //    {
        //        lblMsg.Text = "Please enter days";
        //        return;
        //    }
        //    if (txtdays.Value == "0")
        //    {
        //        lblMsg.Text = "Number of days must be more than 0.";
        //        return;
        //    }
        //}
        try
        {
            Bill_Sys_LoginBO _obj = new Bill_Sys_LoginBO();
            strdays            = "30";
            strConfirmPassword = txtConfirmPassword.Text;
            if (strdays != "")
            {
                DateTime today = System.DateTime.Now;
                NextExpiry = today.AddDays(Convert.ToDouble(strdays)).ToString();
            }
            else
            {
                strdays    = "0";
                NextExpiry = DBNull.Value.ToString();
            }
            UID = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID;
            int iResult = 0;
            iResult = _obj.ForceChangePassword(strdays, NextExpiry, strConfirmPassword, UID);
            if (iResult == 1)
            {
                lblMsg.Text = "Password changed successfully.";
                Session.Abandon();
                Response.Redirect("../Bill_Sys_Login.aspx", false);
            }
            else
            {
                lblMsg.Text             = "Please type a different password!";
                txtNewPassword.Text     = "";
                txtConfirmPassword.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);
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
Exemple #5
0
    //protected bool detectIdentificationCookie(string cookieCode, string cookieEncryptionKey)
    //{
    //    try
    //    {
    //        if (String.IsNullOrEmpty(cookieCode))
    //            return false;
    //        else if (Request.Cookies["GREENBILLS_DETECTION"] == null)
    //            return false;
    //        else
    //        {
    //            HttpCookie cookie = Request.Cookies["GREENBILLS_DETECTION"];
    //            int i = 0;
    //            foreach (string val in cookie.Values)
    //            {
    //                if (cookie[val].Equals(Bill_Sys_Utility.ComputeHMACSHA1(cookieCode, cookieEncryptionKey)))
    //                {
    //                    return createIdentificationCookie(i);
    //                }
    //                i++;
    //            }
    //            return false;
    //        }
    //    }
    //    catch (Exception ex)
    //    {
    //        return false;
    //    }
    //}


    protected void btnActivate_Click(object sender, EventArgs e)
    {
        string str  = "";
        string roll = "";

        roll = ValidateUserAndToken(txtToken.Text, txtUserName.Text, EncryptPassword());
        if (roll != "")
        {
            if (ActivateUser(txtToken.Text, txtUserName.Text, EncryptPassword()))
            {
                createLoginCookies(txtUserName.Text,
                                   true,
                                   roll);

                //detectIdentificationCookie(Convert.ToString(Session["CookieCode"]), System.Configuration.ConfigurationManager.AppSettings.Get("COOKIE_ENCRYPT_KEY"));

                _bill_Sys_LoginBO = new Bill_Sys_LoginBO();
                DataSet set = new DataSet();
                set = _bill_Sys_LoginBO.getLoginDetails(txtUserName.Text, "", HttpContext.Current.Request.UserHostAddress);
                if ((set.Tables.Count > 0) && (set.Tables[0].Rows.Count > 0))
                {
                    this.objAppSettings = (ApplicationSettings_BO)base.Application["OBJECT_APP_SETTINGS"];
                    if (this.objAppSettings == null)
                    {
                        this.objAppSettings = new ApplicationSettings_BO();
                        base.Application["OBJECT_APP_SETTINGS"] = this.objAppSettings;
                    }
                    if ((set.Tables[0].Rows.Count == 1) && (set.Tables[0].Rows[0][0].ToString() == "False"))
                    {
                        string str3 = HttpContext.Current.Request.UserHostAddress.ToString();
                        FormsAuthentication.SignOut();
                        FormsAuthentication.RedirectToLoginPage("IPValidationCheck=false&InvalidIP=" + str3);
                        return;
                    }
                    this._bill_Sys_UserObject                           = new Bill_Sys_UserObject();
                    this._bill_Sys_UserObject.SZ_USER_ID                = set.Tables[0].Rows[0][0].ToString();
                    this._bill_Sys_UserObject.SZ_USER_NAME              = set.Tables[0].Rows[0][1].ToString();
                    this._bill_Sys_UserObject.SZ_USER_ROLE              = set.Tables[0].Rows[0][4].ToString();
                    this._bill_Sys_UserObject.SZ_PROVIDER_ID            = set.Tables[0].Rows[0][5].ToString();
                    this._bill_Sys_UserObject.SZ_USER_ROLE_NAME         = set.Tables[0].Rows[0][8].ToString();
                    this._bill_Sys_UserObject.SZ_USER_EMAIL             = set.Tables[0].Rows[0]["USER_EMAIL_ID"].ToString();
                    this._bill_Sys_UserObject.DomainName                = set.Tables[0].Rows[0]["DomainName"].ToString();
                    this.Session["USER_OBJECT"]                         = this._bill_Sys_UserObject;
                    this._bill_Sys_BillingCompanyObject                 = new Bill_Sys_BillingCompanyObject();
                    this._bill_Sys_BillingCompanyObject.SZ_COMPANY_ID   = set.Tables[0].Rows[0][2].ToString();
                    this._bill_Sys_BillingCompanyObject.SZ_COMPANY_NAME = set.Tables[0].Rows[0][3].ToString();
                    this._bill_Sys_BillingCompanyObject.SZ_PREFIX       = set.Tables[0].Rows[0][6].ToString();
                    this._bill_Sys_BillingCompanyObject.SZ_ADDRESS      = set.Tables[0].Rows[0][9].ToString();
                    this._bill_Sys_BillingCompanyObject.SZ_EMAIL        = set.Tables[0].Rows[0][10].ToString();
                    this._bill_Sys_BillingCompanyObject.SZ_PHONE        = set.Tables[0].Rows[0][11].ToString();
                    this._bill_Sys_BillingCompanyObject.SZ_FAX          = set.Tables[0].Rows[0][12].ToString();
                    if (set.Tables[0].Rows[0][7].ToString() != "")
                    {
                        this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY = Convert.ToBoolean(set.Tables[0].Rows[0][7].ToString());
                    }
                    else
                    {
                        this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY = false;
                    }
                    if (set.Tables[0].Rows[0][13].ToString() != "")
                    {
                        this._bill_Sys_BillingCompanyObject.BT_LAW_FIRM = Convert.ToBoolean(set.Tables[0].Rows[0][13].ToString());
                    }
                    else
                    {
                        this._bill_Sys_BillingCompanyObject.BT_LAW_FIRM = false;
                    }
                    if (set.Tables[0].Rows[0]["BT_ATTORNY"].ToString() != "")
                    {
                        this._bill_Sys_BillingCompanyObject.BT_ATTORNY = Convert.ToBoolean(set.Tables[0].Rows[0]["BT_ATTORNY"].ToString());
                    }
                    else
                    {
                        this._bill_Sys_BillingCompanyObject.BT_ATTORNY = false;
                    }
                    if (set.Tables[0].Rows[0]["BT_PROVIDER"].ToString() != "")
                    {
                        this._bill_Sys_BillingCompanyObject.BT_PROVIDER = Convert.ToBoolean(set.Tables[0].Rows[0]["BT_PROVIDER"].ToString());
                    }
                    else
                    {
                        this._bill_Sys_BillingCompanyObject.BT_PROVIDER = false;
                    }
                    this.Session["BILLING_COMPANY_OBJECT"] = this._bill_Sys_BillingCompanyObject;
                    this._bill_Sys_CaseInfo            = new Bill_Sys_Case();
                    this._bill_Sys_CaseInfo.SZ_CASE_ID = "";
                    this.Session["CASE_INFO"]          = this._bill_Sys_CaseInfo;
                    this._bill_Sys_SystemObject        = new Bill_Sys_SystemObject();
                    DataView view = new DataView(set.Tables[1]);
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00003'";
                    this._bill_Sys_SystemObject.SZ_DEFAULT_LAW_FIRM = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00004'";
                    this._bill_Sys_SystemObject.SZ_CHART_NO = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00007'";
                    this._bill_Sys_SystemObject.SZ_LOCATION = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00008'";
                    this._bill_Sys_SystemObject.SZ_CHECKINVALUE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00009'";
                    this._bill_Sys_SystemObject.AddVisits_SearchByChartNumber = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00014'";
                    this._bill_Sys_SystemObject.SZ_SHOW_PROCEDURE_CODE_ON_INTEGRATION = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00017'";
                    this._bill_Sys_SystemObject.SZ_SHOW_PROVIDER_DISPLAY_NAME = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00018'";
                    this._bill_Sys_SystemObject.SZ_SHOW_PATIENT_PHONE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00019'";
                    this._bill_Sys_SystemObject.SZ_SHOW_PATIENT_SIGNATURE_FOR_NF3 = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00020'";
                    this._bill_Sys_SystemObject.SZ_SHOW_DOCTOR_SIGNATURE_FOR_NF3 = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    this._bill_Sys_SystemObject.SZ_SHOW_DATE_OF_FIRST_TREATMENT  = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00022'";
                    this._bill_Sys_SystemObject.SZ_SHOW_NEW_POM = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00023'";
                    this._bill_Sys_SystemObject.SZ_ASSIGN_DIAGNOSIS_CODE_TO_VISIT = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00025'";
                    this._bill_Sys_SystemObject.ASSOCIATE_CASE_TYPE_WITH_VISITS = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00026'";
                    this._bill_Sys_SystemObject.ADD_LOCATION_TO_VISITS = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00024'";
                    this._bill_Sys_SystemObject.SZ_SHOW_INSURANCE_WITH_BILL = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00029'";
                    this._bill_Sys_SystemObject.SZ_ALLOW_TO_EDIT_NF2_PDF = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00028'";
                    this._bill_Sys_SystemObject.SZ_SHOW_NF3_PROCEDURE_CODE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00030'";
                    this._bill_Sys_SystemObject.ALLOW_TO_ADD_VISIT_FOR_FUTURE_DATE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00031'";
                    this._bill_Sys_SystemObject.PHONE_FORMATE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00032'";
                    this._bill_Sys_SystemObject.DONOT_ALLOW_TO_CREATE_BILL_WITHOUT_PATIENT_PHONE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00033'";
                    this._bill_Sys_SystemObject.DONOT_ALLOW_TO_CREATE_BILL_WITHOUT_LOCATION = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00034'";
                    this._bill_Sys_SystemObject.SZ_SHOW_ADD_TO_PREFERED_LIST = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00037'";
                    this._bill_Sys_SystemObject.SZ_ADD_SECONDARY_INSURANCE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00038'";
                    this._bill_Sys_SystemObject.SZ_SHOW_ADD_TO_PREFERED_LIST_FOR_DIAGNOSIS_CODE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00049'";
                    this._bill_Sys_SystemObject.SZ_SHOW_PATIENT_WALK_IN_ON_WORKAREA = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00050'";
                    this._bill_Sys_SystemObject.SZ_COPY_PATIENT_TO_TEST_FACILITY = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00054'";
                    this._bill_Sys_SystemObject.SZ_HP1_Display = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00051'";
                    this._bill_Sys_SystemObject.SZ_MG2_Display = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00062'";
                    this._bill_Sys_SystemObject.SZ_ALLOW_TO_EDIT_CODE_AMOUNT = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00059'";
                    this._bill_Sys_SystemObject.SZ_ALLOW_HP1_SIGN = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00057'";
                    this._bill_Sys_SystemObject.SZ_ALLOW_MODIFIER_TO_UPDATE_FOR_PROCEDURE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00080'";
                    this._bill_Sys_SystemObject.SZ_ADD_APPOINTMENT = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00082'";
                    this._bill_Sys_SystemObject.SZ_ENABLE_CYCLIC_PROCEDURE_CODE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00084'";
                    this._bill_Sys_SystemObject.IS_EMPLOYER = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";


                    view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00012'";
                    if (view.ToTable().Rows.Count > 0)
                    {
                        if (view.ToTable().Rows[0][1].ToString() == this._bill_Sys_UserObject.SZ_USER_ID)
                        {
                            this.Session["IPAdmin"] = "True";
                        }
                        else
                        {
                            this.Session["IPAdmin"] = "False";
                        }
                    }
                    else
                    {
                        this.Session["IPAdmin"] = "False";
                    }
                    DataTable table = set.Tables[2];
                    foreach (DataRow row in table.Rows)
                    {
                        if (row["SZ_CONFIGURATION"].ToString() == "SOFT DELETE")
                        {
                            this._bill_Sys_SystemObject.SZ_SOFT_DELETE = "True";
                        }
                        else
                        {
                            if (row["SZ_CONFIGURATION"].ToString() == "HARD DELETE")
                            {
                                this._bill_Sys_SystemObject.SZ_HARD_DELETE = "True";
                                continue;
                            }
                            if (row["SZ_CONFIGURATION"].ToString() == "NEW BILLS")
                            {
                                this._bill_Sys_SystemObject.SZ_NEW_BILL = "True";
                                continue;
                            }
                            if (row["SZ_CONFIGURATION"].ToString() == "VIEW BILLS")
                            {
                                this._bill_Sys_SystemObject.SZ_VIEW_BILL = "True";
                                continue;
                            }
                            if (row["SZ_CONFIGURATION"].ToString() == "DELETE BILLS")
                            {
                                this._bill_Sys_SystemObject.SZ_DELETE_BILLS = "True";
                                continue;
                            }
                            if (row["SZ_CONFIGURATION"].ToString() == "DELETE VISIT")
                            {
                                this._bill_Sys_SystemObject.SZ_DELETE_VIEWS = "True";
                                continue;
                            }
                            if (row["SZ_CONFIGURATION"].ToString() == "EMG BILL")
                            {
                                this._bill_Sys_SystemObject.SZ_EMG_BILL = "True";
                                continue;
                            }
                            if (row["SZ_CONFIGURATION"].ToString() == "NOTE DELETE")
                            {
                                this._bill_Sys_SystemObject.SZ_NOTE_DELETE = "True";
                                continue;
                            }
                            if (row["SZ_CONFIGURATION"].ToString() == "NOTE SOFT DELETE")
                            {
                                this._bill_Sys_SystemObject.SZ_NOTE_SOFT_DELETE = "True";
                            }
                        }
                    }
                    this.Session["SYSTEM_OBJECT"] = this._bill_Sys_SystemObject;
                    this._bill_Sys_LoginBO.ChangeLoginDate(((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID);
                    this.Session["REMINDER"]  = "TRUE";
                    this.Session["IMDETAILS"] = "TRUE";
                    string str4 = set.Tables[0].Rows[0][8].ToString();
                    this._bill_Sys_BillingCompanyObject.SZ_READ_ONLY = this._bill_Sys_LoginBO.Readonly();
                    this.Session["APPSTATUS"] = this._bill_Sys_BillingCompanyObject;
                    if (str4.ToLower() == "doctor")
                    {
                        if ((set.Tables.Count > 3) && (set.Tables[3].Rows.Count > 0))
                        {
                            str = set.Tables[3].Rows[0][0].ToString();
                        }
                        if (str.ToString().Equals("IM"))
                        {
                            this.Session["PageRedirect"] = "~/Bill_Sys_IM_CheckOut.aspx";
                        }
                        else
                        {
                            this.Session["PageRedirect"] = @"~/AJAX Pages\Bill_Sys_PatientSearch.aspx";
                        }
                    }
                    else if (str4.ToLower() == "agent")
                    {
                        this.Session["PageRedirect"] = "~/Agent/Bill_Sys_Agent_SearchCase.aspx";
                    }
                    else if (this._bill_Sys_BillingCompanyObject.BT_LAW_FIRM.ToString().Equals("True") && this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY.ToString().Equals("False"))
                    {
                        if ((str4.ToLower() == "lawfirm attorney") && (this.Session["urlintegration"] != null))
                        {
                            string s = this.Session["urlintegration"].ToString();
                            s = base.Server.UrlEncode(s);
                            this.Session["PageRedirect"] = "~/ATT/Bill_Sys_AttorneySearch.aspx?dt=" + s;
                        }
                        if (this.Session["IntDocUrl"] != null)
                        {
                            Bill_Sys_DocumentManagerObject obj2 = new Bill_Sys_DocumentManagerObject();
                            string str6 = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                            obj2 = (Bill_Sys_DocumentManagerObject)this.Session["IntDocUrl"];
                            string str7  = obj2.SZ_CASE_ID;
                            string str8  = obj2.SZ_CASE_NO;
                            string str9  = obj2.SZ_COMAPNY_ID;
                            string str10 = obj2.SZ_LAWFIRM_ID;
                            if (str6 == str10)
                            {
                                this.Session["PageRedirect"] = "~/Document Manager/case/vb_CaseInformation.aspx?caseid=" + str7 + "&caseno=" + str8 + "&cmpid=" + str9;
                            }
                            else
                            {
                                this.Session["PageRedirect"] = @"~/LF\Bill_Sys_SearchCase.aspx";
                            }
                        }
                        else
                        {
                            this.Session["PageRedirect"] = @"~/LF\Bill_Sys_SearchCase.aspx";
                        }
                    }
                    else if (this._bill_Sys_BillingCompanyObject.BT_PROVIDER.ToString().Equals("True"))
                    {
                        if (str4.ToLower() == "provider")
                        {
                            this.Session["PageRedirect"] = @"~/Provider\Bill_Sys_SearchCase.aspx";
                        }
                    }
                    else if (this._bill_Sys_BillingCompanyObject.BT_ATTORNY.ToString().Equals("True") && this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY.ToString().Equals("False"))
                    {
                        this.Session["PageRedirect"] = @"~/ATT\Bill_Sys_AttorneySearch.aspx";
                    }
                    else if (set.Tables[0].Rows[0][6].ToString() != "")
                    {
                        this.Session["PageRedirect"] = "~/AJAX Pages/Bill_Sys_SearchCase.aspx";
                    }
                    else
                    {
                        this.Session["PageRedirect"] = "~/Bill_Sys_BillingCompany.aspx";
                    }
                    if (set.Tables[0].Rows[0]["Force_PasswordChange"].ToString() == "True")
                    {
                        base.Response.Redirect(@"AJAX Pages\Bill_Sys_ChangePassword.aspx", false);
                        return;
                    }
                    if (str4.ToLower() == "doctor")
                    {
                        if (str.ToString().Equals("IM"))
                        {
                            base.Response.Redirect("Bill_Sys_IM_CheckOut.aspx", false);
                        }
                        else
                        {
                            base.Response.Redirect(@"AJAX Pages\Bill_Sys_PatientSearch.aspx", false);
                        }
                    }
                    else if (str4.ToLower() == "agent")
                    {
                        base.Response.Redirect(@"Agent\Bill_Sys_Agent_SearchCase.aspx", false);
                    }
                    else if (this._bill_Sys_BillingCompanyObject.BT_LAW_FIRM.ToString().Equals("True") && this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY.ToString().Equals("False"))
                    {
                        if ((str4.ToLower() == "lawfirm attorney") && (this.Session["urlintegration"] != null))
                        {
                            string str11 = this.Session["urlintegration"].ToString();
                            str11 = base.Server.UrlEncode(str11);
                            str11 = "ATT/Bill_Sys_AttorneySearch.aspx?dt=" + str11;
                            base.Response.Redirect(str11, false);
                        }
                        if (this.Session["IntDocUrl"] != null)
                        {
                            Bill_Sys_DocumentManagerObject obj3 = new Bill_Sys_DocumentManagerObject();
                            obj3 = (Bill_Sys_DocumentManagerObject)this.Session["IntDocUrl"];
                            string str12 = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                            string str13 = obj3.SZ_CASE_ID;
                            string str14 = obj3.SZ_CASE_NO;
                            string str15 = obj3.SZ_COMAPNY_ID;
                            string str16 = obj3.SZ_LAWFIRM_ID;
                            if (str12 == str16)
                            {
                                string url = "Document Manager/case/vb_CaseInformation.aspx?caseid=" + str13 + "&caseno=" + str14 + "&cmpid=" + str15;
                                base.Response.Redirect(url, false);
                            }
                            else
                            {
                                base.Response.Redirect(@"LF\Bill_Sys_SearchCase.aspx", false);
                            }
                        }
                        else
                        {
                            base.Response.Redirect(@"LF\Bill_Sys_SearchCase.aspx", false);
                        }
                    }
                    else if (this._bill_Sys_BillingCompanyObject.BT_PROVIDER.ToString().Equals("True"))
                    {
                        if (str4.ToLower() == "provider")
                        {
                            base.Response.Redirect(@"Provider\Bill_Sys_SearchCase.aspx", false);
                        }
                    }
                    else if (this._bill_Sys_BillingCompanyObject.BT_ATTORNY.ToString().Equals("True") && this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY.ToString().Equals("False"))
                    {
                        base.Response.Redirect(@"ATT\Bill_Sys_AttorneySearch.aspx", false);
                    }
                    else if (set.Tables[0].Rows[0][6].ToString() != "")
                    {
                        base.Response.Redirect("AJAX Pages/Bill_Sys_SearchCase.aspx", false);
                    }
                    else
                    {
                        base.Response.Redirect("Bill_Sys_BillingCompany.aspx", false);
                    }
                }
                else
                {
                    FormsAuthentication.SignOut();
                    FormsAuthentication.RedirectToLoginPage();
                }
            }
            else
            {
                lblErrorMsg.Text = "Activation failed";
            }
        }
        else
        {
            lblErrorMsg.Text = "Activation failed";
        }
    }
Exemple #6
0
    private void UserLogin()
    {
        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());
        }
        if (this.Session["UserName"] == null)
        {
        }
        try
        {
            string str  = "";
            string str2 = "";
            if (base.Request.QueryString["name"] != null)
            {
                str2 = base.Request.QueryString["name"].ToString();
            }
            new ArrayList();
            this._bill_Sys_LoginBO = new Bill_Sys_LoginBO();
            DataSet set = new DataSet();
            set = this._bill_Sys_LoginBO.getLoginDetails(this.Session["UserName"].ToString(), str2, HttpContext.Current.Request.UserHostAddress);
            if ((set.Tables.Count > 0) && (set.Tables[0].Rows.Count > 0))
            {
                this.objAppSettings = (ApplicationSettings_BO)base.Application["OBJECT_APP_SETTINGS"];
                if (this.objAppSettings == null)
                {
                    this.objAppSettings = new ApplicationSettings_BO();
                    base.Application["OBJECT_APP_SETTINGS"] = this.objAppSettings;
                }
                if ((set.Tables[0].Rows.Count == 1) && (set.Tables[0].Rows[0][0].ToString() == "False"))
                {
                    string str3 = HttpContext.Current.Request.UserHostAddress.ToString();
                    FormsAuthentication.SignOut();
                    FormsAuthentication.RedirectToLoginPage("IPValidationCheck=false&InvalidIP=" + str3);
                    return;
                }
                this._bill_Sys_UserObject                           = new Bill_Sys_UserObject();
                this._bill_Sys_UserObject.SZ_USER_ID                = set.Tables[0].Rows[0][0].ToString();
                this._bill_Sys_UserObject.SZ_USER_NAME              = set.Tables[0].Rows[0][1].ToString();
                this._bill_Sys_UserObject.SZ_USER_ROLE              = set.Tables[0].Rows[0][4].ToString();
                this._bill_Sys_UserObject.SZ_PROVIDER_ID            = set.Tables[0].Rows[0][5].ToString();
                this._bill_Sys_UserObject.SZ_USER_ROLE_NAME         = set.Tables[0].Rows[0][8].ToString();
                this._bill_Sys_UserObject.SZ_USER_EMAIL             = set.Tables[0].Rows[0]["USER_EMAIL_ID"].ToString();
                this._bill_Sys_UserObject.DomainName                = set.Tables[0].Rows[0]["DomainName"].ToString();
                this.Session["USER_OBJECT"]                         = this._bill_Sys_UserObject;
                this._bill_Sys_BillingCompanyObject                 = new Bill_Sys_BillingCompanyObject();
                this._bill_Sys_BillingCompanyObject.SZ_COMPANY_ID   = set.Tables[0].Rows[0][2].ToString();
                this._bill_Sys_BillingCompanyObject.SZ_COMPANY_NAME = set.Tables[0].Rows[0][3].ToString();
                this._bill_Sys_BillingCompanyObject.SZ_PREFIX       = set.Tables[0].Rows[0][6].ToString();
                this._bill_Sys_BillingCompanyObject.SZ_ADDRESS      = set.Tables[0].Rows[0][9].ToString();
                this._bill_Sys_BillingCompanyObject.SZ_EMAIL        = set.Tables[0].Rows[0][10].ToString();
                this._bill_Sys_BillingCompanyObject.SZ_PHONE        = set.Tables[0].Rows[0][11].ToString();
                this._bill_Sys_BillingCompanyObject.SZ_FAX          = set.Tables[0].Rows[0][12].ToString();
                if (set.Tables[0].Rows[0][7].ToString() != "")
                {
                    this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY = Convert.ToBoolean(set.Tables[0].Rows[0][7].ToString());
                }
                else
                {
                    this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY = false;
                }
                if (set.Tables[0].Rows[0][13].ToString() != "")
                {
                    this._bill_Sys_BillingCompanyObject.BT_LAW_FIRM = Convert.ToBoolean(set.Tables[0].Rows[0][13].ToString());
                }
                else
                {
                    this._bill_Sys_BillingCompanyObject.BT_LAW_FIRM = false;
                }
                if (set.Tables[0].Rows[0]["BT_ATTORNY"].ToString() != "")
                {
                    this._bill_Sys_BillingCompanyObject.BT_ATTORNY = Convert.ToBoolean(set.Tables[0].Rows[0]["BT_ATTORNY"].ToString());
                }
                else
                {
                    this._bill_Sys_BillingCompanyObject.BT_ATTORNY = false;
                }
                if (set.Tables[0].Rows[0]["BT_PROVIDER"].ToString() != "")
                {
                    this._bill_Sys_BillingCompanyObject.BT_PROVIDER = Convert.ToBoolean(set.Tables[0].Rows[0]["BT_PROVIDER"].ToString());
                }
                else
                {
                    this._bill_Sys_BillingCompanyObject.BT_PROVIDER = false;
                }
                this.Session["BILLING_COMPANY_OBJECT"] = this._bill_Sys_BillingCompanyObject;
                //Custom schedular
                Session["Billing_Company_ID"]      = _bill_Sys_BillingCompanyObject.SZ_COMPANY_ID;
                this._bill_Sys_CaseInfo            = new Bill_Sys_Case();
                this._bill_Sys_CaseInfo.SZ_CASE_ID = "";
                this.Session["CASE_INFO"]          = this._bill_Sys_CaseInfo;
                this._bill_Sys_SystemObject        = new Bill_Sys_SystemObject();
                DataView view = new DataView(set.Tables[1]);
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00003'";
                this._bill_Sys_SystemObject.SZ_DEFAULT_LAW_FIRM = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00004'";
                this._bill_Sys_SystemObject.SZ_CHART_NO = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00007'";
                this._bill_Sys_SystemObject.SZ_LOCATION = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00008'";
                this._bill_Sys_SystemObject.SZ_CHECKINVALUE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00009'";
                this._bill_Sys_SystemObject.AddVisits_SearchByChartNumber = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00014'";
                this._bill_Sys_SystemObject.SZ_SHOW_PROCEDURE_CODE_ON_INTEGRATION = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00017'";
                this._bill_Sys_SystemObject.SZ_SHOW_PROVIDER_DISPLAY_NAME = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00018'";
                this._bill_Sys_SystemObject.SZ_SHOW_PATIENT_PHONE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00019'";
                this._bill_Sys_SystemObject.SZ_SHOW_PATIENT_SIGNATURE_FOR_NF3 = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00020'";
                this._bill_Sys_SystemObject.SZ_SHOW_DOCTOR_SIGNATURE_FOR_NF3 = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                this._bill_Sys_SystemObject.SZ_SHOW_DATE_OF_FIRST_TREATMENT  = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00022'";
                this._bill_Sys_SystemObject.SZ_SHOW_NEW_POM = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00023'";
                this._bill_Sys_SystemObject.SZ_ASSIGN_DIAGNOSIS_CODE_TO_VISIT = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00025'";
                this._bill_Sys_SystemObject.ASSOCIATE_CASE_TYPE_WITH_VISITS = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00026'";
                this._bill_Sys_SystemObject.ADD_LOCATION_TO_VISITS = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00024'";
                this._bill_Sys_SystemObject.SZ_SHOW_INSURANCE_WITH_BILL = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00029'";
                this._bill_Sys_SystemObject.SZ_ALLOW_TO_EDIT_NF2_PDF = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00028'";
                this._bill_Sys_SystemObject.SZ_SHOW_NF3_PROCEDURE_CODE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00030'";
                this._bill_Sys_SystemObject.ALLOW_TO_ADD_VISIT_FOR_FUTURE_DATE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00031'";
                this._bill_Sys_SystemObject.PHONE_FORMATE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00032'";
                this._bill_Sys_SystemObject.DONOT_ALLOW_TO_CREATE_BILL_WITHOUT_PATIENT_PHONE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00033'";
                this._bill_Sys_SystemObject.DONOT_ALLOW_TO_CREATE_BILL_WITHOUT_LOCATION = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00034'";
                this._bill_Sys_SystemObject.SZ_SHOW_ADD_TO_PREFERED_LIST = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00037'";
                this._bill_Sys_SystemObject.SZ_ADD_SECONDARY_INSURANCE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00038'";
                this._bill_Sys_SystemObject.SZ_SHOW_ADD_TO_PREFERED_LIST_FOR_DIAGNOSIS_CODE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00049'";
                this._bill_Sys_SystemObject.SZ_SHOW_PATIENT_WALK_IN_ON_WORKAREA = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00050'";
                this._bill_Sys_SystemObject.SZ_COPY_PATIENT_TO_TEST_FACILITY = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00054'";
                this._bill_Sys_SystemObject.SZ_HP1_Display = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00051'";
                this._bill_Sys_SystemObject.SZ_MG2_Display = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00062'";
                this._bill_Sys_SystemObject.SZ_ALLOW_TO_EDIT_CODE_AMOUNT = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00059'";
                this._bill_Sys_SystemObject.SZ_ALLOW_HP1_SIGN = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00057'";
                this._bill_Sys_SystemObject.SZ_ALLOW_MODIFIER_TO_UPDATE_FOR_PROCEDURE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00080'";
                this._bill_Sys_SystemObject.SZ_ADD_APPOINTMENT = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00082'";
                this._bill_Sys_SystemObject.SZ_ENABLE_CYCLIC_PROCEDURE_CODE = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00084'";
                this._bill_Sys_SystemObject.IS_EMPLOYER = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";
                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00086'";
                this._bill_Sys_SystemObject.SZ_ENABLE_CONTRACT_PDF_GENERATION = (view.ToTable().Rows.Count > 0) ? view.ToTable().Rows[0][1].ToString() : "0";


                view.RowFilter = "SZ_SYS_SETTING_KEY_ID='SS00012'";
                if (view.ToTable().Rows.Count > 0)
                {
                    if (view.ToTable().Rows[0][1].ToString() == this._bill_Sys_UserObject.SZ_USER_ID)
                    {
                        this.Session["IPAdmin"] = "True";
                    }
                    else
                    {
                        this.Session["IPAdmin"] = "False";
                    }
                }
                else
                {
                    this.Session["IPAdmin"] = "False";
                }
                DataTable table = set.Tables[2];
                foreach (DataRow row in table.Rows)
                {
                    if (row["SZ_CONFIGURATION"].ToString() == "SOFT DELETE")
                    {
                        this._bill_Sys_SystemObject.SZ_SOFT_DELETE = "True";
                    }
                    else
                    {
                        if (row["SZ_CONFIGURATION"].ToString() == "HARD DELETE")
                        {
                            this._bill_Sys_SystemObject.SZ_HARD_DELETE = "True";
                            continue;
                        }
                        if (row["SZ_CONFIGURATION"].ToString() == "NEW BILLS")
                        {
                            this._bill_Sys_SystemObject.SZ_NEW_BILL = "True";
                            continue;
                        }
                        if (row["SZ_CONFIGURATION"].ToString() == "VIEW BILLS")
                        {
                            this._bill_Sys_SystemObject.SZ_VIEW_BILL = "True";
                            continue;
                        }
                        if (row["SZ_CONFIGURATION"].ToString() == "DELETE BILLS")
                        {
                            this._bill_Sys_SystemObject.SZ_DELETE_BILLS = "True";
                            continue;
                        }
                        if (row["SZ_CONFIGURATION"].ToString() == "DELETE VISIT")
                        {
                            this._bill_Sys_SystemObject.SZ_DELETE_VIEWS = "True";
                            continue;
                        }
                        if (row["SZ_CONFIGURATION"].ToString() == "EMG BILL")
                        {
                            this._bill_Sys_SystemObject.SZ_EMG_BILL = "True";
                            continue;
                        }
                        if (row["SZ_CONFIGURATION"].ToString() == "NOTE DELETE")
                        {
                            this._bill_Sys_SystemObject.SZ_NOTE_DELETE = "True";
                            continue;
                        }
                        if (row["SZ_CONFIGURATION"].ToString() == "NOTE SOFT DELETE")
                        {
                            this._bill_Sys_SystemObject.SZ_NOTE_SOFT_DELETE = "True";
                        }
                    }
                }
                this.Session["SYSTEM_OBJECT"] = this._bill_Sys_SystemObject;
                this._bill_Sys_LoginBO.ChangeLoginDate(((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID);
                this.Session["REMINDER"]  = "TRUE";
                this.Session["IMDETAILS"] = "TRUE";
                string str4 = set.Tables[0].Rows[0][8].ToString();
                if (str4.ToLower() == "doctor")
                {
                    if ((set.Tables.Count > 3) && (set.Tables[3].Rows.Count > 0))
                    {
                        str = set.Tables[3].Rows[0][0].ToString();
                    }
                    if (str.ToString().Equals("IM"))
                    {
                        this.Session["PageRedirect"] = "~/Bill_Sys_IM_CheckOut.aspx";
                    }
                    else
                    {
                        this.Session["PageRedirect"] = @"~/AJAX Pages\Bill_Sys_PatientSearch.aspx";
                    }
                }
                else if (str4.ToLower() == "agent")
                {
                    this.Session["PageRedirect"] = "~/Agent/Bill_Sys_Agent_SearchCase.aspx";
                }
                else if (this._bill_Sys_BillingCompanyObject.BT_LAW_FIRM.ToString().Equals("True") && this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY.ToString().Equals("False"))
                {
                    if ((str4.ToLower() == "lawfirm attorney") && (this.Session["urlintegration"] != null))
                    {
                        string s = this.Session["urlintegration"].ToString();
                        s = base.Server.UrlEncode(s);
                        this.Session["PageRedirect"] = "~/ATT/Bill_Sys_AttorneySearch.aspx?dt=" + s;
                    }
                    if (this.Session["IntDocUrl"] != null)
                    {
                        Bill_Sys_DocumentManagerObject obj2 = new Bill_Sys_DocumentManagerObject();
                        string str6 = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                        obj2 = (Bill_Sys_DocumentManagerObject)this.Session["IntDocUrl"];
                        string str7  = obj2.SZ_CASE_ID;
                        string str8  = obj2.SZ_CASE_NO;
                        string str9  = obj2.SZ_COMAPNY_ID;
                        string str10 = obj2.SZ_LAWFIRM_ID;
                        if (str6 == str10)
                        {
                            this.Session["PageRedirect"] = "~/Document Manager/case/vb_CaseInformation.aspx?caseid=" + str7 + "&caseno=" + str8 + "&cmpid=" + str9;
                        }
                        else
                        {
                            this.Session["PageRedirect"] = @"~/LF\Bill_Sys_SearchCase.aspx";
                        }
                    }
                    else
                    {
                        this.Session["PageRedirect"] = @"~/LF\Bill_Sys_SearchCase.aspx";
                    }
                }
                else if (this._bill_Sys_BillingCompanyObject.BT_PROVIDER.ToString().Equals("True"))
                {
                    if (str4.ToLower() == "provider")
                    {
                        this.Session["PageRedirect"] = @"~/Provider\Bill_Sys_SearchCase.aspx";
                    }
                }
                else if (this._bill_Sys_BillingCompanyObject.BT_ATTORNY.ToString().Equals("True") && this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY.ToString().Equals("False"))
                {
                    this.Session["PageRedirect"] = @"~/ATT\Bill_Sys_AttorneySearch.aspx";
                }
                else if (set.Tables[0].Rows[0][6].ToString() != "")
                {
                    this.Session["PageRedirect"] = "~/AJAX Pages/Bill_Sys_SearchCase.aspx";
                }
                else
                {
                    this.Session["PageRedirect"] = "~/Bill_Sys_BillingCompany.aspx";
                }
                if (set.Tables[0].Rows[0]["Force_PasswordChange"].ToString() == "True")
                {
                    base.Response.Redirect(@"AJAX Pages\Bill_Sys_ChangePassword.aspx", false);
                    return;
                }
                if (str4.ToLower() == "doctor")
                {
                    if (str.ToString().Equals("IM"))
                    {
                        base.Response.Redirect("Bill_Sys_IM_CheckOut.aspx", false);
                    }
                    else
                    {
                        base.Response.Redirect(@"AJAX Pages\Bill_Sys_PatientSearch.aspx", false);
                    }
                }
                else if (str4.ToLower() == "agent")
                {
                    base.Response.Redirect(@"Agent\Bill_Sys_Agent_SearchCase.aspx", false);
                }
                else if (this._bill_Sys_BillingCompanyObject.BT_LAW_FIRM.ToString().Equals("True") && this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY.ToString().Equals("False"))
                {
                    if ((str4.ToLower() == "lawfirm attorney") && (this.Session["urlintegration"] != null))
                    {
                        string str11 = this.Session["urlintegration"].ToString();
                        str11 = base.Server.UrlEncode(str11);
                        str11 = "ATT/Bill_Sys_AttorneySearch.aspx?dt=" + str11;
                        base.Response.Redirect(str11, false);
                    }
                    if (this.Session["IntDocUrl"] != null)
                    {
                        Bill_Sys_DocumentManagerObject obj3 = new Bill_Sys_DocumentManagerObject();
                        obj3 = (Bill_Sys_DocumentManagerObject)this.Session["IntDocUrl"];
                        string str12 = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                        string str13 = obj3.SZ_CASE_ID;
                        string str14 = obj3.SZ_CASE_NO;
                        string str15 = obj3.SZ_COMAPNY_ID;
                        string str16 = obj3.SZ_LAWFIRM_ID;
                        if (str12 == str16)
                        {
                            string url = "Document Manager/case/vb_CaseInformation.aspx?caseid=" + str13 + "&caseno=" + str14 + "&cmpid=" + str15;
                            base.Response.Redirect(url, false);
                        }
                        else
                        {
                            base.Response.Redirect(@"LF\Bill_Sys_SearchCase.aspx", false);
                        }
                    }
                    else
                    {
                        base.Response.Redirect(@"LF\Bill_Sys_SearchCase.aspx", false);
                    }
                }
                else if (this._bill_Sys_BillingCompanyObject.BT_PROVIDER.ToString().Equals("True"))
                {
                    if (str4.ToLower() == "provider")
                    {
                        base.Response.Redirect(@"Provider\Bill_Sys_SearchCase.aspx", false);
                    }
                }
                else if (this._bill_Sys_BillingCompanyObject.BT_ATTORNY.ToString().Equals("True") && this._bill_Sys_BillingCompanyObject.BT_REFERRING_FACILITY.ToString().Equals("False"))
                {
                    base.Response.Redirect(@"ATT\Bill_Sys_AttorneySearch.aspx", false);
                }
                else if (set.Tables[0].Rows[0][6].ToString() != "")
                {
                    base.Response.Redirect("AJAX Pages/Bill_Sys_SearchCase.aspx", false);
                }
                else
                {
                    base.Response.Redirect("Bill_Sys_BillingCompany.aspx", false);
                }
            }
            else
            {
                FormsAuthentication.SignOut();
                FormsAuthentication.RedirectToLoginPage();
            }
            this._bill_Sys_BillingCompanyObject.SZ_READ_ONLY = this._bill_Sys_LoginBO.Readonly();
            this.Session["APPSTATUS"] = this._bill_Sys_BillingCompanyObject;
        }
        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());
        }
        int        i;
        bool       flag;
        HttpCookie loggedout = new HttpCookie("loggedout", "0");

        loggedout.Expires = DateTime.Now.AddYears(1);
        Response.Cookies.Add(loggedout);

        Bill_Sys_PatientList.log.Debug("Search case page_load");
        this.utxtUserId.Text = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID;
        this.RegisterClientScriptBlock("ClientScript", "<script language=JavaScript> function autoComplete (field, select, property, forcematch) {var found = false;for (var i = 0; i < select.options.length; i++) {if (select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase()) == 0) {\t\tfound=true; break;}}if (found) { select.selectedIndex = i; }else {select.selectedIndex = -1;}if (field.createTextRange) {if (forcematch && !found) {field.value=field.value.substring(0,field.value.length-1); return;}var cursorKeys ='8;46;37;38;39;40;33;34;35;36;45;';if (cursorKeys.indexOf(event.keyCode+';') == -1) {var r1 = field.createTextRange();var oldValue = r1.text;var newValue = found ? select.options[i][property] : oldValue;if (newValue != field.value) {field.value = newValue;var rNew = field.createTextRange();rNew.moveStart('character', oldValue.length) ;rNew.select();}}}} </script>");
        this.ajAutoIns.ContextKey  = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        this.ajAutoName.ContextKey = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
        this.btnSoftDelete.Attributes.Add("onclick", "return Validate()");
        this.btnExportToExcel.Attributes.Add("onclick", "return ValidateExportBill()");
        if (!base.IsPostBack)
        {
            try
            {
                DataSet dataSet = new DataSet();
                dataSet = (new Bill_Sys_ProcedureCode_BO()).Get_Sys_Key("SS00041", ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
                {
                    if (dataSet.Tables[0].Rows[0][0].ToString() != "0")
                    {
                        this.Session["SendPatientToDoctor"] = true;
                    }
                    else
                    {
                        this.Session["SendPatientToDoctor"] = false;
                    }
                }
            }
            catch (Exception exception)
            {
                this.Session["SendPatientToDoctor"] = false;
            }
        }
        StringBuilder stringBuilder  = new StringBuilder();
        StringBuilder stringBuilder1 = new StringBuilder();

        stringBuilder.Append("Case #,");
        if (!((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).BT_REFERRING_FACILITY)
        {
            stringBuilder1.Append("SZ_CASE_NO,");
            this.grdPatientList.Columns[33].Visible = false;
        }
        else
        {
            stringBuilder1.Append("SZ_RECASE_NO,");
            this.grdPatientList.Columns[25].Visible = true;
            this.grdPatientList.Columns[33].Visible = true;
        }
        if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_CHART_NO == "1")
        {
            stringBuilder.Append("Chart No,");
            stringBuilder1.Append("SZ_CHART_NO,");
        }
        if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_LOCATION == "1")
        {
            this.extddlLocation.Visible = true;
            this.lblLocation.Visible    = true;
        }
        else
        {
            this.extddlLocation.Visible = false;
            this.lblLocation.Visible    = false;
        }
        stringBuilder.Append("Patient Name,Accident Date,Open Date,Insurance Name,Claim Number,Policy Number,Case Type,Case Status");
        stringBuilder1.Append("SZ_PATIENT_NAME,DT_DATE_OF_ACCIDENT,DT_DATE_OPEN,SZ_INSURANCE_NAME,SZ_CLAIM_NUMBER,SZ_POLICY_NUMBER,SZ_CASE_TYPE,SZ_STATUS_NAME");
        if (!((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ROLE_NAME.ToLower().Equals("admin"))
        {
            stringBuilder.Append(",Patient Phone");
            stringBuilder1.Append(",SZ_PATIENT_PHONE");
        }
        else
        {
            stringBuilder.Append(",Total,Paid,Pending");
            stringBuilder1.Append(",Total,Paid,Pending");
        }
        Bill_Sys_LoginBO billSysLoginBO = new Bill_Sys_LoginBO();
        string           str            = billSysLoginBO.getconfiguration(((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ROLE, ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);

        if (!(str != "") || str == null)
        {
            this.grdPatientList.Columns[27].Visible = false;
            this.grdPatientList.Columns[28].Visible = false;
        }
        else
        {
            this.grdPatientList.Columns[27].Visible = true;
            this.grdPatientList.Columns[28].Visible = true;
            stringBuilder.Append(",Case Type");
            stringBuilder1.Append(",SZ_CASE_TYPE");
            stringBuilder.Append(",Case Status");
            stringBuilder1.Append(",SZ_STATUS_NAME");
        }
        if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_SHOW_PROCEDURE_CODE_ON_INTEGRATION != "1")
        {
            this.grdPatientList.Columns[29].Visible = false;
        }
        else
        {
            this.grdPatientList.Columns[29].Visible = true;
            stringBuilder.Append(",Patient ID");
            stringBuilder1.Append(",SZ_PATIENT_ID_LHR");
        }
        if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_SHOW_DATE_OF_FIRST_TREATMENT != "1")
        {
            this.grdPatientList.Columns[30].Visible = false;
        }
        else
        {
            this.grdPatientList.Columns[30].Visible = true;
            stringBuilder.Append(",Date Of First Treatment");
            stringBuilder1.Append(",DT_FIRST_TREATMENT");
        }
        if (((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).BT_REFERRING_FACILITY)
        {
            stringBuilder.Append(",Provider Name");
            stringBuilder1.Append(",Provider_Name");
        }
        this.grdPatientList.ExportToExcelColumnNames = stringBuilder.ToString();
        this.grdPatientList.ExportToExcelFields      = stringBuilder1.ToString();
        Bill_Sys_PatientList.log.Debug("start Xgridbind.");
        this.con.SourceGrid                = this.grdPatientList;
        this.txtSearchBox.SourceGrid       = this.grdPatientList;
        this.grdPatientList.Page           = this.Page;
        this.grdPatientList.PageNumberList = this.con;
        Bill_Sys_PatientList.log.Debug("End Xgridbind.");
        if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_CHART_NO != "1")
        {
            this.grdPatientList.Columns[4].Visible = false;
            this.txtChartNo.Visible = false;
            this.lblChart.Visible   = false;
        }
        else
        {
            this.grdPatientList.Columns[4].Visible = true;
            this.txtChartNo.Visible = true;
            this.lblChart.Visible   = true;
        }
        if (!base.IsPostBack)
        {
            if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_SHOW_PROCEDURE_CODE_ON_INTEGRATION == "1")
            {
                this.lblpatientid.Visible = true;
                this.txtpatientid.Visible = true;
            }
            else
            {
                this.lblpatientid.Visible = false;
                this.txtpatientid.Visible = false;
            }
            this.txtCompanyID.Text       = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            this.extddlInsurance.Visible = false;
            this.extddlPatient.Visible   = false;
            this.fillcontrol();
            this.extddlCaseStatus.Flag_ID = this.txtCompanyID.Text.ToString();
            this.extddlCaseType.Flag_ID   = this.txtCompanyID.Text.ToString();
            this.extddlLocation.Flag_ID   = this.txtCompanyID.Text.ToString();
            string caseSatusId = (new CaseDetailsBO()).GetCaseSatusId(this.txtCompanyID.Text);
            this.extddlCaseStatus.Text = caseSatusId;
            this.fillcontrol();
            if (this.Session["CASE_LIST_GO_BUTTON"] != null)
            {
                this.utxtPatientName.Text           = this.Session["CASE_LIST_GO_BUTTON"].ToString();
                this.Session["CASE_LIST_GO_BUTTON"] = null;
            }
            if (!base.IsPostBack)
            {
                DataSet         userPreferences = new DataSet();
                UserPreferences userPreference  = new UserPreferences();
                userPreferences = userPreference.GetUserPreferences(((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID, "SearchCase");
                if (userPreferences.Tables.Count <= 0)
                {
                    this.txtNORec.Text                 = "";
                    this.con.SourceGrid                = this.grdPatientList;
                    this.txtSearchBox.SourceGrid       = this.grdPatientList;
                    this.grdPatientList.Page           = this.Page;
                    this.grdPatientList.PageNumberList = this.con;
                    this.grdPatientList.XGridBindSearch();
                }
                else if (userPreferences.Tables[0].Rows.Count <= 0)
                {
                    this.txtNORec.Text                 = "";
                    this.con.SourceGrid                = this.grdPatientList;
                    this.txtSearchBox.SourceGrid       = this.grdPatientList;
                    this.grdPatientList.Page           = this.Page;
                    this.grdPatientList.PageNumberList = this.con;
                }
                else if (!(userPreferences.Tables[0].Rows[0]["sz_preferences"].ToString() != ""))
                {
                    this.txtNORec.Text                 = "";
                    this.con.SourceGrid                = this.grdPatientList;
                    this.txtSearchBox.SourceGrid       = this.grdPatientList;
                    this.grdPatientList.Page           = this.Page;
                    this.grdPatientList.PageNumberList = this.con;
                    this.grdPatientList.XGridBindSearch();
                }
                else
                {
                    string   str1      = userPreferences.Tables[0].Rows[0]["sz_preferences"].ToString();
                    char[]   chrArray  = new char[] { ',' };
                    string[] strArrays = str1.Split(chrArray);
                    for (i = 0; i < (int)strArrays.Length; i++)
                    {
                        string str2 = strArrays[i].ToString();
                        chrArray = new char[] { '=' };
                        string[] strArrays1 = str2.Split(chrArray);
                        try
                        {
                            if (!(strArrays1[0].ToString() != "DO_NOT_LOAD_PATIENT_LIST" ? true : !(strArrays1[1].ToString() == "true")))
                            {
                                this.txtNORec.Text                 = "1";
                                this.txtViewLast.Text              = "";
                                this.con.SourceGrid                = this.grdPatientList;
                                this.txtSearchBox.SourceGrid       = this.grdPatientList;
                                this.grdPatientList.Page           = this.Page;
                                this.grdPatientList.PageNumberList = this.con;
                                this.grdPatientList.XGridBindSearch();
                                break;
                            }
                            else if (!(strArrays1[0].ToString() != "SHOW_ONLY_LAST" ? true : !(strArrays1[1].ToString() != "00")))
                            {
                                this.txtNORec.Text                 = "";
                                this.txtViewLast.Text              = "";
                                this.con.SourceGrid                = this.grdPatientList;
                                this.txtSearchBox.SourceGrid       = this.grdPatientList;
                                this.grdPatientList.Page           = this.Page;
                                this.grdPatientList.PageNumberList = this.con;
                                this.grdPatientList.PageRowCount   = Convert.ToInt32(strArrays1[1].ToString());
                                if (strArrays1[1].ToString() == "00")
                                {
                                    this.grdPatientList.PageRowCount = 50;
                                }
                                this.grdPatientList.XGridBind();
                                break;
                            }
                            else if ((strArrays1[0].ToString() != "SHOW_ONLY_LAST40VIEWED" ? false : strArrays1[1].ToString() != "00"))
                            {
                                this.txtNORec.Text                 = "";
                                this.txtViewLast.Text              = "1";
                                this.con.SourceGrid                = this.grdPatientList;
                                this.txtSearchBox.SourceGrid       = this.grdPatientList;
                                this.grdPatientList.Page           = this.Page;
                                this.grdPatientList.PageNumberList = this.con;
                                this.grdPatientList.PageRowCount   = Convert.ToInt32(strArrays1[1].ToString());
                                if (strArrays1[1].ToString() == "00")
                                {
                                    this.grdPatientList.PageRowCount = 50;
                                }
                                this.grdPatientList.XGridBind();
                                break;
                            }
                        }
                        catch (Exception ex)
                        {
                            this.txtNORec.Text                 = "";
                            this.con.SourceGrid                = this.grdPatientList;
                            this.txtSearchBox.SourceGrid       = this.grdPatientList;
                            this.grdPatientList.Page           = this.Page;
                            this.grdPatientList.PageNumberList = this.con;
                            this.grdPatientList.XGridBindSearch();
                            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                            using (Utils utility = new Utils())
                            {
                                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
                            }
                            string Elmahstr2 = "Error Request=" + id + ".Please share with Technical support.";
                            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + Elmahstr2);
                        }
                    }
                }
                //Method End
                using (Utils utility = new Utils())
                {
                    utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
                }
            }
            Bill_Sys_PatientList.log.Debug("Page_Load grdPatientList.XGridBindSearch() Completed");
            int count = this.grdPatientList.Rows.Count;
            this.clearcontrol();
        }
        if (!((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).BT_REFERRING_FACILITY)
        {
            this.grdPatientList.Columns[23].Visible = false;
            this.grdPatientList.Columns[24].Visible = false;
            this.grdPatientList.Columns[2].Visible  = true;
            this.grdPatientList.Columns[21].Visible = false;
            this.grdPatientList.Columns[22].Visible = true;
        }
        else
        {
            this.grdPatientList.Columns[3].Visible  = true;
            this.grdPatientList.Columns[19].Visible = false;
            this.grdPatientList.Columns[20].Visible = false;
        }
        string str3 = billSysLoginBO.getconfigurationlocation(((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ROLE, ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);

        if ((str3 == "" ? false : str3 != null))
        {
            this.grdPatientList.Columns[22].Visible = false;
        }
        if (!((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ROLE_NAME.ToLower().Equals("admin"))
        {
            this.grdPatientList.Columns[6].Visible  = true;
            this.grdPatientList.Columns[12].Visible = false;
            this.grdPatientList.Columns[13].Visible = false;
            this.grdPatientList.Columns[14].Visible = false;
        }
        else
        {
            this.grdPatientList.Columns[12].Visible = true;
            this.grdPatientList.Columns[13].Visible = true;
            this.grdPatientList.Columns[14].Visible = true;
            this.grdPatientList.Columns[6].Visible  = false;
        }
        if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_SHOW_PATIENT_PHONE == "1")
        {
            this.grdPatientList.Columns[6].Visible = true;
        }
        if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_CHECKINVALUE == "1")
        {
            this.grdPatientList.Columns[17].Visible = true;
            this.grdPatientList.Columns[18].Visible = true;
        }
        DataSet sysKey = new DataSet();

        sysKey = (new Bill_Sys_ProcedureCode_BO()).Get_Sys_Key("SS00040", this.txtCompanyID.Text);
        if ((sysKey.Tables.Count <= 0 || sysKey.Tables[0].Rows.Count <= 0 ? false : sysKey.Tables[0].Rows[0][0].ToString() == "0"))
        {
            this.grdPatientList.Columns[32].Visible = false;
        }
        if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_SOFT_DELETE == "True")
        {
            this.grdPatientList.Columns[35].Visible = true;
            this.btnSoftDelete.Visible = true;
        }
        if (base.Request.QueryString["Type"] == null || !(base.Request.QueryString["Type"].ToString() == "Quick"))
        {
            flag = true;
        }
        else
        {
            flag = (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_NEW_BILL == "True" ? false : !(((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_VIEW_BILL == "True"));
        }
        if (!flag)
        {
            this.grdPatientList.Columns[15].Visible = true;
            for (i = 0; i < this.grdPatientList.Rows.Count; i++)
            {
                HyperLink hyperLink  = (HyperLink)this.grdPatientList.Rows[i].Cells[15].FindControl("lnkNew");
                HyperLink hyperLink1 = (HyperLink)this.grdPatientList.Rows[i].Cells[15].FindControl("lnkView");
                if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_NEW_BILL == "True")
                {
                    hyperLink.Visible = true;
                }
                if (((Bill_Sys_SystemObject)this.Session["SYSTEM_OBJECT"]).SZ_VIEW_BILL == "True")
                {
                    hyperLink1.Visible = true;
                }
            }
        }
        this.fillcontrol();
        if (!base.IsPostBack)
        {
            int dose = this.GetDosespotUserDetails();
            if (dose == 1)
            {
                string        text          = this.txtClinicId.Text;
                int           num           = Convert.ToInt32(this.txtDosespotUserId.Text);
                string        str4          = EncryptionCommon.CreatePhrase();
                string        str5          = EncryptionCommon.CreatePhraseEncryptedCombinedString(str4, text);
                string        str6          = EncryptionCommon.EncryptUserId(str4, num, text);
                APISoapClient aPISoapClient = new APISoapClient("APISoap12");
                SingleSignOn  singleSignOn  = new SingleSignOn()
                {
                    SingleSignOnClinicId = Convert.ToInt32(text),
                    SingleSignOnUserId   = num
                };
                str5 = "";
                str6 = "";
                this.SingleSignonCode(this.txtClinicId.Text, num.ToString(), out str5, out str6, false);
                singleSignOn.SingleSignOnCode         = str5;
                singleSignOn.SingleSignOnUserIdVerify = str6;
                GetRefillRequestsTransmissionErrorsRequest     getRefillRequestsTransmissionErrorsRequest     = new GetRefillRequestsTransmissionErrorsRequest();
                RefillRequestsTransmissionErrorsMessageRequest refillRequestsTransmissionErrorsMessageRequest = new RefillRequestsTransmissionErrorsMessageRequest()
                {
                    SingleSignOn = singleSignOn,
                    ClinicianId  = num
                };
                getRefillRequestsTransmissionErrorsRequest.GetRefillRequestsTransmissionErrorsMessageRequest = refillRequestsTransmissionErrorsMessageRequest;
                RefillRequestsTransmissionErrorsMessageResult refillRequestsTransmissionErrors = aPISoapClient.GetRefillRequestsTransmissionErrors(refillRequestsTransmissionErrorsMessageRequest);
                int    refillRequestsCount    = refillRequestsTransmissionErrors.RefillRequestsTransmissionErrors[0].RefillRequestsCount;
                int    transactionErrorsCount = refillRequestsTransmissionErrors.RefillRequestsTransmissionErrors[0].TransactionErrorsCount;
                string str7 = string.Concat(transactionErrorsCount.ToString(), " Transmission Error / ", refillRequestsCount.ToString(), " Refill requests");
                this.lnkDosespotErrors.Text    = str7;
                this.lnkDosespotErrors.Visible = true;
            }
            else
            {
                this.lnkDosespotErrors.Text    = "";
                this.lnkDosespotErrors.Visible = false;
            }
        }
        if ((base.IsPostBack ? false : this.Session["REMINDER"] != null))
        {
            this.Session["REMINDER"] = null;
            ReminderBO reminderBO = null;
            DataSet    dataSet1   = null;
            DataSet    dataSet2   = null;
            string     sZUSERID   = "";
            reminderBO = new ReminderBO();
            dataSet1   = new DataSet();
            sZUSERID   = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID;
            DateTime dateTime = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            dataSet1 = reminderBO.LoadReminderDetails(sZUSERID, dateTime);
            dataSet2 = reminderBO.LoadReminderDetailsforAdd(sZUSERID, dateTime, ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
            if ((dataSet1.Tables[0].Rows.Count > 0 || dataSet1.Tables[1].Rows.Count > 0 ? true : dataSet2.Tables[0].Rows.Count > 0))
            {
                this.Page.RegisterStartupScript("ss", "<script language='javascript'> ReminderPopup();</script>");
            }
        }
    }