Пример #1
0
        /// <summary>
        /// 保存用户账号数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 记住账号_CheckedChanged(object sender, EventArgs e)
        {
            var mi = (CheckBox)sender;

            if (mi.Checked)
            {
                // 判断是否重复数据
                var cous = sqlUserDtos.Where(m => m.Server == 数据库ID_Value.Text && m.DataBase == 数据库ID_Value.SelectedValue.ToString());
                if (cous.Count() > 0)
                {
                    MessageCommon.ShowInf("重复用户数据!");
                    return;
                }
                #region 添加新地址
                SqlUserDto sqlUsers = new SqlUserDto();
                sqlUsers.Server   = 数据库ID_Value.Text;
                sqlUsers.DataBase = 库_Value.Text;
                sqlUsers.Uid      = 用户名_Value.Text;
                sqlUsers.Pwd      = EncryptionCommon.Encryption(密码_Value.Text);
                sqlUserDtos.Add(sqlUsers);
                #endregion
                JsonUtilities jsonUtilities = new JsonUtilities();
                // 转换json
                string json = jsonUtilities.JsonString <SqlUserDto>(sqlUserDtos);
                jsonUtilities.WipeFileContent(@"../../SqlUser.json", json);
            }
        }
Пример #2
0
        //写入登录的cookies信息 设置用户风格
        public bool LoginAuthority(string account, string password, string validateCode, bool flag, HttpResponseBase response, HttpSessionStateBase session)
        {
            //验证码
            if (session["ValidateCode"].IsNull() || session["ValidateCode"].ToString().ToLower() != validateCode.ToLower())
            {
                response.Write("<script>alert('验证码错误!')</script>");
                return(false);
            }

            using (Entities db = new Entities())
            {
                var search = db.V_PE_UserRole.Where(l => l.UserName == account && l.Activity == true).ToList();
                if (search.Any())
                {
                    var employeeId = search.First().EmployeeID;
                    if (db.T_HR_Staff.FirstOrDefault(l => l.StaffID == employeeId) == null)
                    {
                        response.Write("<script>alert('存在此用户但是当前没有注册该员工基本信息,因此禁止该用户的登录!')</script>");
                        return(false);
                    }
                    Authentication authenticationobj = new Authentication();
                    V_PE_UserRole  applyment         = search.First();

                    string encodepassword = EncryptionCommon.Sha256(password);
                    var    admitted       = authenticationobj.IsUser(applyment.UserID, account, encodepassword);
                    if (admitted)
                    {
                        T_PE_Users user   = db.T_PE_Users.Find(applyment.UserID);
                        HttpCookie cookie = new HttpCookie("User");
                        cookie.Values.Add("UserName", HttpUtility.UrlEncode(account));
                        cookie.Values.Add("Password", HttpUtility.UrlEncode(encodepassword));
                        cookie.Values.Add("UserID", HttpUtility.UrlEncode(applyment.UserID));
                        if (flag)
                        {
                            cookie.Expires = DateTime.Now.AddMinutes(30);
                        }
                        response.Cookies.Add(cookie);
                        Theme userstyle;
                        if (Enum.TryParse(user.Style, true, out userstyle))
                        {
                            //session["Ext.Net.Theme"] = userstyle;
                            session["Ext.Net.Theme"] = Theme.Default;
                        }
                        else
                        {
                            session["Ext.Net.Theme"] = Theme.Default;
                        }

                        return(true);
                    }
                }
            }

            return(false);
        }
Пример #3
0
    private void SingleSignonCode(string ClinicKey, string UserID, out string SingleSignOnCode, out string SingleSignOnUserIdVerify, bool IsUrlEncoding)
    {
        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 base64String;

        SingleSignOnCode         = "";
        SingleSignOnUserIdVerify = "";
        string str = EncryptionCommon.CreatePhrase();

        byte[]        bytes         = EncodingUtility.GetBytes(string.Concat(str, this.Key), EncodingUtility.encodingOptions.UTF8);
        SHA512Managed sHA512Managed = new SHA512Managed();

        try
        {
            base64String = Convert.ToBase64String(sHA512Managed.ComputeHash(bytes));
        }

        finally
        {
            if (sHA512Managed != null)
            {
                ((IDisposable)sHA512Managed).Dispose();
            }
        }
        if (base64String.Substring(base64String.Length - 2, 2).Equals("=="))
        {
            base64String = base64String.Substring(0, base64String.Length - 2);
        }
        SingleSignOnCode         = (IsUrlEncoding ? HttpUtility.UrlEncode(string.Concat(str, base64String)) : string.Concat(str, base64String));
        base64String             = "";
        SingleSignOnUserIdVerify = string.Concat(UserID, str.Substring(0, 22), this.Key);
        bytes         = EncodingUtility.GetBytes(SingleSignOnUserIdVerify, EncodingUtility.encodingOptions.UTF8);
        sHA512Managed = new SHA512Managed();
        try
        {
            base64String = Convert.ToBase64String(sHA512Managed.ComputeHash(bytes));
        }
        finally
        {
            if (sHA512Managed != null)
            {
                ((IDisposable)sHA512Managed).Dispose();
            }
        }
        if (base64String.Substring(base64String.Length - 2, 2).Equals("=="))
        {
            base64String = base64String.Substring(0, base64String.Length - 2);
        }
        SingleSignOnUserIdVerify = (IsUrlEncoding ? HttpUtility.UrlEncode(base64String) : base64String);
    }
Пример #4
0
        /// <summary>
        /// 选择数据id联动
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 数据库ID_Value_SelectedIndexChanged(object sender, EventArgs e)
        {
            var thiss = (ComboBox)sender;
            var cous  = sqlUserDtos.Where(m => m.Server == thiss.Text && m.DataBase == thiss.SelectedValue.ToString()).FirstOrDefault();

            if (cous != null)
            {
                库_Value.Text   = cous.DataBase;
                用户名_Value.Text = cous.Uid;
                密码_Value.Text  = EncryptionCommon.Decrypt(cous.Pwd);
            }
        }
Пример #5
0
            public static string GetRefillReqURL(string ClinicKey, int ClinicId, int UserId)
            {
                string        Phrase                   = EncryptionCommon.CreatePhrase();
                string        SingleSignOnCode         = EncryptionCommon.CreatePhraseEncryptedCombinedString(Phrase, ClinicKey);
                string        SingleSignOnUserIdVerify = EncryptionCommon.EncryptUserId(Phrase, UserId, ClinicKey);
                StringBuilder sb = new StringBuilder();

                QueryStringAddParameter(sb, "SingleSignOnCode", SingleSignOnCode);
                QueryStringAddParameter(sb, "SingleSignOnUserId", UserId);
                QueryStringAddParameter(sb, "SingleSignOnUserIdVerify", SingleSignOnUserIdVerify);
                QueryStringAddParameter(sb, "SingleSignOnClinicId", ClinicId);
                sb.Append("&RefillsErrors=1");
                return(sb.ToString());
            }
Пример #6
0
            public static string GetSingleSignOnQueryStringForPatient(string ClinicKey, int ClinicId, int UserId, DoseSpotPatient patient)
            {
                string        Phrase                   = EncryptionCommon.CreatePhrase();
                string        SingleSignOnCode         = EncryptionCommon.CreatePhraseEncryptedCombinedString(Phrase, ClinicKey);
                string        SingleSignOnUserIdVerify = EncryptionCommon.EncryptUserId(Phrase, UserId, ClinicKey);
                StringBuilder sb = new StringBuilder();

                QueryStringAddParameter(sb, "SingleSignOnCode", SingleSignOnCode);
                QueryStringAddParameter(sb, "SingleSignOnUserId", UserId);
                QueryStringAddParameter(sb, "SingleSignOnUserIdVerify", SingleSignOnUserIdVerify);
                QueryStringAddParameter(sb, "SingleSignOnClinicId", ClinicId);
                sb.Append(patient.ToQueryString());
                return(sb.ToString());
            }
Пример #7
0
    protected void btnDosespot_Click(object sender, EventArgs e)
    {
        this.GetDosespotUserDetails();
        string text = this.txtClinicId.Text;

        Convert.ToInt32(this.txtDosespotUserId.Text);
        string str   = EncryptionCommon.CreatePhrase();
        string text1 = this.txtClinicId.Text;
        string str1  = this.txtDosespotUserId.Text;
        string str2  = "zoJk1Ga8aXgkCrU7vqCvvebory3NafUzZNDhWUetYJ1mKCsrsslkGG7to0Za52c9U44qDX54SLWVo1pRtvX5PLI8ClUddzovPiLi31yVkbzo5YUFk/0x8w";
        string str3  = "24GhIluoPngKqHsOw/XhpUg9g4t4Gbs1KQDHBKqhh41wfXRrvmdeg+DhiRP7FiNcPovq3aZuZKruMo8LnC+cYQ";

        string[] strArrays = new string[] { "http://my.staging.dosespot.com/LoginSingleSignOn.aspx?b=2&SingleSignOnClinicId=", text1, "&SingleSignOnUserId=", str1, "&SingleSignOnPhraseLength=", str, "&SingleSignOnCode=", str2, "&SingleSignOnUserIdVerify=", str3, "&RefillsErrors=1" };
        string   str4      = string.Concat(strArrays);

        base.Response.Redirect(str4);
    }
Пример #8
0
    protected void lnkDosespotErrors_Click(object sender, EventArgs e)
    {
        this.GetDosespotUserDetails();
        string text = this.txtClinicId.Text;

        Convert.ToInt32(this.txtDosespotUserId.Text);
        EncryptionCommon.CreatePhrase();
        string str   = this.txtClinicId.Text;
        string text1 = this.txtDosespotUserId.Text;
        string str1  = "";
        string str2  = "";

        this.SingleSignonCode(str, text1, out str1, out str2, true);
        string[] strArrays = new string[] { "http://my.staging.dosespot.com/LoginSingleSignOn.aspx?b=2&SingleSignOnClinicId=", str, "&SingleSignOnUserId=", text1, "&SingleSignOnPhraseLength=32&SingleSignOnCode=", str1, "&SingleSignOnUserIdVerify=", str2, "&RefillsErrors=0" };
        string   str3      = string.Concat(strArrays);

        base.Response.Redirect(str3);
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        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>");
            }
        }
    }