public static BL.Project MapMvcToBusiness(MVC.Project source)
 {
     if (source == null)
     {
         return(null);
     }
     BL.Project target = BL.Project.GetOrCreate(MapSupport.ActiveCtx, source.ProjectId);
     if (target.Version != Guid.Empty && target.Version != source.ProjectVersion)
     {
         throw new DataException("Concurrency check failed");
     }
     if (source.ProjectIsDeleted)
     {
         target.Delete(MapSupport.ActiveCtx);
         return(null);
     }
     else
     {
         target.Version            = source.ProjectVersion;
         target.Name               = source.ProjectName;
         target.StatusTrackingUrl  = source.ProjectStatusTrackingUrl;
         target.TrackingUpdateTime = source.ProjectTrackingUpdateTime;
         target.StatusData         = source.ProjectStatusData;
         target.ProjectInfo        = MapProjectInfo.MapMvcToBusiness(source.ProjectInfo);
         target.ProjectStatusInfo  = MapProjectStatusInfo.MapMvcToBusiness(source.ProjectStatusInfo);
     }
     return(target);
 }
        public static MVC.Project MapBusinessToMvc(BL.Project source)
        {
            if (source == null)
            {
                return(null);
            }
            MVC.Project target = new MVC.Project();
            target.ProjectId                 = source.Id;
            target.ProjectVersion            = source.Version;
            target.ProjectName               = source.Name;
            target.ProjectStatusTrackingUrl  = source.StatusTrackingUrl;
            target.ProjectTrackingUpdateTime = source.TrackingUpdateTime;
            target.ProjectStatusData         = source.StatusData;
            target.ProjectInfo               = MapProjectInfo.MapBusinessToMvc(source.ProjectInfo);
            target.ProjectStatusInfo         = MapProjectStatusInfo.MapBusinessToMvc(source.ProjectStatusInfo);


            return(target);
        }