public JsonResult RefreshListPreorderPatientByDate(MagasineOfPreorder magasineofpreorder)
 {
     magasineofpreorder.Result = false;
     HelperRefreshPreorderMagasine(magasineofpreorder.ConvertDateOfVisit);
     magasineofpreorder.Result = true;
     return(Json(magasineofpreorder.Result, JsonRequestBehavior.AllowGet));
 }
        public JsonResult DeleteNoteFromPreorderMagasine(MagasineOfPreorder magasineofpreorder)
        {
            DateTime preorderdate = new DateTime();

            preorderdate = Convert.ToDateTime(magasineofpreorder.ConvertDateOfVisit);
            magasineofpreorder.Result = bll.BllDeleteNoteFromPreorderMagasine(magasineofpreorder.StudyId, preorderdate, magasineofpreorder.PatientId);
            if (magasineofpreorder.Result)
            {
                HelperRefreshPreorderMagasine(magasineofpreorder.ConvertDateOfVisit);
            }
            return(Json(magasineofpreorder));
        }
        public JsonResult GetAllPreorderingPatientByDate(MagasineOfPreorder filter)
        {
            //if (!filter.Latch)
            //HelperRefreshPreorderMagasine(filter.ConvertDateOfVisit);
            var ResultOfFilteringInPreorderMagasin = PreorderPatientByDate;
            var resultoffiltering = ResultOfFilteringInPreorderMagasin.Where(c =>
                                                                             (String.IsNullOrEmpty(filter.LastName) || c.LastName.Contains(filter.LastName) || c.LastName.ToLower().Contains(filter.LastName)) &&
                                                                             (String.IsNullOrEmpty(filter.CellPhone) || c.CellPhone.Contains(filter.CellPhone)) &&
                                                                             (String.IsNullOrEmpty(filter.StudyType) || c.StudyType.Contains(filter.StudyType) || c.StudyType.ToLower().Contains(filter.StudyType))
                                                                             ).OrderBy(c => c.ConvertedTimeOfVisit);

            return(Json(resultoffiltering.ToList(), JsonRequestBehavior.AllowGet));
        }
        public JsonResult AddNewPatientToPreorderMagasine(MagasineOfPreorder magasineofpreorder)
        {
            //MagasineOfPreorder emptyrowofpreorder = new MagasineOfPreorder();
            var newpreorder = SendItemsFromTo.ReassignmentOfFields(magasineofpreorder);

            magasineofpreorder.Result = bll.BllAddNewPatientToPreorderMagasine(newpreorder.Pat_Id, newpreorder.St_Id, newpreorder.NewVisitDate,
                                                                               newpreorder.IsPreorder, newpreorder.IsNeedSendEmail, newpreorder.IsHasVisited, newpreorder.IsCash);
            if (magasineofpreorder.Result)
            {
                HelperRefreshPreorderMagasine(magasineofpreorder.ConvertDateOfVisit);
                return(Json(magasineofpreorder));
            }
            else
            {
                return(Json(emptyrowofpreorder));
            }
        }
Example #5
0
        public static DalMagasines ReassignmentOfFields(MagasineOfPreorder magasineofpreorder)
        {
            DalMagasines dalpreorder = new DalMagasines();

            dalpreorder.Pat_Id            = magasineofpreorder.PatientId;
            dalpreorder.Pat_LastName      = magasineofpreorder.LastName;
            dalpreorder.Pat_FirstName     = magasineofpreorder.FirstName;
            dalpreorder.Pat_MiddleName    = magasineofpreorder.MiddleName;
            dalpreorder.Pat_CellPhone     = magasineofpreorder.CellPhone;
            dalpreorder.Pat_BirthDateToDB = Convert.ToDateTime(magasineofpreorder.ConvertedBirthDate);
            dalpreorder.Pat_Adress        = magasineofpreorder.Adress;
            dalpreorder.Pat_JobPlace      = magasineofpreorder.JobPlace;
            dalpreorder.Pat_Email         = magasineofpreorder.Email;
            dalpreorder.Pat_Note          = magasineofpreorder.Note;
            dalpreorder.VisitDate         = Convert.ToDateTime(magasineofpreorder.ConvertDateOfVisit);
            dalpreorder.NewVisitDate      = Convert.ToDateTime(magasineofpreorder.NewConvertDateOfVisit);
            dalpreorder.IsPreorder        = magasineofpreorder.IsPreorder;
            dalpreorder.IsNeedSendEmail   = magasineofpreorder.IsNeedSendEmail;
            dalpreorder.IsHasVisited      = magasineofpreorder.IsHasVisited;
            dalpreorder.St_Id             = magasineofpreorder.StudyId;
            dalpreorder.NewStudyId        = magasineofpreorder.NewStudyId;
            dalpreorder.IsCash            = magasineofpreorder.IsCash;
            return(dalpreorder);
        }
        public JsonResult UpdateNoteOfPreorderMagasine(MagasineOfPreorder magasineofpreorder)
        {
            var updatepreordernote = SendItemsFromTo.ReassignmentOfFields(magasineofpreorder);

            magasineofpreorder.Result = bll.BllUpdateNoteOfPreorderMagasine(updatepreordernote.Pat_Id, updatepreordernote.St_Id,
                                                                            updatepreordernote.NewStudyId, updatepreordernote.VisitDate,
                                                                            updatepreordernote.NewVisitDate);
            if (magasineofpreorder.Result)
            {
                //For refresh we need short date dd/mm/yyyy
                string[] words = magasineofpreorder.ConvertDateOfVisit.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                string   ShortConvertDateOfVisit = words[0];
                HelperRefreshPreorderMagasine(ShortConvertDateOfVisit);

                //For preorder JsGrid, after updated of the note
                magasineofpreorder.ConvertedTimeOfVisit = magasineofpreorder.NewConvertedTimeOfVisit;

                return(Json(magasineofpreorder));
            }
            else
            {
                return(Json(emptyrowofpreorder));
            }
        }