Пример #1
0
        public ActionResult SaveFunction(SysFunctionEntity model)
        {
            var fnamelen = StringHelper.GetStrLength(model.Funname);

            if (fnamelen == 0 || fnamelen > 10)
            {
                return(new CustomerJsonResult(new ResponseResult {
                    code = ResponseHelper.ORPARAMCODE, msg = "名称不合法"
                }));
            }
            if (string.IsNullOrWhiteSpace(model.Funcode))
            {
                return(new CustomerJsonResult(new ResponseResult {
                    code = ResponseHelper.ORPARAMCODE, msg = "代码不能为空"
                }));
            }
            int result = ISysFunctionService.Insert(model);

            if (result > 0)
            {
                return(new CustomerJsonResult(new ResponseResult {
                    code = ResponseHelper.ESUCCESSCODE, msg = "保存成功"
                }));
            }
            else
            {
                return(new CustomerJsonResult(new ResponseResult {
                    code = ResponseHelper.FAILCODE, msg = "保存失败"
                }));
            }
        }
Пример #2
0
        public int Insert(SysFunctionEntity model)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("insert into sys_function(funcode,funname,funseq,funicon,remark) ");
            strsql.Append(" values(@funcode,@funname,@funseq,@funicon,@remark)");
            return(SqlHelper.Execute(strsql.ToString(), model));
        }
Пример #3
0
        public int Update(SysFunctionEntity model)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("update sys_function set  ");
            strsql.Append("funcode=@funcode,funname=@funname,funseq=@funseq,funicon=@funicon,remark=@remark");
            strsql.Append(" where id=@id ");
            return(SqlHelper.Execute(strsql.ToString(), model));
        }