Exemplo n.º 1
0
        public virtual ResultM Save(int GroupID, string Data)
        {
            ResultM result = new ResultM();

            //删除全部
            int r = AccessRightDA.Del(GroupID);

            //添加
            foreach (var item in Data.Split(';').Where(z => z.Length > 0))
            {
                var info = item.Split(':');
                foreach (var a in info[1].Split(',').Where(z => z.Length > 0))
                {
                    TR_Group_Right model = new TR_Group_Right()
                    {
                        GroupID = GroupID, Controller = info[0], Action = a
                    };
                    result.Affected += AccessRightDA.Add(model);
                }
            }

            return(result);
        }
Exemplo n.º 2
0
 public AccessRightVM()
 {
     TemData = new TR_Group_Right();
 }
Exemplo n.º 3
0
        public int Add(TR_Group_Right model)
        {
            string sql = @"INSERT INTO TR_Group_Right(GroupID,Controller,Action) VALUES([GroupID],[Controller],[Action])";

            return(template.Execute(sql, model));
        }