예제 #1
0
        //private const string url =

        public override string Check(User userInfo)
        {
            var service = Doctor_InsuranceEN.GetService("");

            if (service.GetCount(new FilterExpression(vDoctor_Insurance.ColumnNames.DoctorID, userInfo.UserID)) >= 1)
            {
                return(null);
            }
            else
            {
                // if our user was doctor and he doesn't have doctor's information
                var userInRoleService = UserInRoleEN.GetService("");
                var rolesList         = userInRoleService.GetRolesIDUserID(userInfo.UserID.ToString());
                if (rolesList.Contains((long)EntityEnums.RoleEnum.Doctor))
                {
                    return("Register/Doctor_Insurance");
                }
            }
            return(null);
        }
예제 #2
0
        /// <summary>
        /// Gets insurance plans that is not in Doctor_Insurance list of a doctor
        /// </summary>
        /// <param name="p">parameters</param>
        /// <returns></returns>
        public IList <vInsurancePlan> GetNotSelectedPlans(InsurancePlanGetNotSelectedPlansSP p)
        {
            FilterExpression filter = new FilterExpression();

            filter.AddFilter(new Filter(vInsurancePlan.ColumnNames.InsuranceID, p.InsuranceID));
            SortExpression         sort      = new SortExpression(vInsurancePlan.ColumnNames.InsurancePlanTitle);
            IList <vInsurancePlan> plansList = GetByFilterV(new GetByFilterParameters(filter, sort, 0, int.MaxValue));

            IList <long> selectedList = Doctor_InsuranceEN.GetService().GetSelectedPlanIDsByUserID(p.UserID, p.InsuranceID);

            List <vInsurancePlan> notSelectedPlans = new List <vInsurancePlan>();

            foreach (vInsurancePlan plan in plansList)
            {
                if (selectedList.Contains(plan.InsurancePlanID) == false)
                {
                    notSelectedPlans.Add(plan);
                }
            }

            return(notSelectedPlans);
        }