Пример #1
0
        //=========================================================================
        ///	<summary>
        ///		�^��\�t�g�ɗ\�񂪓����Ă��邩�m�F
        ///	</summary>
        /// <remarks>
        /// </remarks>
        /// <history>2006/XX/XX �V�K�쐬</history>
        /// <history>2008/10/21 �\��m�F�ɕs�”\�ȃv���O�C���Ȃ疳��</history>
        //=========================================================================
        internal void CheckReserve(ReserveManager manager)
        {
            string descript;

            descript = string.Format("{0:0} {1:0}�b", Parent.title, StoryNumber);

            bool	evaluated;
            bool	exist;

            if( IsReserved )
            {
                //------------------------------
                // �\�񂪏����Ă��Ȃ����`�F�b�N
                //------------------------------
                evaluated = manager.ExistReservation( descript, GetUniqueString(), out exist);

                if( evaluated && !exist )
                {
                    this.mIsReserved		= false;
                    this.mIsReserveError	= true;
                    this.Dirty				= true;
                }
            }
            else
            {
                //------------------------------------
                // �������\�񂪕������Ă��邩�`�F�b�N
                //------------------------------------
                evaluated = manager.ExistReservation(descript, GetUniqueString(), out exist);

                if ( evaluated && exist )
                {
                    this.mIsReserved		= true;
                    this.mIsReserveError	= false;
                    this.mReserveStartTime	= this.mStartTime;	// <PENDING> 2009/12/28
                    this.Dirty				= true;
                }
            }
        }
Пример #2
0
        // [o] �\�񎸔s�ڍ�
        //=========================================================================
        ///	<summary>
        ///		���̃G�s�\�[�h��^��\�t�g�ɗ\��
        ///	</summary>
        /// <remarks>
        ///		���ɗ\�񂳂�Ă���ꍇ�͉�����Ȃ��B
        ///		�������Ԃ̕ύX��\��ɔ��f������B
        /// </remarks>
        /// <history>2006/XX/XX �V�K�쐬</history>
        /// <history>2009/06/28 �^��\�t�g"�Ȃ�"�͗\�񎸔s����</history>
        //=========================================================================
        internal bool Reserve(
			ReserveManager		manager			,	// [i] �^��\��}�l�[�W��
			out string			errorMessage	)
        {
            string descript;

            descript = string.Format("{0:0} {1:0}�b", Parent.title, StoryNumber);

            if( !IsReserved || JudgeTimeChanged )
            {
                DateTime	start	= DateTime.Now;
                int			length	= 0;

                //-----------------------------------
                // �^��J�n�����Ƙ^��I��������v�Z
                //-----------------------------------
                try
                {
                    start	= this.StartRecordDateTime;
                    length	= (int)(this.EndRecordDateTime - start).TotalMinutes;

                    if( length <= 0 )
                        throw new Scheduler.ZeroLengthScheduleTimeException();

                    //-------------------------------
                    // �ԑg�̗\��v���t�@�C����擾
                    //-------------------------------
                    Scheduler.Profile prof = null;

                    if (ReserveManager.DefaultScheduler				!= null		&&
                        ReserveManager.DefaultScheduler.ProfileType != null		)
                    {
                        prof = Parent.SchedulerProfile( ReserveManager.DefaultScheduler.ProfileType );
                    }

                    if( !IsReserved )
                    {
                        //--------------------------------------
                        // ����̕����E�\�񂪏��� �� �V�K�\��
                        //--------------------------------------
                        if (manager.MakeReservation(
                                descript,
                                GetUniqueString(),
                                Parent.tvStation,
                                start,
                                (uint)length,
                                Parent.UniqueID,
                                prof))
                        {
                            this.mIsReserved		= true;
                            this.mIsReserveError	= false;
                            this.mReserveStartTime	= start;
                            this.Dirty				= true;
                        }
                        else
                        {
                            this.mIsReserved		= false;
                            this.mIsReserveError	= true;
                            this.Dirty				= true;
                            errorMessage = "�^��\�t�g���w�肳��Ă��܂���B(�I�v�V������ʂőI����ĉ�����)";
                            return false;
                        }
                    }
                    else if( JudgeTimeChanged )
                    {
                        ReserveManager.ChangeResult res;

                        //--------------------------------------
                        // �������ԕύX �� �������ԕύX��s��
                        //--------------------------------------
                        res = manager.ChangeReservation(
                                descript				,
                                GetUniqueString()		,
                                Parent.tvStation		,
                                start					,
                                (uint)length			,
                                Parent.UniqueID			,
                                prof					);

                        if ( res == ReserveManager.ChangeResult.OK )				// �ύX�ɐ����H
                        {
                            this.mIsReserved		= true;
                            this.mIsReserveError	= false;
                            this.mReserveStartTime	= start;
                            this.Dirty				= true;
                        }
                        else if ( res == ReserveManager.ChangeResult.Lost )			// �\�񂪎���ꂽ�H
                        {
                            this.mIsReserved		= false;
                            this.mIsReserveError	= true;
                            this.Dirty				= true;
                        }
                    }

                }
                catch (Scheduler.DoubleBookingException e)										// �\�񂪏d���H
                {
                    Logger.Output( "(�\��Ǘ�)�\�񂪏d�����邽�߁A�\���o�^�ł��܂���B " + start.ToString() + " - " + descript );
                    this.mIsReserved		= false;
                    this.mIsReserveError	= true;
                    this.Dirty				= true;
                    errorMessage = "�\�񂪏d�����邽�߁A�\���o�^�ł��܂���B " + start.ToString() + " - " + descript;
                    return false;
                }
                catch(Scheduler.SchedulerBaseExecption e)
                {
                    object		[]objAttributes;
                    string		errorDetail			= "�\�񎞂ɃG���[���������܂����B";
Пример #3
0
        //=========================================================================
        ///	<summary>
        ///		�^��\�t�g�̗\���L�����Z������
        ///	</summary>
        /// <remarks>
        /// </remarks>
        /// <history>2008/10/22 �V�K�쐬</history>
        //=========================================================================
        internal bool CancelReserve(ReserveManager manager)
        {
            string		descript;

            descript = string.Format("{0:0} {1:0}�b", Parent.title, StoryNumber);

            if( !IsReserved )
                return false;

            try
            {
                if( !manager.CancelReservation( descript, GetUniqueString() ) )
                    return false;
            }
            catch(Exception ex)
            {
                return false;
            }

            this.mIsReserved	= false;
            this.Dirty			= true;

            return true;
        }
Пример #4
0
        //=========================================================================
        ///	<summary>
        ///		[�\��L�����Z��]���j���[
        ///	</summary>
        /// <remarks>
        /// </remarks>
        /// <history>2006/XX/XX �V�K�쐬</history>
        //========================================================================
        private void cancelReserveMenu_Click( object sender, EventArgs e )
        {
            string			newName;
            var				episodes	= GridSelectEpisodes;
            ReserveManager	manager		= new ReserveManager();

            foreach(var ep in episodes)
            {
                if( ep.CancelReserve( manager ) )
                {
            //					MessageBox.Show(	"�\���L�����Z�����܂����B",
            //										"����"						,
            //										MessageBoxButtons.OK		,
            //										MessageBoxIcon.Information	);
                }
                else
                {
                    if( MessageBox.Show(
                        ep.ToString() + System.Environment.NewLine +
                        "�\���L�����Z���ł��܂���ł����B\r\n"				+
                        "(�^��\�t�g����\���L�����Z�����ĉ�����)\r\n\r\n"	+