Esempio n. 1
0
        public ActionResult SearchRecords(string recordId, string month, string year, string practitionerId)
        {
            List <PractitionerRecordsDirectory> result = new List <PractitionerRecordsDirectory>();

            if (recordId.Length == 36 || recordId.Length == 4)
            {
                PractitionerRecordSearch vm = new PractitionerRecordSearch();
                if (recordId.Length == 4)
                {
                    vm.RecordId = Guid.Empty;
                }
                else
                {
                    vm.RecordId = Guid.Parse(recordId);
                }
                //vm.Month = (Month)Enum.ToObject(typeof(Month), month);
                vm.Month = (Month)Enum.Parse(typeof(Month), month);
                vm.Year  = Convert.ToInt32(year);
                vm.AccId = Guid.Parse(practitionerId);

                if ((vm.Year > 1800 && vm.Year < 2200) || String.IsNullOrEmpty(year))
                {
                    PractitionerProcess process = new PractitionerProcess();
                    result = process.SearchRecords(vm);
                }
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }