Example #1
0
        //Please write your properties and functions here. This part will not be replaced.


        /// <summary>
        /// Checks for view pre requisites if any
        /// </summary>
        /// <param name="p">parameters</param>
        protected override ViewNeedResponse CheckViewNeeds(ViewNeedRequest p)
        {
            ViewNeedResponse r = new ViewNeedResponse();

            switch (p.ViewName)
            {
            case "BookForDoctorWizard":
                long doctorId = Convert.ToInt64(p.Parameters["DoctorID"]);

                r.AddNeed(new DoctorInfoExistsViewNeed().CheckNeed(doctorId));

                if (r.Needs.Count == 0)
                {
                    r.AddNeed(new DoctorScheduleExistsForBookingViewNeed().CheckNeed(doctorId));
                }

                break;

            case "BookForPatientWizard":
                long userId = Convert.ToInt64(p.Parameters["PatientID"]);
                if (r.Needs.Count == 0)
                {
                    r.AddNeed(new PersonExistsViewNeed().CheckNeed(userId));
                }
                //if (r.Needs.Count == 0)
                //    r.AddNeed(new UserVerifiedPhoneNumberViewNeed().CheckNeed(userId));
                //if (r.Needs.Count == 0)
                //    r.AddNeed(new MedicalHistoryExistsViewNeed().CheckNeed(userId));
                break;

            default:
                throw new NotImplementedException();
            }
            return(r);
        }
        //Please write your properties and functions here. This part will not be replaced.

        /// <summary>
        /// Checks for view pre requisites if any
        /// </summary>
        /// <param name="p">parameters</param>
        protected override ViewNeedResponse CheckViewNeeds(ViewNeedRequest p)
        {
            ViewNeedResponse r = new ViewNeedResponse();

            switch (p.ViewName)
            {
            case "CalendarEdit":
                long doctorId = Convert.ToInt64(p.Parameters["DoctorID"]);
                r.AddNeed(new DoctorInfoExistsViewNeed().CheckNeed(doctorId));

                if (r.Needs.Count == 0)
                {
                    r.AddNeed(new UserVerifiedEmailViewNeed().CheckNeed(doctorId));
                }

                //if (r.Needs.Count == 0)
                //   r.AddNeed(new UserVerifiedPhoneNumberViewNeed().CheckNeed(doctorId));

                break;

            default:
                throw new NotImplementedException();
            }
            return(r);
        }
Example #3
0
 public ServiceActionResult GetViewNeeds(string p)
 {
     try
     {
         ViewNeedRequest r = (ViewNeedRequest)FWUtils.EntityUtils.JsonDeserializeObject(p, typeof(ViewNeedRequest));
         return(new ServiceActionResult(CheckViewNeeds(r)));
     }
     catch (Exception ex)
     {
         return(UIUtils.GetExceptionActionResult(ex));
     }
 }
        //Please write your properties and functions here. This part will not be replaced.


        /// <summary>
        /// Checks for view pre requisites if any
        /// </summary>
        /// <param name="p">parameters</param>
        protected override ViewNeedResponse CheckViewNeeds(ViewNeedRequest p)
        {
            ViewNeedResponse r = new ViewNeedResponse();

            switch (p.ViewName)
            {
            case "TwoKey":
                long doctorId = Convert.ToInt64(p.Parameters["DoctorID"]);
                r.AddNeed(new DoctorInfoExistsViewNeed().CheckNeed(doctorId));
                break;

            default:
                throw new NotImplementedException();
            }
            return(r);
        }
Example #5
0
        //Please write your properties and functions here. This part will not be replaced.


        protected override ViewNeedResponse CheckViewNeeds(ViewNeedRequest p)
        {
            ViewNeedResponse r = new ViewNeedResponse();

            switch (p.ViewName)
            {
            case "FitActivityForm":
                long userId = FWUtils.SecurityUtils.GetCurrentUserIDLong();
                if (r.Needs.Count == 0)
                {
                    r.AddNeed(new PersonExistsViewNeed().CheckNeed(userId));
                }
                break;
            }
            return(r);
        }
Example #6
0
 /// <summary>
 /// Checks for view pre requisites if any
 /// </summary>
 /// <param name="p">parameters</param>
 protected virtual ViewNeedResponse CheckViewNeeds(ViewNeedRequest p)
 {
     return(null);
 }