コード例 #1
0
        private void getDate()
        {
            try
            {
                DataTable dtm             = new DataTable();
                DataTable dtf             = new DataTable();
                string    strDoctorId     = string.Empty;
                string    strModuleIdLike = string.Empty;
                string    strWhere        = string.Empty;
                if (Request["id"] != null)
                {
                    strDoctorId = Request["id"].ToString();
                }
                if (hidSysCode.Value != "" && hidFirstModule.Value != "")
                {
                    strModuleIdLike = hidFirstModule.Value.Substring(0, 2);

                    strWhere += " and ISINTREE ='Y' and sm.SysCode='" + hidSysCode.Value.Split('|')[0] + "' and (slevel LIKE '" + strModuleIdLike + "%') ";
                    dtm       = new BLL_SysModule().GetModuleListBySysCode(strWhere).Tables[0];
                    dtf       = new BLL_SysModuleFunctionRole().GetRoleModuleFunctionBySysCode(strDoctorId, strModuleIdLike, hidSysCode.Value.Split('|')[0]).Tables[0];
                    FullTree(dtm, dtf, tvMF);
                }
            }
            catch (Exception ex)
            {
                new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace));
                throw ex;
            }
        }
コード例 #2
0
        protected void ibtnLogin_Click(object sender, EventArgs e)
        {
            if (Session["AdminValidateCode"] == null)
            {
                Response.Redirect("Index.aspx");
                Response.End();
            }
            string CheckCode = Session["AdminValidateCode"].ToString();

            Session.Remove("AdminValidateCode");
            if (TxtVerify.Value.ToUpper() == CheckCode)
            {
                string loginName = string.Empty;
                string passWord  = string.Empty;
                loginName = txtLoginName.Value.Trim();
                passWord  = Rc.Common.StrUtility.DESEncryptLogin.EncryptString(psd.Value);

                Model_VSysUserRole loginModel = new Model_VSysUserRole();
                object             obj        = new BLL_VSysUserRole().GetVDoctorInfoModelByLogin(loginName, passWord);
                if (obj != null)
                {
                    loginModel = obj as Model_VSysUserRole;
                    DataTable dt  = new BLL_SysModule().GetOwenModuleListByCacheBySysCode(loginModel.SysUser_ID, Rc.Common.StrUtility.clsUtility.ReDoStr(loginModel.SysRole_IDs, ','));
                    DataRow[] drs = dt.Select("isLast='1' and url<>'#'", "DefaultOrder desc");
                    if (drs.Count() > 0)
                    {
                        Session["LoginUser"] = loginModel;
                        if (Request["iurl"] != null)
                        {
                            Response.Redirect(Request["iurl"].ToString());
                        }
                        else
                        {
                            Response.Redirect("/" + drs[0]["url"].ToString());
                        }
                    }
                    else
                    {
                        Rc.Common.StrUtility.clsUtility.ErrorDispose(this.Page, 6, false);
                    }
                }
                else
                {
                    Session.Clear();
                    ClientScript.RegisterStartupScript(this.GetType(), "login", "<script>$(function(){layer.ready(function(){layer.msg('用户名或密码错误',{icon:2})})})</script>");
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "login", "<script>$(function(){layer.ready(function(){layer.msg('验证码输入不正确',{icon:2})})})</script>");
            }
        }
コード例 #3
0
ファイル: sys.Master.cs プロジェクト: a157591984/jiguang
        protected string GetFristMenu()
        {
            //临时字符串
            string strTemp = string.Empty;
            //css样式
            string strCss = string.Empty;


            StringBuilder strMenu = new StringBuilder();
            //从缓存中读取菜单
            DataTable dt = new BLL_SysModule().GetOwenModuleListByCacheBySysCode(loginUser.SysUser_ID, Rc.Common.StrUtility.clsUtility.ReDoStr(loginUser.SysRole_IDs, ','));

            if (dt != null)
            {
                //查询出一级菜单
                var drs = dt.Select(" PARENTID='0' ");
                //最上级

                string urldefault = string.Empty;
                for (int i = 0; i < drs.Length; i++)
                {
                    if (Module_Ids.IndexOf(drs[i]["ModuleId"].ToString()) >= 0)
                    {
                        strCss = "active";
                    }
                    else
                    {
                        strCss = "";
                    }
                    strMenu.Append("<li class=\"" + strCss + "\">");

                    DataTable dtTemp = new DataTable();
                    dtTemp = new BLL_clsAuth().GetOwenTreeByCatchBySysCode(loginUser.SysUser_ID, Rc.Common.StrUtility.clsUtility.ReDoStr(loginUser.SysRole_IDs, ','), drs[i]["moduleid"].ToString().Substring(0, 2));
                    DataRow[] drTemp = dtTemp.Select("isLast='1' and url<>'#'", "DefaultOrder desc");
                    if (drTemp.Length > 0)
                    {
                        urldefault = drTemp[0]["url"].ToString();
                        //Response.Redirect("/" + drs[0]["url"].ToString());
                    }
                    else
                    {
                        //PHHC.Share.StrUtility.clsUtility.ErrorDispose(this.Page, 6, false);
                    }
                    strMenu.Append("<a href='" + Rc.Common.StrUtility.clsUtility.getHostPath() + "/" + urldefault + "'\">" + drs[i]["modulename"] + "</a></li> ");
                    //strMenu.Append("<div class=\"div_menu_split\" id=\"div_menu_split_00" + (i + 1) + "\"></div>   ");
                }
            }

            return(strMenu.ToString());
        }
コード例 #4
0
        private void getDate()
        {
            try
            {
                DataTable dtm             = new DataTable();
                DataTable dtf             = new DataTable();
                string    strDoctorId     = string.Empty;
                string    strModuleIdLike = string.Empty;
                string    strWhere        = string.Empty;
                if (Request["id"] != null)
                {
                    strDoctorId = Request["id"].ToString();
                }

                if (hidSysCode.Value != "" && hidFirstModule.Value != "")
                {
                    strModuleIdLike = hidFirstModule.Value.Substring(0, 2);
                    strWhere       += " and ISINTREE ='Y' and sm.SysCode='" + hidSysCode.Value.Split('|')[0].Filter() + "' and (slevel LIKE '" + strModuleIdLike + "%') ";
                    if (Rc.Common.Config.Consts.AdminID != loginUser.SysUser_ID)
                    {
                        strWhere += string.Format(@"   and MODULEID IN (
               SELECT    MODULEID
          FROM      SysModuleFunctionUser
          WHERE     SysCode = '{0}'
                    AND User_ID = '{1}'
          UNION
          SELECT    MODULEID
          FROM      dbo.SysModuleFunctionRole
          WHERE     SysRole_ID IN (
                    SELECT  SysRole_ID
                    FROM    dbo.SysUserRoleRelation
                    WHERE   syscode = '{0}'
                            AND SysUser_ID = '{1}'))", hidSysCode.Value.Split('|')[0].Filter(), loginUser.SysUser_ID);
                    }

                    dtm = new BLL_SysModule().GetModuleListBySysCode(strWhere).Tables[0];
                    dtf = new BLL_SysModuleFunctionUser().GetUserModuleFunctionBySysCode(strDoctorId, strModuleIdLike, hidSysCode.Value.Split('|')[0]).Tables[0];
                    FullTree(dtm, dtf, tvMF);
                }
            }
            catch (Exception ex)
            {
                new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace));
                throw ex;
            }
        }
コード例 #5
0
        private void GetTree()
        {
            try
            {
                DataTable dt = new DataTable();
                if (hidSysCode.Value != "" && hidFirstModule.Value != "")
                {
                    string strWhere = string.Empty;
                    strWhere += " and ISINTREE ='Y' and  sm.SysCode='" + hidSysCode.Value.Split('|')[0] + "' and (slevel LIKE '" + hidFirstModule.Value.Substring(0, 2) + "%') ";
                    dt = new BLL_SysModule().GetModuleListBySysCode(strWhere).Tables[0];
                    FullTree(dt, this.tvModuleFirst);
                }
            }
            catch (Exception ex)
            {
                new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace));
                throw ex; 
            }
            //tvMenu.Font.

        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string        key      = Request.QueryString["key"];
            StringBuilder strStr   = new StringBuilder();
            StringBuilder strWhere = new StringBuilder();
            DataTable     dt       = new DataTable();
            string        strJson  = string.Empty;

            if (string.IsNullOrEmpty(key))
            {
                key = Request["key"];
            }
            switch (key)
            {
            case "DeleteSysModuleByID":
                #region 根据ID删除模块关联信息
                string module_id = string.Empty;
                string syscode   = string.Empty;
                try
                {
                    module_id = Request["id"].ToString();

                    if (new BLL_SysModule().DeleteSysModuleBySyscodeAndModuleID(module_id))
                    {
                        StringBuilder str = new StringBuilder();
                        str.Append("【删除模块关联信息】模块关联信息ID:" + module_id);
                        new BLL_clsAuth().AddLogFromBS("Ajax/SysAJax.aspx", str.ToString());
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;

                #region 得到系统数据的JSON串
            case "GetSysCodeToJson":
                //dt = new BLL_SysProduct().GetList(" SysCode='00002'").Tables[0];
                // dt = new BLL_SysCode().GetSysCodeListByHospitalID("");
                Response.Write("{\"ds\":[{\"Value\":\"00001\",\"Text\":\"实施系统\"}]}");
                break;

                #endregion
                #region 得到一级菜单的JSON串
            case "GetModuleFristToJson":
                //dt = new BLL_SysModule().GetModuleFirstBySysCode(Request["f"].ToString()).Tables[0];
                dt = new BLL_SysModule().GetSysModuleForFirstBySysCode(Request["f"].ToString()).Tables[0];
                Response.Write(Rc.Cloud.Web.Common.pfunction.DtToJson(dt, "MODULEID", "MODULENAME"));
                break;

                #region  除系统信息
            case "SysCodeTempDelete":
                try
                {
                    string sysCodeT = clsUtility.Decrypt(Request.QueryString["Aid"]);
                    //if (new BLL_SysCode().DeleteSysCodeBySysCode(sysCodeT) == true)
                    //{
                    //    //MS.Authority.clsAuth.AddLogFromBS("", String.Format("删除成功 【系统编码】:{0}", sysCodeT));
                    //    strStr.Append(1);
                    //}
                    //else
                    //{
                    //    //MS.Authority.clsAuth.AddLogFromBS("", String.Format("删除失败 【系统编码】:{0}", sysCodeT));
                    //    strStr.Append(0);
                    //}
                }
                catch
                {
                    //strJson = ex.Message.ToString();
                    strJson = "0";
                }
                Response.Write(strStr.ToString());
                Response.End();
                break;
                #endregion
                #endregion

            case "SysUserTempDelete":
                #region 根据ID删除模块关联信息
                string SysUser_ID = string.Empty;
                try
                {
                    SysUserBLL BLL = new SysUserBLL();
                    SysUser_ID = clsUtility.Decrypt(Request["Aid"].ToString());
                    if (BLL.DeleteByPK(SysUser_ID) > 0 && BLL.DeleteSysUserRoleRelationByModuleID(SysUser_ID) == true)
                    {
                        StringBuilder str = new StringBuilder();
                        str.Append("【删除用户关联表SysUserTempDelete】用户ID:" + SysUser_ID);
                        new BLL_clsAuth().AddLogFromBS("Ajax/SysAJax.aspx", str.ToString());
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;

            case "SysCommon_DictTempDelete":
                #region 根据ID删除模块关联信息
                string common_Dict_ID = string.Empty;
                try
                {
                    Common_DictBLL BLL = new Common_DictBLL();
                    common_Dict_ID = clsUtility.Decrypt(Request["Aid"].ToString());
                    if (BLL.DeleteByPK(common_Dict_ID) > 0)
                    {
                        StringBuilder str = new StringBuilder();
                        str.Append("【删除字典】字典ID:" + common_Dict_ID);
                        new BLL_clsAuth().AddLogFromBS("Ajax/SysAJax.aspx", str.ToString());
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;

                #region 得到省的JSON串
            case "GetProvinceToJson":
                // Response.Write(key);
                dt = new BLL_DictForHospital().GetHospitalRegional(" D_PartentID='' ").Tables[0];
                Response.Write(Rc.Cloud.Web.Common.pfunction.DtToJson(dt, "Regional_Dict_ID", "D_Name"));
                break;

                #endregion
                #region 得到市的JSON串
            case "GetCityToJson":
                dt = new BLL_DictForHospital().GetHospitalRegional(" D_PartentID='" + Request["province"].ToString() + "' ").Tables[0];
                Response.Write(Rc.Cloud.Web.Common.pfunction.DtToJson(dt, "Regional_Dict_ID", "D_Name"));
                break;

                #endregion
                #region 得到县的JSON串
            case "GetCountryToJson":
                dt = new BLL_DictForHospital().GetHospitalRegional(" D_PartentID='" + Request["city"].ToString() + "' ").Tables[0];
                //dt = new BLL_DictForHospital().GetHospitalRegional(strWhere.ToString()).Tables[0];
                Response.Write(Rc.Cloud.Web.Common.pfunction.DtToJson(dt, "Regional_Dict_ID", "D_Name"));
                break;

                #endregion

            case "CustomVisitAttachmentDelete":
                #region 根据ID删除文件信息
                string customVisitAttachmentID = string.Empty;
                try
                {
                    BLL_CustomVisitAttachment BLL = new BLL_CustomVisitAttachment();
                    customVisitAttachmentID = Request["Aid"].ToString();
                    if (BLL.DeleteByPK(customVisitAttachmentID) > 0)
                    {
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;

            case "DeleteFunction":
                #region 根据ID删除文件信息
                string functionID = string.Empty;
                try
                {
                    BLL_Sys_Function BLL = new BLL_Sys_Function();
                    functionID = Request["FunctionID"].ToString();
                    if (BLL.DeleteSys_FunctionByID(functionID))
                    {
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;

            case "DeleteBaseSysModuleByID":
                #region 根据ID删除基库模块关联信息
                string baseModuleId = string.Empty;
                string baseSysCode  = string.Empty;
                try
                {
                    baseModuleId = Request["id"].ToString();
                    baseSysCode  = Request["syscode"].ToString();
                    if (new BLL_SysCode().DeleteBaseModule(baseModuleId, baseSysCode))
                    {
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;

            case "DeleteUpdateDataItem":
                #region 根据ID删除更新数据项
                try
                {
                    if (new Common_DictBLL().DeleteByPK(Request.QueryString["id"]) > 0)
                    {
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;


            case "GetMaxType":
                #region 根据ID删除更新数据项
                try
                {
                    string type = new Common_DictBLL().GetMaxDType().ToString();
                    Response.Write(type);
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;

            case "DeleteDSQL":
                #region 根据ID删除更新数据项
                try
                {
                    if (new BLL_DictionarySQlMaintenance().DeleteByPKNew(Request["Aid"]) > 0)
                    {
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;

            case "SysCommon_Dict1TempDelete":
                #region 根据ID删除模块关联信息
                string common_Dict1_ID = string.Empty;
                try
                {
                    BLL_Common_DictNew BLL = new BLL_Common_DictNew();
                    common_Dict1_ID = clsUtility.Decrypt(Request["Aid"].ToString());
                    if (BLL.DeleteByPK(common_Dict1_ID) > 0)
                    {
                        StringBuilder str = new StringBuilder();
                        str.Append("【删除字典】字典ID:" + common_Dict1_ID);
                        new BLL_clsAuth().AddLogFromBS("Ajax/SysAJax.aspx", str.ToString());
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }

                Response.End();
                #endregion
                break;


            case "GetD_Remark":
                #region 根据D_Type得到D_Rmark
                string R_Type = Request.QueryString["Aid"];

                BLL_Common_DictNew BLLmain = new BLL_Common_DictNew();

                Response.Write(BLLmain.GetD_Remark(R_Type));
                Response.End();
                #endregion
                break;

            case "DelFUser":
                #region 根据UserId删除前台注册用户
                string UserId = Request.QueryString["UserId"];
                try
                {
                    bool res = new Rc.BLL.Resources.BLL_F_User().DelFUser(UserId);
                    if (res)
                    {
                        Response.Write("1");
                    }
                    else
                    {
                        Response.Write("0");
                    }
                }
                catch (Exception)
                {
                    Response.Write("0");
                }
                #endregion
                break;



            default:
                break;
            }
        }