示例#1
0
        public FunctionResult <JobGrant> Create(JobGrant info)
        {
            var r = new FunctionResult <JobGrant>(); int id = JobGrantDal.Add(info); if (id > 0)

            {
                r.Data = info; r.Data.JobGrantId = id;
            }

            return(r);
        }
示例#2
0
        public FunctionOpenResult <bool> Grant(int jobId, Dictionary <int, List <int> > authority)
        {
            var r = new FunctionOpenResult <bool>();

            foreach (var kv in authority)
            {
                kv.Value.ForEach(fid => {
                    JobGrantDal.Add(new JobGrant()
                    {
                        AppFunctionId = fid, JobId = jobId, AppServiceId = kv.Key
                    });
                });
            }
            r.Data = true;
            return(r);
        }