Esempio n. 1
0
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ShuXuePG_Load(object sender, EventArgs e)
        {
            try
            {
                cmbYiShiQM.DataSource    = _DataDicDal.GetUserByType(1);
                cmbYiShiQM.DisplayMember = "user_name";
                BindPatInfo();
                // BindPatMZInfo();
                bindShuXueinfo();

                string jurisdiction = new UserRoleBll().GetUserRole(Program.customer);
                if (jurisdiction.Contains("8"))
                {
                    btnUnlock.Visible = true;
                }
                else
                {
                    btnUnlock.Visible = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> UserListData(int page, int limit)
        {
            UserBll userBll = new UserBll();
            List <UserViewModel> userlist = new List <UserViewModel>();
            var users = await userBll.GetList("", page, limit);

            if (users.Item1 != null && users.Item1.Count > 0)
            {
                foreach (var user in users.Item1)
                {
                    UserViewModel vm = new UserViewModel();
                    vm.CreateTime = user.CreateTime.ToString("yyyy-MM-dd");
                    vm.ID         = user.ID;
                    vm.Name       = user.Name;
                    if (user.RoleID > 0)
                    {
                        UserRoleBll rbll = new UserRoleBll();
                        var         info = await rbll.Get(user.RoleID);

                        if (info != null)
                        {
                            vm.RoleName = info.RoleName;
                        }
                    }
                    vm.TelPhone = user.TelPhone;
                    vm.UserName = user.UserName;
                    userlist.Add(vm);
                }
            }
            return(Json(new { code = 0, msg = "", count = users.Item2, data = userlist.ToArray() }));
        }
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string      id    = Request["RoleId"] == null ? "" : Request["RoleId"].Trim();
            UserRoleBll bll   = new UserRoleBll();
            UserRole    model = new UserRole();

            if (!string.IsNullOrEmpty(id))//如果是修改操作
            {
                model.RoleId = Convert.ToInt32(id);
            }

            model.RoleName = this.txtRoleName.Text.Trim();
            model.RoleDesc = this.txtRoleDesc.Text.Trim();

            int n = 0;

            if (!string.IsNullOrEmpty(id))//如果是修改操作
            {
                n = bll.Update(model, null);
            }
            else //如果是新增操作
            {
                n = bll.Insert(model, null);
            }

            if (n > 0)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('保存成功!');frameElement.lhgDG.curWin.location.reload();</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('保存失败!');frameElement.lhgDG.curWin.location.reload();</script>");
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 赋值
        /// </summary>
        private void LodSQFS()
        {
            DataTable dt = _AfterVisitDal.GetAfterVisit_YS_byMzjldid(MzjldId);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                cmbmzfs.Text = dr["mzfs"].ToString();
                if (dr["Mzsj"].ToString() != "")
                {
                    txtMzsj.Text = dr["Mzsj"].ToString();
                }
                cmbYishi.Text   = dr["Yishi"].ToString();
                cmbHuxi.Text    = dr["Huxi"].ToString();
                cmbXunhuan.Text = dr["Xunhuan"].ToString();
                if (Convert.ToString(dr["Shzysx"]).Contains("1"))
                {
                    Shzysx1.Checked = true;
                }
                if (Convert.ToString(dr["Shzysx"]).Contains("2"))
                {
                    Shzysx2.Checked = true;
                }
                if (Convert.ToString(dr["Shzysx"]).Contains("3"))
                {
                    Shzysx3.Checked = true;
                }
                txtQt.Text      = dr["Qt"].ToString();
                cmbmzxgbfz.Text = dr["mzxgbfz"].ToString();
                txtMs.Text      = dr["Ms"].ToString();
                txtcl.Text      = dr["cl"].ToString();
                txtjg.Text      = dr["jg"].ToString();
                if (dr["Mzys"].ToString() != "")
                {
                    cmbMzys.Text = dr["Mzys"].ToString();
                }
                dtVisitDate.Text = dr["VisitDate"].ToString();
                if (Convert.ToString(dr["IsRead"]) == "0")
                {
                    btnSave.Enabled = true;
                    isRead          = false;
                }
                if (Convert.ToString(dr["IsRead"]) == "1")
                {
                    isRead          = true;
                    btnSave.Enabled = false;
                }
                UserRoleBll _UserRoleBll = new UserRoleBll();
                string      jurisdiction = _UserRoleBll.GetUserRole(Program.customer);
                if (jurisdiction.Contains("8"))
                {
                    btnJS.Visible = true;
                }
                else
                {
                    btnJS.Visible = false;
                }
            }
        }
Esempio n. 5
0
        public async Task <IActionResult> UserMessage()
        {
            UserRoleBll userRoleBll = new UserRoleBll();
            UserRole    userRole    = await userRoleBll.Get(User.RoleID);

            ViewBag.userRole = userRole;
            return(View(User));
        }
Esempio n. 6
0
        /// <summary>
        /// 角色管理
        /// </summary>
        /// <returns></returns>
        public async Task <IActionResult> RoleList()
        {
            UserRoleBll bll  = new UserRoleBll();
            var         list = await bll.Get();

            ViewBag.root = "account";
            return(View(list));
        }
        //显示列表数据
        protected void BindRpt()
        {
            UserRoleBll     bll  = new UserRoleBll();
            List <UserRole> list = bll.GetList();

            if (list != null)
            {
                this.rptList.DataSource = list;
                this.rptList.DataBind();
            }
        }
Esempio n. 8
0
        public async Task OnGet(int id)
        {
            UserBll userBll = new UserBll();

            UserList = await userBll.GetListAsync();

            UserRoleBll rbll = new UserRoleBll();

            UserRoleList = await rbll.Get();

            ID = id;
        }
Esempio n. 9
0
        //绑定角色下拉列表
        protected void BindRole()
        {
            UserRoleBll     bll  = new UserRoleBll();
            List <UserRole> list = bll.GetList();

            if (list != null)
            {
                this.chkListRole.DataSource     = list;
                this.chkListRole.DataTextField  = "RoleName";
                this.chkListRole.DataValueField = "RoleId";
                this.chkListRole.DataBind();
            }
        }
Esempio n. 10
0
        private void ShowData()
        {
            string id = Request["RoleId"];

            if (!string.IsNullOrEmpty(id))
            {
                UserRoleBll bll   = new UserRoleBll();
                UserRole    model = bll.GetModel(Convert.ToInt32(id));
                if (model != null)
                {
                    this.txtRoleName.Text = model.RoleName;
                    this.txtRoleDesc.Text = model.RoleDesc;
                }
            }
        }
Esempio n. 11
0
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "del")//如果是删除命令
     {
         int         roleId = Convert.ToInt32(e.CommandArgument.ToString());
         UserRoleBll bll    = new UserRoleBll();
         if (bll.Delete(roleId, null) > 0)
         {
             Response.Write("<script>alert('删除成功!');window.location.href='RoleList.aspx'</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('删除失败!');</script>");
         }
     }
 }
Esempio n. 12
0
        public async Task <IActionResult> AddRole()
        {
            string   name     = Request.Form["name"].TryToString();
            UserRole userRole = new UserRole();

            userRole.RoleName = name;
            userRole.State    = Model.Enume.StateEnum.Invalid;
            UserRoleBll bll = new UserRoleBll();
            int         id  = await bll.AddRole(userRole);

            if (id > 0)
            {
                return(Json(new { code = 1, msg = "OK" }));
            }
            return(Json(new { code = 0, msg = "失败" }));
        }
Esempio n. 13
0
        /// <summary>
        /// 赋值
        /// </summary>
        private void LodSQFS()
        {
            DataTable dt = _MzzqtysDal.GetMZZQTYS_YS(PatId);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                txtYsjy.Text     = dr["Ysjy"].ToString();
                txtHuanb.Text    = dr["Huanb"].ToString();
                txtNxss.Text     = dr["Nxss"].ToString();
                txtTsfx.Text     = dr["Tsfx"].ToString();
                txtTsfx.Text     = dr["Tsfx"].ToString();
                cmbMzff.Text     = dr["Mzff"].ToString();
                txtHzqm1.Text    = dr["Hzqm1"].ToString();
                dtHzdate1.Text   = dr["Hzdate1"].ToString();
                cmbMzty.Text     = dr["Mzty"].ToString();
                txtHzqm2.Text    = dr["Hzqm2"].ToString();
                dtHzdate2.Text   = dr["Hzdate2"].ToString();
                txtJsqm.Text     = dr["Jsqm"].ToString();
                txtYhzgx.Text    = dr["Yhzgx"].ToString();
                dtJsdate.Text    = dr["Jsdate"].ToString();
                txtYsqm.Text     = dr["Ysqm"].ToString();
                dtQmrq.Text      = dr["Qmrq"].ToString();
                dtVisitDate.Text = dr["VisitDate"].ToString();
                if (Convert.ToString(dr["IsRead"]) == "0")
                {
                    btnSave.Enabled = true;
                    isRead          = false;
                }
                if (Convert.ToString(dr["IsRead"]) == "1")
                {
                    isRead          = true;
                    btnSave.Enabled = false;
                }
                UserRoleBll _UserRoleBll = new UserRoleBll();
                string      jurisdiction = _UserRoleBll.GetUserRole(Program.customer);
                if (jurisdiction.Contains("8"))
                {
                    btnJS.Visible = true;
                }
                else
                {
                    btnJS.Visible = false;
                }
            }
        }
Esempio n. 14
0
        /// <summary>
        /// 角色权限
        /// </summary>
        /// <returns></returns>
        public async Task <IActionResult> AddRoleJuri(int roleid)
        {
            UserRoleJurisdictionBll bll = new UserRoleJurisdictionBll();
            var               list      = bll.GetListAsync(roleid);
            ModuleInfoBll     mbll      = new ModuleInfoBll();
            List <ModuleInfo> mlist     = mbll.GetList();

            ViewBag.mlist = mlist;

            UserRoleBll rbll     = new UserRoleBll();
            UserRole    userRole = await rbll.Get(roleid);

            ViewBag.userRole = userRole;
            ViewBag.roleid   = roleid;
            ViewBag.root     = "account";
            return(View(list));
        }
Esempio n. 15
0
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <returns></returns>
        public async Task <IActionResult> AddUser(int id = 0)
        {
            UserRoleBll rbll         = new UserRoleBll();
            var         userRolelist = await rbll.Get();

            ViewBag.userRolelist = userRolelist;
            ViewBag.root         = "account";
            UserInfo userInfo = new UserInfo();

            if (id > 0)
            {
                UserBll bll = new UserBll();
                userInfo = await bll.GetByID(id);
            }
            ViewBag.userInfo = userInfo;
            return(View());
        }
Esempio n. 16
0
        public async Task <IActionResult> DelRole(int id)
        {
            UserRoleBll bll  = new UserRoleBll();
            var         info = await bll.Get(id);

            if (info != null)
            {
                info.State = Model.Enume.StateEnum.Valid;
                bool falg = await bll.UpdateRole(info);

                if (falg)
                {
                    return(Json(new { code = 1, msg = "OK" }));
                }
            }
            return(Json(new { code = 0, msg = "删除失败" }));
        }
Esempio n. 17
0
        public ActionResult UserRoleAction(string action, string role_id, string user_id)
        {
            return(RunActionWhenLogin((loginuser) =>
            {
                var model = new UserRoleModel();
                model.RoleID = role_id;
                model.UserID = user_id;

                var bll = new UserRoleBll();
                if (action == "add")
                {
                    return GetJsonRes(bll.AddUserRole(model));
                }
                if (action == "del")
                {
                    return GetJsonRes(bll.DeleteUserRole(model.UserID, model.RoleID));
                }
                return GetJsonRes("未知请求");
            }));
        }
Esempio n. 18
0
        /// <summary>
        /// 用户权限mapping管理
        /// </summary>
        /// <returns></returns>
        public ActionResult UserRole(int?user_id)
        {
            return(RunActionWhenLogin((loginuser) =>
            {
                user_id = user_id ?? 0;
                var user = _IUserService.GetByID(user_id.Value);
                if (user == null)
                {
                    return GoHome();
                }

                var model = new UserRoleViewModel();

                model.User = user;

                UserRoleBll bll = new UserRoleBll()
                {
                    UseCache = false
                };

                var userrolesid = bll.GetRolesByUserID(user.UserID);
                if (userrolesid == null)
                {
                    userrolesid = new List <int>();
                }

                var allrolelist = _IRoleService.GetAllRoles();
                if (allrolelist == null)
                {
                    allrolelist = new List <RoleModel>();
                }

                model.AssignedList = allrolelist.Where(x => userrolesid.Contains(x.RoleID)).ToList();
                model.UnAssignedList = allrolelist.Where(x => !userrolesid.Contains(x.RoleID)).ToList();

                ViewData["model"] = model;

                return View();
            }));
        }
Esempio n. 19
0
        /// <summary>
        /// 赋值
        /// </summary>
        private void LodSQFS()
        {
            DataTable dt = _ZtzltysDal.GetZTZLZQTYS_YS(_PatId);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                tbSQZD.Text      = dr["Zd"].ToString();
                txtZT.Text       = dr["ZTfs"].ToString();
                txtHzqm2.Text    = dr["Hzqm"].ToString();
                txtJsqm.Text     = dr["Jsqm"].ToString();
                txtYhzgx.Text    = dr["Yhzgx"].ToString();
                txtMZYsqm.Text   = dr["MZYsqm"].ToString();
                txtZLysqm.Text   = dr["ZLysqm"].ToString();
                dtVisitDate.Text = dr["VisitDate"].ToString();
                if (Convert.ToString(dr["IsRead"]) == "0")
                {
                    btnSave.Enabled = true;
                    isRead          = false;
                }
                if (Convert.ToString(dr["IsRead"]) == "1")
                {
                    isRead          = true;
                    btnSave.Enabled = false;
                }
                UserRoleBll _UserRoleBll = new UserRoleBll();
                string      jurisdiction = _UserRoleBll.GetUserRole(Program.customer);
                if (jurisdiction.Contains("8"))
                {
                    btnJS.Visible = true;
                }
                else
                {
                    btnJS.Visible = false;
                }
            }
        }
Esempio n. 20
0
 public void Dispose()
 {
     this._DataDictionaryBll = null;
     this._EmployeeBll = null;
     this._IPBlacklistBll = null;
     this._MenuInfoBll = null;
     this._OrganizationBll = null;
     this._PurviewInfoBll = null;
     this._RoleInfoBll = null;
     this._RolePurviewBll = null;
     this._SysLogBll = null;
     this._SysLoginLogBll = null;
     this._SystemExceptionLogBll = null;
     this._SystemInfoBll = null;
     this._UserInfoBll = null;
     this._UserPurviewBll = null;
     this._UserRoleBll = null;
 }