예제 #1
0
		/// <summary>
		/// Default constructor. Creates a model.
		/// </summary>
		public UserEditModel() {
			List<SysGroup> gr = SysGroup.GetFields("sysgroup_id, sysgroup_name", 
				new Params() { OrderBy = "sysgroup_id" }) ;
			groups = new List<SysGroup>() ;
			groups.Insert(0, new SysGroup()) ;
			gr.Each<SysGroup>((i,g) => {
				if (HttpContext.Current.User.IsMember(g.Id)) groups.Add(g) ;
			});

			User = new SysUser() ;
			Password = new SysUserPassword() ;
			Groups = new SelectList(groups, "Id", "Name") ;

			// Get extensions
			Extensions = User.GetExtensions(true) ;
		}
예제 #2
0
        /// <summary>
        /// Default constructor. Creates a model.
        /// </summary>
        public UserEditModel()
        {
            List <SysGroup> gr = SysGroup.GetFields("sysgroup_id, sysgroup_name",
                                                    new Params()
            {
                OrderBy = "sysgroup_id"
            });

            groups = new List <SysGroup>();
            groups.Insert(0, new SysGroup());
            gr.Each <SysGroup>((i, g) => {
                if (HttpContext.Current.User.IsMember(g.Id))
                {
                    groups.Add(g);
                }
            });

            User     = new SysUser();
            Password = new SysUserPassword();
            Groups   = new SelectList(groups, "Id", "Name");

            // Get extensions
            Extensions = User.GetExtensions(true);
        }