public bool UpdateCaseIntake(CaseIntake caseData)
        {
            try
            {
                using (var dbModel = InitiateDbContext())
                {
                    var entity = dbModel.CaseIntakes.Find(caseData.Id);

                    if (entity == null)
                    {
                        return(false);
                    }

                    dbModel.Entry <CaseIntake>(entity).CurrentValues.SetValues(caseData);
                    dbModel.SaveChanges();

                    return(true);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
                throw;
            }
        }
 public void OnGet(int clientId)
 {
     try
     {
         CaseIntakeData = new CaseIntake {
             ClientId = clientId, IntakeTime = TimeZoneUtility.DateTimeNow, IntakeDate = TimeZoneUtility.DateTimeNow
         };
     }
     catch (Exception ex)
     {
         m_Log.CriticalEntry(User.Identity.Name, ex.ToString());
         throw;
     }
 }
        public void OnGet(int caseIntakeId)
        {
            try
            {
                CaseIntakeData = m_CaseIntake.GetCaseIntake(caseIntakeId);

                if (CaseIntakeData.PresentingProblems != null)
                {
                    CaseIntakeData.PresentingProblemsArray = CaseIntakeData.PresentingProblems.Split("@").ToList();
                }
            }
            catch (Exception ex)

            {
                m_Log.CriticalEntry(User.Identity.Name, ex.ToString());
                throw;
            }
        }
        public int CreateCaseIntake(CaseIntake caseData)
        {
            try
            {
                using (var dbModel = InitiateDbContext())
                {
                    caseData.CaseNumber = Utility.GetNextNumber(dbModel, "GetNextCaseNumber");

                    dbModel.CaseIntakes.Add(caseData);
                    dbModel.SaveChanges();

                    return(caseData.Id);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
                throw;
            }
        }