예제 #1
0
        public CasePreviewViewModel BindCaseModelToCasePreviewViewModel(ReportModel rm, int caller_id)
        {
            var watch = System.Diagnostics.Stopwatch.StartNew();
            CasePreviewViewModel vm_case = new CasePreviewViewModel();

            this.report_id                = rm._report.id;
            this.case_dt                  = rm.IncidentDateString();
            this.reported_dt              = rm.ReportedDateString();
            this.case_number              = rm._report.display_name;
            this.location                 = rm.LocationString();
            this.case_secondary_types     = rm.SecondaryTypeString();
            this.case_secondary_types_all = rm.SecondaryTypeStringAll();
            this.case_color_code          = rm.ColorCode();
            this.days_left                = rm.GetThisStepDaysLeft();
            this.current_status           = rm.InvestigationStatusString();


            this.tasks_number    = rm.ReportTasks(0).Count().ToString();
            this.messages_number = rm.UserMessagesCountNotSecure(caller_id, 0).ToString();

            //?
            return(vm_case);
        }