Exemple #1
0
        /// <summary>
        /// Imposta la view in base alla scelta del tipo stanza
        /// </summary>
        /// <param name="RoomType">Tipo di stanza</param>
        public void SetdefParameter(Domain.RoomType RoomType)
        {
            // Dati generici (nome, descrizione, inizio/fine, numero utenti)
            Domain.DTO.DTO_GenericRoomData GenericData = Service.RoomGetGenericData(RoomType);

            // Paramteri (in base all'istanza)
            Domain.WbRoomParameter DefRoomParam = Service.ParameterGetByType(RoomType);

            // Parametri disponibili per ogni istanza. (Se altra istanza, passo null!)
            Domain.eWorks.DTO.DTOAvailableParameters eWDefParameter = null;

            if (View.SysParameter.CurrentSystem == Domain.wBImplementedSystem.eWorks)
            {
                Domain.eWorks.eWSystemParameter eWSysParam = (Domain.eWorks.eWSystemParameter)View.SysParameter;

                eWDefParameter = Domain.eWorks.eWAPIConnector.getAvailableParameters(
                    eWSysParam.BaseUrl, eWSysParam.ProxyUrl, eWSysParam.MainUserId, eWSysParam.MainUserPwd, eWSysParam.MainUserId);
            }
            else if (View.SysParameter.CurrentSystem == Domain.wBImplementedSystem.OpenMeetings)
            {
                //nessun parametro avanzato per OpenMeetings
            }

            this.View.Init(GenericData, DefRoomParam, eWDefParameter);
        }
        /// <summary>
        /// Salva TUTTI i dati presenti nella view
        /// </summary>
        /// <param name="UpdateView">
        /// Se TRUE aggiorna i dati nella view
        /// </param>
        public void Save(Boolean UpdateView)
        {
            Domain.DTO.DTO_GenericRoomData grData = View.CurrentRoomData;

            IList <Domain.DTO.DTO_AccessType> sysAccType = (from Domain.DTO.DTO_AccessType at in View.RoomAccessTypes where at.IsSystem == true select at).ToList();

            if (sysAccType != null && sysAccType.Count > 0)
            {
                foreach (Domain.DTO.DTO_AccessType at in sysAccType)
                {
                    if (at.ID == -1)
                    {
                        grData.SubCommunity = at.SelectedType;
                    }
                    else if (at.ID == -2)
                    {
                        grData.SubSystem = at.SelectedType;
                    }
                    else if (at.ID == -3)
                    {
                        grData.SubExternal = at.SelectedType;
                    }
                }
            }

            Domain.WbRoom UpdatedRoom = Service.RoomUpdateData(
                View.RoomId,
                grData,
                View.CurrentRoomParameters,
                View.SYS_HasIdInName
                );

            this.SendUserAction(Domain.ModuleWebConferencing.ActionType.RoomUpdate);

            if (UpdateView)
            {
                resetData();
            }
        }
        /// <summary>
        /// Reimposta i dati dall'ultimo salvataggio
        /// </summary>
        private void resetData()
        {
            Domain.WbRoom Room = Service.RoomGet(View.RoomId);

            if (Room != null)
            {
                Domain.DTO.DTO_GenericRoomData Data = new Domain.DTO.DTO_GenericRoomData()
                {
                    Id                     = Room.Id,
                    HasIdInName            = Room.hasIdInName,
                    Description            = Room.Description,
                    Duration               = Room.Duration,
                    EndDate                = Room.EndDate,
                    StartDate              = Room.StartDate,
                    Public                 = Room.Public,
                    Name                   = Room.Name,
                    MaxAllowUsers          = Room.MaxAllowUsers,
                    NotificationEnableUsr  = Room.NotificationEnableUsr,
                    NotificationDisableUsr = Room.NotificationDisableUsr
                };


                //TemplateId = Room.TemplateId



                String code = Service.RoomCodeGet(this.View.RoomId);


                int PageCount = 0;

                int currentPageIndex = this.View.UserPager.PageIndex;
                int currentPageSize  = this.View.UserPager.PageSize;

                IList <Domain.WbUser> Users = Service.UsersGet(this.View.RoomId, this.View.UserFilters, currentPageIndex, currentPageSize, ref PageCount);

                PagerBase pager = new PagerBase();
                pager.PageSize = currentPageSize;//Me.View.CurrentPageSize
                pager.Count    = PageCount;
                if (currentPageIndex > PageCount)
                {
                    currentPageIndex = PageCount;
                }

                pager.PageIndex = currentPageIndex;// Me.View.CurrentPageIndex
                View.UserPager  = pager;


                Boolean LockUsers = Module.AddChatRoom && !(Module.ManageRoom);

                this.View.SetParameter(Room.Id, Room.CreatedBy.Id, Data, Room.Parameter, Room.Type, Users, LockUsers, code); //, LockUsers
                View.RoomType = Room.Type;

                List <Domain.DTO.DTO_AccessType> AccessType = new List <Domain.DTO.DTO_AccessType>();

                Domain.DTO.DTO_AccessType Community = new Domain.DTO.DTO_AccessType();
                Community.ID           = -1;
                Community.IsSystem     = true;
                Community.DisplayName  = Domain.SysSubscriptionType.Community.ToString();
                Community.SelectedType = Room.SubCommunity;
                AccessType.Add(Community);

                Domain.DTO.DTO_AccessType System = new Domain.DTO.DTO_AccessType();
                System.ID           = -2;
                System.IsSystem     = true;
                System.DisplayName  = Domain.SysSubscriptionType.System.ToString();
                System.SelectedType = Room.SubSystem;
                AccessType.Add(System);

                Domain.DTO.DTO_AccessType External = new Domain.DTO.DTO_AccessType();
                External.ID           = -3;
                External.IsSystem     = true;
                External.DisplayName  = Domain.SysSubscriptionType.External.ToString();
                External.SelectedType = Room.SubExternal;
                AccessType.Add(External);

                View.RoomAccessTypes = AccessType;
            }
        }
Exemple #4
0
        /// <summary>
        /// Aggiorna i dati di una stanza
        /// </summary>
        /// <param name="RoomId">ID stanza</param>
        /// <param name="Data">Dati stanza (generici)</param>
        /// <param name="Parameters">Parametri stanza (dati avanzati, basati su integrazione)</param>
        /// <returns>La stanza con i dati aggiornati</returns>
        public override WbRoom RoomUpdateData(
            long RoomId, Domain.DTO.DTO_GenericRoomData Data,
            WbRoomParameter Parameters, bool HasIdInName)
        {
            //this.eWSysParameter.

            if (HasIdInName)
            {
                Data.Name = string.Format("({0}) {1}", RoomId.ToString(), Data.Name);
            }

            Data.HasIdInName = HasIdInName;


            String ExternalId  = DAL.RoomGetExternaId(RoomId);
            WbRoom UpdatedRoom = new WbRoom();

            if (Parameters == null)
            {
                WbRoom OldRoom = this.RoomGet(RoomId);
                if (OldRoom.Parameter != null)
                {
                    Parameters = OldRoom.Parameter;
                }
                else
                {
                    UpdatedRoom = DAL.RoomUpdate(RoomId, Data);
                    return(UpdatedRoom);
                }
            }



            try
            {
                eWRoomParameters param = (eWRoomParameters)Parameters;

                Data.Recording = param.recording;

                UpdatedRoom = DAL.RoomUpdate(RoomId, Data);



                param.meetingtitle = Data.Name;
                param.description  = Data.Description;
                param.meetingstart = Data.StartDate;
                if (Data.Duration > 0)
                {
                    param.meetingduration = Data.Duration;
                }
                else
                {
                    if (Data.StartDate != null && Data.EndDate != null)
                    {
                        TimeSpan TS = (Data.EndDate ?? DateTime.Now) - (Data.StartDate ?? DateTime.Now);
                        try
                        {
                            param.meetingduration = Convert.ToInt32(TS.TotalMinutes);
                        }
                        catch
                        {
                            param.meetingduration = 0;
                        }
                    }
                }

                eWAPIConnector.SetParameters(
                    this.eWSysParameter.BaseUrl, this.eWSysParameter.ProxyUrl,
                    this.eWSysParameter.MainUserId, this.eWSysParameter.MainUserPwd,
                    ExternalId, param, this.eWSysParameter.MaxUrlChars, false, this.eWSysParameter.Version);
            }
            catch (Exception ex)
            {
                UpdatedRoom.Parameter = null;
            }

            return(UpdatedRoom);
        }