Exemplo n.º 1
0
        /// <summary>
        /// 保存用户权限
        /// </summary>
        /// <param name="code"></param>
        /// <param name="functions"></param>
        /// <returns></returns>
        public Tuple <bool, string> SaveFunctions(string code, List <Pub_UserFunction> functions)
        {
            var r = userFunctionBLL.DeleteByWhere(string.Format("UserCode='{0}'", code));

            r = userFunctionBLL.InsertBatch(functions);

            return(Tuple.Create(r, r ? "保存成功" : "保存失败"));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 保存用户权限
        /// </summary>
        /// <param name="code"></param>
        /// <param name="functions"></param>
        /// <returns></returns>
        public (bool, string) SaveFunctions(string code, List <Pub_UserFunction> functions)
        {
            var r = userFunctionBLL.DeleteByWhere($"UserCode='{code}'");

            r = userFunctionBLL.InsertBatch(functions);

            return(r, r ? "保存成功" : "保存失败");
        }
Exemplo n.º 3
0
        public ActionResult UserFunctionEdit(FormCollection form)
        {
            var userCode = form["userCode"];
            var r        = userFunctionBLL.DeleteByWhere("UserCode='" + userCode + "'");

            List <Pub_UserFunction> userFunction = new List <Pub_UserFunction>();
            var functions = form["selectValues"].ToString().Split(',');

            foreach (var item in functions)
            {
                userFunction.Add(new Pub_UserFunction()
                {
                    UserCode     = userCode,
                    FunctionCode = item
                });
            }
            userFunctionBLL.InsertBatch(userFunction);
            rep.errorInfo = "保存成功";

            return(Json(rep));
        }