예제 #1
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);
        }
예제 #2
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, DTO.DTO_GenericRoomData Data, WbRoomParameter Parameters, bool HasIdInName)
        {
            if (HasIdInName)
            {
                Data.Name = string.Format("({0}) {1}", RoomId.ToString(), Data.Name);
            }

            Data.HasIdInName = HasIdInName;

            String ExternalId  = DAL.RoomGetExternaId(RoomId);
            WbRoom UpdatedRoom = DAL.RoomUpdate(RoomId, Data);


            try
            {
                oMRoomParameters Param = (oMRoomParameters)Parameters;

                // SESSIONE DI LAVORO
                OMuserService.Sessiondata oResponse = UserService.getSession();
                String SessionID = oResponse.session_id;
                OMuserService.ErrorResult oError = null;

                // LOGIN DI UN ADMINISTRATOR
                long UserID = UserService.loginUser(SessionID, this.oMSysParameter.MainUserLogin, this.oMSysParameter.MainUserPwd);

                long ExtRoomId = System.Convert.ToInt64(ExternalId);

                RoomService.updateRoomWithModerationAndQuestions(
                    SessionID,
                    ExtRoomId,
                    UpdatedRoom.Name,
                    OMP_Roomtypes_id,
                    UpdatedRoom.Description,
                    Param.numberOfPartizipants,
                    UpdatedRoom.Public,
                    OMP_appointment,
                    OMP_isDemoRoom,
                    OMP_demoTime,
                    Param.isModeratedRoom,
                    Param.allowUserQuestions
                    );
            }
            catch (Exception ex)
            {
                UpdatedRoom.Parameter = null;
            }

            return(UpdatedRoom);
        }
예제 #3
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, DTO.DTO_GenericRoomData Data, WbRoomParameter Parameters, bool HasIdInName)
 {
     return(null);
 }