Esempio n. 1
0
        private ActorAgreement GetAgreementByRow(DataRow dr)
        {
            ActorAgreement a = new ActorAgreement();

            if (dr != null)
            {
                a.AgreementId = Convert.ToInt32(dr["AgreementId"]);
                a.ActorId     = Convert.ToInt32(dr["ActorId"]);
                a.MovieId     = Convert.ToInt32(dr["MovieId"]);
            }
            return(a);
        }
Esempio n. 2
0
 public void SetUpMovieActorAgreements()
 {
     if (this.MovieActorIds != null && this.MovieActorIds.Count > 0)
     {
         List <ActorAgreement> existingAgreements = new ActorAgreement().GetAgreementsofMovie(this.MovieId);
         if (existingAgreements != null && existingAgreements.Count > 0)
         {
             List <int> existingAgreementIds = existingAgreements.Select(e => e.AgreementId).ToList();
             new ActorAgreement().DeleteAgreement(existingAgreementIds);
         }
         foreach (int actorId in this.MovieActorIds)
         {
             ActorAgreement newAgreement = new ActorAgreement {
                 ActorId = actorId, MovieId = this.MovieId
             };
             newAgreement.AddAgreement();
         }
     }
 }