Пример #1
0
 private void EditMedical(MedicalDetails details)
 {
     _IMedicalExperienceRepository.EditMedicalExperience(new MedicalExperience
     {
         id              = details.MedicalID,
         university      = details.University,
         specialization  = details.Specialization,
         graduation_date = details.GraduationDate,
         about_myself    = details.AboutMyself
     });
 }
Пример #2
0
        public ActionResult ChangeMedicalExperience()
        {
            var model = new MedicalDetails
            {
                MedicalID      = CurrentUserMedicalExperience.id,
                University     = CurrentUserMedicalExperience.university,
                Specialization = CurrentUserMedicalExperience.specialization,
                AboutMyself    = CurrentUserMedicalExperience.about_myself,
                GraduationDate = CurrentUserMedicalExperience.graduation_date
            };

            return(View(model));
        }
Пример #3
0
        public async Task <YourTaxDetailsResponse> GetTaxCalculation(decimal earnings, decimal racontribamount, int ageinyears, bool med, short dep, bool isannual)
        {
            var medicaldtls = new MedicalDetails {
                Dependants = dep, HaveMedicalAid = med
            };
            var taxdtls = new YourTaxDetails {
                Earnings = earnings, RaContrib = racontribamount, AgeInYears = (short)ageinyears, Medical = medicaldtls, TimePeriod = "Monthly"
            };

            var taxresult = await TaxSvc.ShowTaxPayableAsyncAsync(taxdtls, (short)ageinyears, isannual, med);

            decimal mytax = taxresult.TaxPayable;

            return(taxresult);// as IActionResult;
        }
Пример #4
0
        public ActionResult ChangeMedicalExperience(MedicalDetails model)
        {
            if (ModelState.IsValid)
            {
                _IMedicalExperienceRepository.EditMedicalExperience(new MedicalExperience
                {
                    id              = model.MedicalID,
                    university      = model.University,
                    graduation_date = model.GraduationDate,
                    specialization  = model.Specialization,
                    about_myself    = model.AboutMyself
                });

                TempData["Success"] = "Zmieniono dane lekarza.";
            }
            else
            {
                TempData["Warning"] = "Wystąpił błąd. Spróbuj jeszcze raz.";
            }

            return(RedirectToAction("ChangeMedicalExperience"));
        }
Пример #5
0
        private DisplayDetailsViewModel GetDisplayDetailsViewModel()
        {
            var accountDetails = new AccountDetails
            {
                Email       = CurrentUser.Email,
                PhoneNumber = CurrentUser.PhoneNumber
            };

            var personalDetails = new PersonalDetails
            {
                PersonalID   = CurrentUserInfo.id,
                FirstName    = CurrentUserInfo.first_name,
                LastName     = CurrentUserInfo.last_name,
                Gender       = CurrentUserInfo.gender,
                RegisterDate = CurrentUserInfo.register_date,
            };

            var addressDetails = new AddressDetails
            {
                AddressID       = CurrentUserAddress.id,
                City            = CurrentUserAddress.city,
                Street          = CurrentUserAddress.street,
                HouseNumber     = CurrentUserAddress.house_number,
                ApartmentNumber = CurrentUserAddress.apartment_number,
                PostalCode      = CurrentUserAddress.postal_code,
                PostalCity      = CurrentUserAddress.postal_city
            };

            MedicalDetails medicalDetails = null;

            if (IsDoctor)
            {
                medicalDetails = new MedicalDetails
                {
                    MedicalID      = CurrentUserMedicalExperience.id,
                    University     = CurrentUserMedicalExperience.university,
                    Specialization = CurrentUserMedicalExperience.specialization,
                    GraduationDate = CurrentUserMedicalExperience.graduation_date,
                    AboutMyself    = CurrentUserMedicalExperience.about_myself
                };
            }

            string photo = Url.Content("/Images/Photos/profile-photo.jpg");

            if (CurrentUserInfo.photo_id.HasValue)
            {
                photo = CurrentUserInfo.Photo.url;
            }
            else if (CurrentUserInfo.gender == "Kobieta")
            {
                photo = Url.Content("/Images/Photos/profile-photo-female.jpg");
            }

            var model = new DisplayDetailsViewModel
            {
                AccountDetails  = accountDetails,
                PersonalDetails = personalDetails,
                AddressDetails  = addressDetails,
                MedicalDetails  = medicalDetails,
                Photo           = photo
            };

            return(model);
        }