Пример #1
0
 /// <summary>
 /// Loads the data.
 /// </summary>
 /// <param name="group">The group.</param>
 public void LoadData(Model.Group.Group group)
 {
     this.groupData         = group;
     this.lGroup.Text       = this.groupData.Name;
     this.bSubscribe.Click += new EventHandler(bSubscribe_Click);
     this.Show();
 }
Пример #2
0
        /// <summary>
        /// Converts to model group.
        /// </summary>
        /// <param name="serviceGroup">The service group.</param>
        /// <returns></returns>
        private Model.Group.Group convertToModelGroup(GroupServices.Group serviceGroup)
        {
            Model.Group.Group modelGroup = new Model.Group.Group();

            modelGroup.Creation  = serviceGroup.Creation;
            modelGroup.Id        = serviceGroup.Id;
            modelGroup.IsPrivate = serviceGroup.IsPrivate;
            modelGroup.Name      = serviceGroup.Name;
            modelGroup.Owner     = this.convertToModelUser(serviceGroup.Owner);

            return(modelGroup);
        }
Пример #3
0
        /// <summary>
        /// Loads the title.
        /// </summary>
        /// <param name="group">The group.</param>
        public void LoadTitle(Model.Group.Group group)
        {
            this.GroupData = group;
            GroupTitle title = new GroupTitle();

            title.LoadData(group);
            title.SubscribeToGroup += new Delegates.Delegates.SubscribeToGroupHandler(title_SubscribeToGroup);
            title.Dock              = DockStyle.Fill;
            this.pTitle.Controls.Clear();
            this.pTitle.Controls.Add(title);
            title.Show();
            title.BringToFront();
        }
Пример #4
0
        /// <summary>
        /// Gets the group.
        /// </summary>
        /// <param name="group">The group.</param>
        /// <returns>Group</returns>
        private Model.Group.Group GetGroup(group group)
        {
            Model.Group.Group modelGroup = new Model.Group.Group();

            modelGroup.Creation             = group.group_creation;
            modelGroup.Id                   = group.group_id;
            modelGroup.Name                 = group.group_name;
            modelGroup.Owner.Nick           = group.user.user_nick;
            modelGroup.Owner.Id             = group.user.user_id;
            modelGroup.Owner.Karma          = group.user.user_karma;
            modelGroup.Owner.UserPictureURL = group.user.user_picture;

            return(modelGroup);
        }
Пример #5
0
        /// <summary>
        /// Devuelve la lista de grupos a la que va dirigido un mensaje en particular
        /// Si no va dirigido a ningún grupo, la lista estará vacía
        /// </summary>
        /// <param name="publicationId"></param>
        /// <returns>
        /// Lista de grupos a los que va dirigido el mensaje
        /// </returns>
        public List <XareuServices.Model.Group.Group> GetGroupsInPublication(long publicationId)
        {
            List <Model.Group.Group> groups = new List <XareuServices.Model.Group.Group>();

            IEnumerable <group_in_publication> query = from groupsInPublication in data.group_in_publications
                                                       where groupsInPublication.group_id == publicationId
                                                       select groupsInPublication;

            foreach (group_in_publication group in query)
            {
                Model.Group.Group newGroup = this.getGroup(group.group_id);

                groups.Add(newGroup);
            }

            return(groups);
        }
Пример #6
0
        /// <summary>
        /// Devuelve el grupo del nombre especificado
        /// </summary>
        /// <param name="name">Nombre del grupo que queremos recuperar</param>
        /// <returns>
        /// Grupo con el nombre correspondiente, null si no existe
        /// </returns>
        public XareuServices.Model.Group.Group GetGroupByName(string name)
        {
            IEnumerable <group> query = from groups in data.groups
                                        where groups.group_name == name
                                        select groups;

            try
            {
                group             groupData   = query.First <group>();
                Model.Group.Group groupReturn = this.GetGroup(groupData);
                return(groupReturn);
            }
            catch
            {
                return(null);
            }
        }
Пример #7
0
 /// <summary>
 /// Loads the data.
 /// </summary>
 /// <param name="group">The group.</param>
 public void LoadData(Model.Group.Group group)
 {
     this.GroupData     = group;
     this.lTagText.Text = group.Name;
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GroupsArgs"/> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="page">The page.</param>
 /// <param name="group">The group.</param>
 public GroupsArgs(string text, int page, Model.Group.Group group)
 {
     this.Text  = text;
     this.Page  = page;
     this.Group = group;
 }