Beispiel #1
0
        internal ResolvePopupVM GetResolveRecord(int id)
        {
            var model = new Models.ResolvePopupVM();

            var reportData = AppService.Current.DataContextV2.HoursReportLogItems.Where(x => x.ID == id).SingleOrDefault();
            var hoursData  = reportData.Hours;

            model.ID           = reportData.ID;
            model.PatientName  = Helpers.CommonListItems.GetCommonName(hoursData.Case.Patient.FirstName, hoursData.Case.Patient.LastName);
            model.ProviderName = Helpers.CommonListItems.GetCommonName(hoursData.Provider.FirstName, hoursData.Provider.LastName);
            model.ServiceCode  = hoursData.Service.Code;
            model.ServiceName  = hoursData.Service.Name;

            DateTime startTime = hoursData.Date.Add(hoursData.StartTime);
            DateTime endTime   = hoursData.Date.Add(hoursData.EndTime);

            model.HoursText = hoursData.Date.ToLongDateString() + "<br/>"
                              + startTime.ToString("h:mm tt") + " - "
                              + endTime.ToString("h:mm tt");

            model.ReportedBy      = Helpers.CommonListItems.GetCommonName(reportData.ReportedBy.FirstName, reportData.ReportedBy.LastName);
            model.ReportedOn      = reportData.DateReported;
            model.ReportedMessage = reportData.Message;
            model.ResolvedMessage = reportData.ResolvedMessage;
            model.IsResolved      = true;

            return(model);
        }
Beispiel #2
0
        public void UpdateResolveRecord(Models.ResolvePopupVM model)
        {
            var context    = AppService.Current.DataContextV2;
            var reportData = context.HoursReportLogItems.Where(x => x.ID == model.ID).Single();
            var hoursData  = reportData.Hours;

            reportData.ResolvedMessage = model.ResolvedMessage;
            reportData.IsResolved      = model.IsResolved;

            if (model.IsResolved)
            {
                hoursData.ParentReported = false;
            }

            context.SaveChanges();
        }
Beispiel #3
0
 public ActionResult ResolveSubmit(Models.ResolvePopupVM model)
 {
     service.UpdateResolveRecord(model);
     return(Json("ok"));
 }