private  void CheckThatDiscountPriceIsValid(double discountPrice, CreateCouponViewModel createCouponVM)
        {
            var loggedInUserRoleName = Session.GetLoggedInUserRoleName();
            var isCurrentUserManager = loggedInUserRoleName == RoleNames.ADMINISTRATORS;
            var couponForCurrentTeacher = Session.GetLoggedInUser().ObjectId == createCouponVM.CouponStudentDetails.StudentUserId;
           
            if (loggedInUserRoleName == RoleNames.TEACHERS && discountPrice == 0)
            {
                createCouponVM.CouponErrors.PriceError = string.Empty;
                return;                
            }

            if (!isCurrentUserManager)
            {
                if ((!couponForCurrentTeacher && discountPrice ==0)|| discountPrice < 0)
                {
                    createCouponVM.CouponErrors.PriceError = MyMentorResources.couponPriceIsZero;
                }
                else if ((discountPrice / createCouponVM.GetCountentPrice()) > 0.9)
                {
                    createCouponVM.CouponErrors.PriceError = MyMentorResources.couponDiscountToolittle;
                }
                else
                {
                    createCouponVM.CouponErrors.PriceError = string.Empty;
                }
            }
        }
        private CouponDiscountType GetDiscountType(CreateCouponViewModel createCouponViewModel, double discountPrice)
        {
            var isAdminDiscount = Session.GetLoggedInUserRoleName() == RoleNames.ADMINISTRATORS;
            var isCouponForCurrentTeacher = Session.GetLoggedInUser().ObjectId == createCouponViewModel.CouponStudentDetails.StudentUserId;
             
            var teacherDiscountPrice = createCouponViewModel.GetCountentPrice() * (1 - createCouponViewModel.TeacherData.TeacherCommissionRate);

            if (isAdminDiscount)
            {
                return CouponDiscountType.Admin;
            }
            if (isCouponForCurrentTeacher)
            {
                return CouponDiscountType.Regular;
            }
            return teacherDiscountPrice <= discountPrice ? CouponDiscountType.Regular : CouponDiscountType.Special;
        }