예제 #1
0
        public JsonResult UpdateNoteOfInFactMagasine(MagasineInFact magasineinfact)
        {
            var updateinfactorder = SendItemsFromTo.ReassignmentOfFields(magasineinfact);

            magasineinfact.Result = bll.BllUpdateNoteOfInFactMagasine(updateinfactorder.Pat_Id, updateinfactorder.St_Id,
                                                                      updateinfactorder.NewStudyId, updateinfactorder.VisitDate,
                                                                      updateinfactorder.IsNeedSendEmail, updateinfactorder.IsCash, updateinfactorder.LaborantId1,
                                                                      updateinfactorder.NewLaborantId1, updateinfactorder.LaborantId2, updateinfactorder.NewLaborantId2,
                                                                      updateinfactorder.FinalCost,
                                                                      updateinfactorder.NoteForDiscount, updateinfactorder.DoctorData);
            if (magasineinfact.Result)
            {
                //For refresh we need short date dd/mm/yyyy
                string[] words = magasineinfact.ConvertDateOfVisit.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                string   ShortConvertDateOfVisit = words[0];
                HelperRefreshInFactMagasine(ShortConvertDateOfVisit);

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

                return(Json(magasineinfact));
            }
            else
            {
                return(Json(magasineinfact));
            }
        }
예제 #2
0
        public JsonResult GetAllInFactPatientByDate(MagasineInFact filter)
        {
            //HelperRefreshInFactMagasine(filter.ConvertDateOfVisit);
            //IOrderedEnumerable<MagasineInFact> resultoffiltering;

            if (InFactPatientByDate.Count() != 0)
            {
                var ResultOfFilteringInFactMagasin = InFactPatientByDate;
                var resultoffiltering = ResultOfFilteringInFactMagasin.Where(c =>
                                                                             (String.IsNullOrEmpty(filter.LastName) || c.LastName.Contains(filter.LastName) || c.LastName.ToLower().Contains(filter.LastName)) &&
                                                                             (String.IsNullOrEmpty(filter.StudyType) || c.StudyType.Contains(filter.StudyType) || c.StudyType.ToLower().Contains(filter.StudyType)))
                                        .OrderBy(c => c.ConvertedTimeOfVisit);

                int count = 1;
                foreach (var finallist in resultoffiltering)
                {
                    finallist.NumberInOrder = count;
                    count++;
                }


                return(Json(resultoffiltering.ToList(), JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(InFactPatientByDate, JsonRequestBehavior.AllowGet));
            }
        }
예제 #3
0
        public JsonResult DeleteNoteFromInFactMagasine(MagasineInFact magasineinfact)
        {
            DateTime dateofvisitinfact = new DateTime();

            dateofvisitinfact     = Convert.ToDateTime(magasineinfact.ConvertDateOfVisit);
            magasineinfact.Result = bll.BllDeleteNoteFromInFactMagasine(magasineinfact.StudyId, dateofvisitinfact, magasineinfact.PatientId,
                                                                        magasineinfact.IsPreorder, magasineinfact.IsHasVisited, magasineinfact.LaborantData);
            if (magasineinfact.Result)
            {
                HelperRefreshInFactMagasine(magasineinfact.ConvertDateOfVisit);
            }
            return(Json(magasineinfact));
        }
예제 #4
0
        public static DalMagasines ReassignmentOfFields(MagasineInFact magasineinfact)
        {
            DalMagasines dalinfact = new DalMagasines();

            dalinfact.Pat_Id            = magasineinfact.PatientId;
            dalinfact.Pat_LastName      = magasineinfact.LastName;
            dalinfact.Pat_FirstName     = magasineinfact.FirstName;
            dalinfact.Pat_MiddleName    = magasineinfact.MiddleName;
            dalinfact.Pat_CellPhone     = magasineinfact.CellPhone;
            dalinfact.Pat_BirthDateToDB = Convert.ToDateTime(magasineinfact.ConvertedBirthDate);
            dalinfact.Pat_Adress        = magasineinfact.Adress;
            dalinfact.Pat_JobPlace      = magasineinfact.JobPlace;
            dalinfact.Pat_Email         = magasineinfact.Email;
            dalinfact.Pat_Note          = magasineinfact.Note;
            dalinfact.VisitDate         = Convert.ToDateTime(magasineinfact.ConvertDateOfVisit);
            //dalinfact.NewVisitDate = Convert.ToDateTime(magasineinfact.NewConvertDateOfVisit);
            dalinfact.IsPreorder      = magasineinfact.IsPreorder;
            dalinfact.IsNeedSendEmail = magasineinfact.IsNeedSendEmail;
            dalinfact.IsHasVisited    = magasineinfact.IsHasVisited;

            string[] SeparateIdFromCost = magasineinfact.SelectedStudyInFact.Trim().Split(new char[] { '#' });
            dalinfact.St_Id = Int32.Parse(SeparateIdFromCost[0]);

            if (magasineinfact.NewSelectedStudyInFact != null)
            {
                string[] SeparateIdFromCostNewStudy = magasineinfact.NewSelectedStudyInFact.Trim().Split(new char[] { '#' });
                dalinfact.NewStudyId = Int32.Parse(SeparateIdFromCostNewStudy[0]);
            }


            //dalinfact.NewStudyId = magasineinfact.NewStudyId;
            dalinfact.IsCash = magasineinfact.IsCash;

            dalinfact.LaborantId1    = magasineinfact.LaborantId1;
            dalinfact.LaborantId2    = magasineinfact.LaborantId2;
            dalinfact.NewLaborantId1 = magasineinfact.NewLaborantId1;
            dalinfact.NewLaborantId2 = magasineinfact.NewLaborantId2;

            string notconvertfinalcost = (magasineinfact.ConvertedFinalCost.Contains(".") || magasineinfact.ConvertedFinalCost.Contains(",") ?
                                          magasineinfact.ConvertedFinalCost.Replace(".", ",").Trim() :
                                          magasineinfact.ConvertedFinalCost.Trim());

            dalinfact.FinalCost       = float.Parse(notconvertfinalcost);
            dalinfact.NoteForDiscount = (magasineinfact.NoteForDiscount == null) ? "": magasineinfact.NoteForDiscount;
            dalinfact.DoctorData      = (magasineinfact.DoctorData == null) ? "": magasineinfact.DoctorData;

            return(dalinfact);
        }
예제 #5
0
        public JsonResult AddNewPatientToInFactMagasine(MagasineInFact magasineinfact)
        {
            //MagasineOfPreorder emptyrowofpreorder = new MagasineOfPreorder();
            var newinfactorder = SendItemsFromTo.ReassignmentOfFields(magasineinfact);

            magasineinfact.Result = bll.BllAddNewPatientToInFactMagasine(newinfactorder.Pat_Id, newinfactorder.St_Id, newinfactorder.VisitDate,
                                                                         newinfactorder.IsPreorder, newinfactorder.IsNeedSendEmail, newinfactorder.IsHasVisited, newinfactorder.IsCash,
                                                                         newinfactorder.LaborantId1, newinfactorder.LaborantId2, newinfactorder.FinalCost,
                                                                         newinfactorder.NoteForDiscount, newinfactorder.DoctorData);
            if (magasineinfact.Result)
            {
                string[] words = magasineinfact.ConvertDateOfVisit.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                string   ShortConvertDateOfVisit = words[0];
                HelperRefreshInFactMagasine(ShortConvertDateOfVisit);
                return(Json(magasineinfact));
            }
            else
            {
                return(Json(emptyrowinfact));
            }
        }
예제 #6
0
 public JsonResult RefreshListInFactPatientByDate(MagasineInFact magasineinfact)
 {
     HelperRefreshInFactMagasine(magasineinfact.ConvertDateOfVisit);
     return(Json(null, JsonRequestBehavior.AllowGet));
 }