コード例 #1
0
        public static MovieWriterDO Save(int movieID, string objectName, int userID)
        {
            var objList = WriterBL.GetAllDO( ).Where(q => q.Name == objectName).ToList( );

            WriterDO obj;

            if (objList != null && objList.Count > 0)
            {
                obj = objList[0];
            }
            else
            {
                obj = WriterBL.Save(new WriterDO( )
                {
                    Name = objectName
                }, userID);
            }

            MOV_M_Writer objectToAdd = new MOV_M_Writer( );

            objectToAdd.MovieID  = movieID;
            objectToAdd.WriterID = obj.ID;

            return(Save(objectToAdd, userID));
        }
コード例 #2
0
        private static void InitializeThread( )
        {
            int waitTime = 3;

            Thread.Sleep(500);
            MovieBL.GetAll();

            Thread.Sleep(waitTime);
            ActorBL.GetAll();

            Thread.Sleep(waitTime);
            DirectorBL.GetAll();

            Thread.Sleep(waitTime);
            WriterBL.GetAll();

            Thread.Sleep(waitTime);
            LanguageBL.GetAll();

            Thread.Sleep(waitTime);
            ArchiveBL.GetAll();

            Thread.Sleep(waitTime);
            TypeBL.GetAll();

            Thread.Sleep(waitTime);
            MovieActorBL.GetAll( );
            MovieActorBL.GetAllDO( );

            Thread.Sleep(waitTime);
            MovieUserArchiveBL.GetAll();
            MovieUserArchiveBL.GetAllDO();

            Thread.Sleep(waitTime);
            MovieDirectorBL.GetAll( );
            MovieDirectorBL.GetAllDO( );

            Thread.Sleep(waitTime);
            MovieLanguageBL.GetAll();
            MovieLanguageBL.GetAllDO();

            Thread.Sleep(waitTime);
            MovieNameBL.GetAll();
            MovieNameBL.GetAllAsDO();

            Thread.Sleep(waitTime);
            MovieTypeBL.GetAll();
            MovieTypeBL.GetAllDO();

            Thread.Sleep(waitTime);
            MovieWriterBL.GetAll();
            MovieWriterBL.GetAllDO();

            Thread.Sleep(waitTime);
            MovieUserRatingBL.GetAll();
        }