Exemplo n.º 1
0
 public ProgramDetailsMessageDTO(ParentProgramDTO source)
 {
     Vant4geProgramID                = source.ParentProgramId;
     StateProgramID                  = source.StateProgramID;
     ProgramStatus                   = source.IsActive ? "A" : "I";
     VantageTitle                    = source.Title;
     StateProgramName                = source.StateProgramName;
     TotalDosage                     = source.NumberOfSessions;
     ProgramDuration                 = source.ProgramDuration;
     Description                     = source.Description;
     Platform                        = source.PlatformName.ToCharArray()[0].ToString();
     PrisonSupervision               = AgencySettingsConstants.GetByEnum(source.AgencySettingsID).ToCharArray()[0].ToString();
     NumberofSession                 = source.NumberOfSessions;
     MaxClassSize                    = source.MaxClassSize;
     MinClassSize                    = source.MinClassSize;
     IncentiveProgram                = source.IsIncentiveProgram ? "Y" : "N";
     Credits                         = source.CreditName;
     Gender                          = GenderConstants.GetByEnum(Convert.ToInt32(source.AppliesToGender)).ToCharArray()[0].ToString();
     RequiredProgram                 = source.Required ? "Y" : "N";
     RequireApprovalToJoin           = source.RequireApproval ? "Y" : "N";
     ProvidesCertificateOnCompletion = source.Certificate ? "Y" : "N";
     TestRequiredForCompletion       = source.HasTest ? "Y" : "N";
     CostPerPerson                   = source.CostPerPerson;
     CostToSubject                   = source.CostToSubject;
     RequireNewSTRONGR               = source.RequireNewAssessment ? "Y" : "N";
     LastUpdateUserID                = source.UpdatedByUserID;
     HourlyPayRate                   = source.HourlyPayRate;
     if (source.methodOfTreatments.Any())
     {
         List <string> methodOfTreatmentsNameList = source.methodOfTreatments.Select(x => x.Name).ToList();
         MethodofTreatment = methodOfTreatmentsNameList != null?string.Join(",", methodOfTreatmentsNameList) : "";
     }
 }
Exemplo n.º 2
0
        public BOPProgramDTO(ParentProgram source, string assignedUser, Program assignedProgramInstances, List <ProgramAttendance> subjectAttendance, SubjectProgramMapping subjectprogram, string methodOfTreatments, string programStatus, string assignedTreatmentPathway, DateTime?assignedDate) : base()
        {
            ParentProgramId  = source.ParentProgramId;
            SubjectProgramID = subjectprogram.SubjectProgramID;
            ProgramTypes     = methodOfTreatments;
            ProgramStartDate = subjectprogram.DateStarted.HasValue ? subjectprogram.DateStarted.Value.ToString("MM/dd/yyyy") : null;
            ProgramEndDate   = subjectprogram.DateEnded.HasValue ? subjectprogram.DateEnded.Value.ToString("MM/dd/yyyy") : null;
            Dosage           = source.Dosage;
            AgencySetting    = AgencySettingsConstants.GetByEnum(source.AgencySettings);
            TreatmentPathway = assignedTreatmentPathway;
            AssignedDate     = assignedDate;
            if (assignedProgramInstances != null && assignedProgramInstances.ParentProgramID == ParentProgramId)
            {
                Title     = source.Title + " - " + assignedProgramInstances.Title;
                ProgramID = assignedProgramInstances.ProgramId;
                if (source.IsPerpetual)
                {
                    Schedule     = "Open";
                    ScheduleDate = "";
                }
                else if (source.Platform == (int)PlatformType.Online)
                {
                    Schedule     = "Open(Online)";
                    ScheduleDate = "";
                }
                else
                {
                    Schedule     = "Closed";
                    ScheduleDate = "(" + assignedProgramInstances.StartDate.Value.ToString("MM/dd/yyyy") + " - " + assignedProgramInstances.EndDate.Value.ToString("MM/dd/yyyy") + ")";
                }
            }
            else
            {
                Title    = source.Title;
                Schedule = "N/A";
            }
            Status = programStatus.ToUpper();
            if (assignedProgramInstances != null)
            {
                IsAssigned = true;
            }
            else
            {
                IsAssigned = false;
            }

            AssignedByUser = assignedUser;
        }