Ejemplo n.º 1
0
 // TODO:  This is hard-coded for Purse Seine crew, something that needs fixing...
 // Probably the best fix would be to centralize crew into a common table
 // and enforce jobtype constraints at the application level.
 public static Crew AsCrew(this TubsWeb.ViewModels.CrewViewModel.CrewMemberModel cmm, JobType job)
 {
     Crew crew = null;
     if (null != cmm && !cmm._destroy && cmm.IsFilled)
     {
         crew = new PurseSeineCrew();
         cmm.CopyTo(crew);
         if (!crew.Job.HasValue)
             crew.Job = job;
     }
     return crew;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a crew member to the trip.
        /// Using this method respects the parent-child linkage.
        /// </summary>
        /// <param name="crew">Crew member being added</param>
        public virtual void AddCrew(PurseSeineCrew crew)
        {
            if (null == crew)
                return;

            crew.Trip = this;
            this.Crew.Add(crew);
        }