Ejemplo n.º 1
0
        private static MovieActorDO Save(MOV_M_Actor input, int userID)
        {
            MovieActorDO inputDO = new MovieActorDO( );

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

            ActorDO obj;

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

            MOV_M_Actor objectToAdd = new MOV_M_Actor( );

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

            return(Save(objectToAdd, userID));
        }
Ejemplo n.º 3
0
        public static MovieActorDO Save(MovieActorDO inputDO, int userID)
        {
            Repository <MOV_M_Actor> rep = new Repository <MOV_M_Actor>(MArchiveDataContextProvider.Instance);

            MOV_M_Actor objectToAdd = null;

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

            rep.DCP.CommitChanges(userID);

            InvalidateCache(CacheAreaKey);

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