Esempio n. 1
0
        private static MovieDirectorDO Save(MOV_M_Director input, int userID)
        {
            MovieDirectorDO inputDO = new MovieDirectorDO( );

            ObjectMapper.MapObjects(input, inputDO, AuditInfo.Fields);
            return(Save(inputDO, userID));
        }
Esempio n. 2
0
        public static MovieDirectorDO Save(int movieID, string objectName, int userID)
        {
            var objList = DirectorBL.GetAllDO( ).Where(q => q.Name == objectName).ToList( );

            DirectorDO obj;

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

            MOV_M_Director objectToAdd = new MOV_M_Director( );

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

            return(Save(objectToAdd, userID));
        }
Esempio n. 3
0
        public static MovieDirectorDO Save(MovieDirectorDO inputDO, int userID)
        {
            Repository <MOV_M_Director> rep = new Repository <MOV_M_Director> (MArchiveDataContextProvider.Instance);

            MOV_M_Director objectToAdd = null;

            objectToAdd = new MOV_M_Director( );
            ObjectMapper.MapObjects(inputDO, objectToAdd, AuditInfo.Fields);
            rep.InsertOnSubmit(objectToAdd);

            rep.DCP.CommitChanges(userID);

            InvalidateCache(CacheAreaKey);

            ObjectMapper.MapObjects(objectToAdd, inputDO);
            return(inputDO);
        }