Exemplo n.º 1
0
        /// <summary>
        /// Gets the specified group model.
        /// </summary>
        /// <param name="id">The group id</param>
        /// <returns>The model</returns>
        public static GroupEditModel GetById(Guid id)
        {
            GroupEditModel  m      = new GroupEditModel();
            List <SysGroup> groups = SysGroup.GetFields("sysgroup_id, sysgroup_name",
                                                        "sysgroup_id != @0", id, new Params()
            {
                OrderBy = "sysgroup_name ASC"
            });

            groups.Insert(0, new SysGroup()
            {
                Name = ""
            });

            m.Group   = SysGroup.GetSingle(id);
            m.Groups  = new SelectList(groups, "Id", "Name", m.Group.ParentId);
            m.Members = SysUser.GetFields("sysuser_id, sysuser_firstname, sysuser_surname",
                                          "sysuser_group_id=@0", m.Group.Id);

            return(m);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Refreshes the model.
 /// </summary>
 public void Refresh()
 {
     Members = SysUser.GetFields("sysuser_id, sysuser_firstname, sysuser_surname",
                                 "sysuser_group_id=@0", Group.Id);
 }