Пример #1
0
        public DataRes <bool> Add([FromBody] Pub_Department model)
        {
            DataRes <bool> res = new DataRes <bool>()
            {
                code = ResCode.Success, data = true
            };

            model.DeptCode = bll.GetCode();
            model.Lmdt     = model.Lmdt = DateTime.Now;
            var user = LQExtensionFactory.GetLQExtensionUser(User);

            model.Lmid     = $"{user.UserCode}-{user.UserName}";
            model.StopFlag = false;
            var r = bll.Insert(model);

            return(res);
        }
Пример #2
0
        public DataRes <bool> Add([FromBody] Pub_Function model)
        {
            DataRes <bool> res = new DataRes <bool>()
            {
                code = ResCode.Success, data = true
            };

            model.FunctionCode = bll.GetCode(model.ParentCode);
            model.editdate     = DateTime.Now;
            var user = LQExtensionFactory.GetLQExtensionUser(User);

            model.editor   = $"{user.UserCode}-{user.UserName}";
            model.StopFlag = false;
            var r = bll.Insert(model);

            return(res);
        }
Пример #3
0
        public DataRes <bool> Edit([FromBody] Pub_Department model)
        {
            DataRes <bool> res = new DataRes <bool>()
            {
                code = ResCode.Success, data = true
            };

            model.Lmdt = DateTime.Now;
            var user = LQExtensionFactory.GetLQExtensionUser(User);

            model.Lmid = $"{user.UserCode}-{user.UserName}";
            var r = bll.Update(model);

            if (!r)
            {
                res.code = ResCode.Error;
                res.data = false;
                res.msg  = "保存失败";
            }

            return(res);
        }
Пример #4
0
        public DataRes <bool> Add([FromBody] Pub_Role model)
        {
            DataRes <bool> res = new DataRes <bool>()
            {
                code = ResCode.Success, data = true
            };

            model.RoleCode = bll.GetCode();
            model.Lmdt     = model.Lmdt = DateTime.Now;
            var user = LQExtensionFactory.GetLQExtensionUser(User);

            model.Lmid     = $"{user.UserCode}-{user.UserName}";
            model.StopFlag = false;
            var r = bll.Insert(model) > 0;

            if (!r)
            {
                res.code = ResCode.Error;
                res.msg  = "保存失败!";
            }

            return(res);
        }