Ejemplo n.º 1
0
        private void ExtractName(Therapist therapist, HtmlElement htmlElement)
        {
            var rows = htmlElement.InnerText.SplitByNewLine().ToList();

            switch (rows.First().Trim().ToLower())
            {
            case "frau":
                therapist.Gender = Gender.Female;
                break;

            case "herr":
                therapist.Gender = Gender.Male;
                break;
            }
            if (therapist.Gender != Gender.Unknown)
            {
                rows.RemoveAt(0);
            }
            if (rows.Count == 2)
            {
                therapist.Title = rows.First().Trim();
            }
            string fullName   = rows.Last().Trim();
            string familyName = fullName.Split(' ').Last().Trim();
            string name       = fullName.Substring(0, fullName.Length - familyName.Length).Trim();

            therapist.FamilyName = familyName;
            therapist.Name       = name;
        }
Ejemplo n.º 2
0
        private void ParseName(Therapist therapist, HtmlNode infoNode)
        {
            var nameSpans   = infoNode.Descendants("span").ToArray();
            var genderTitle = nameSpans.First().GetDecodedInnerText().ToLower().Trim();

            switch (genderTitle)
            {
            case "frau":
                therapist.Gender = Gender.Female;
                break;

            case "herr":
                therapist.Gender = Gender.Male;
                break;

            default:
                therapist.Gender = Gender.Unknown;
                Fail("Unknown Gender");
                break;
            }
            if (nameSpans.Length == 3)
            {
                var title = nameSpans[1].GetDecodedInnerText().Simplify();
                therapist.Title = title;
            }

            string fullName   = nameSpans.Last().GetDecodedInnerText().Simplify();
            string familyName = fullName.Substring(fullName.IndexOf(' ') + 1).Simplify();
            string name       = fullName.Substring(0, fullName.Length - familyName.Length).Simplify();

            therapist.FamilyName = familyName;
            therapist.Name       = name;
            Assert(!string.IsNullOrWhiteSpace(name));
            Assert(!string.IsNullOrWhiteSpace(familyName));
        }
Ejemplo n.º 3
0
        private void FillDataBindings()
        {
            priceListBindingSource.Clear();
            treatmentBindingSource.Clear();

            foreach (var price in _priceLists)
            {
                priceListBindingSource.Add(price);
            }

            foreach (var treatment in _treatMentLists)
            {
                treatmentBindingSource.Add(treatment);
            }

            if (_therapist != null)
            {
                textBoxName.Text      = _therapist.FullName;
                textBoxEmail.Text     = _therapist.Email;
                textBoxCf.Text        = _therapist.FiscalCode;
                textBoxIban.Text      = _therapist.Iban;
                textBoxPiva.Text      = _therapist.TaxNumber;
                textBoxAddress.Text   = _therapist.Address;
                textBoxAddressDe.Text = _therapist.AddressDe;
                textBoxAifi.Text      = _therapist.Aifi;
            }
            else
            {
                _therapist = new Therapist();
            }
        }
Ejemplo n.º 4
0
        // GET: PatientViewAssignment
        public ActionResult Index()
        {
            string  username    = System.Web.HttpContext.Current.User.Identity.Name;
            Patient findPatient = db.Patients.SingleOrDefault(p => p.Patient_Email == username);
            int     patientID   = findPatient.PatientID;

            Assignment assignment = db.Assignments.SingleOrDefault(a => a.PatientID == patientID);

            Therapist           therapist = db.Therapists.SingleOrDefault(t => t.TherapistID == assignment.TherapistID);
            ExerciseInstruction eI        = db.ExerciseInstructions.SingleOrDefault(e => e.AssignmentID == assignment.AssignmentID);

            AssignedVideo  aV       = db.AssignedVideos.SingleOrDefault(a => a.ExerciseInstructionID == eI.ExerciseInstructionID);
            ExerciseVideo  eV       = db.ExerciseVideos.SingleOrDefault(e => e.ExerciseVideoID == aV.ExerciseVideoID);
            Exercise       exercise = db.Exercises.SingleOrDefault(e => e.ExerciseID == eV.ExerciseID);
            ExerciseRegion region   = db.ExerciseRegions.SingleOrDefault(c => c.ExerciseRegionID == exercise.ExerciseRegionID);

            ViewBag.assignment        = assignment.AssignmentID;
            ViewBag.therapist         = therapist.Name;
            ViewBag.Number_Of_Reps    = eI.Number_Of_Reps;
            ViewBag.Frequency_Per_Day = eI.Frequency_Per_Day;
            ViewBag.Remark            = eI.Remark;
            ViewBag.eV           = eV.VideoURL;
            ViewBag.exerciseName = exercise.Name;
            ViewBag.cat          = region.Name;

            return(View());
        }
Ejemplo n.º 5
0
        private void ParseQualifications(Therapist therapist, HtmlNode infoNode)
        {
            Dictionary <string, List <string> > qualifications = new Dictionary <string, List <string> >();


            var entries = infoNode.Descendants("p").Where(n => n.HasChildNodes && n.HasInnerText()).ToArray();

            foreach (var htmlNode in entries)
            {
                var    lineElements    = htmlNode.Descendants("span").Where(n => n.HasInnerText()).ToArray();
                string currentCategory = "";
                foreach (var lineElement in lineElements)
                {
                    var style = lineElement.Attributes["style"]?.DeEntitizeValue;
                    if (style?.ToLower().Contains("font-weight: bold") == true)
                    {
                        currentCategory = lineElement.GetDecodedInnerText().Simplify();
                        Assert(!qualifications.ContainsKey(currentCategory));
                        qualifications.Add(currentCategory, new List <string>());
                    }
                    else
                    {
                        string currentLine = lineElement.GetDecodedInnerText().Simplify();
                        qualifications[currentCategory].Add(currentLine);
                    }
                }
            }
            var list = qualifications.Select(kvp => new Qualification {
                Category = kvp.Key, Content = kvp.Value
            }).ToList();

            therapist.Qualifications = list;
        }
Ejemplo n.º 6
0
 public static void ExtractContacts(Therapist therapist, HtmlElement[] htmlElements)
 {
     foreach (var htmlElement in htmlElements)
     {
         ExtractOffice(therapist, htmlElement);
     }
 }
Ejemplo n.º 7
0
    private static void SendErrorLogInMailForThread(Therapist therapist)
    {
        try
        {
            MailMessage mail = new MailMessage();

            mail.From = new MailAddress(SystemEmail);
            mail.To.Add(therapist.Email);
            mail.Subject = therapist.FirstName + " " + therapist.LastName + ": Error Log";
            if (File.Exists(PinchConstants.ErrorLogFilePath))
            {
                mail.Body = "Error log attached as requested.\nIf the file is not displaying correctly, please open it via Google Docs or Notpad.";
                Attachment attachment = new Attachment(PinchConstants.ErrorLogFilePath);
                mail.Attachments.Add(attachment);
            }
            else
            {
                mail.Body = "Error log is empty.";
            }

            SmtpServer.Send(mail);
        }
        catch (Exception e)
        {
            PrintToLog(e.ToString(), LogType.Error);
        }
    }
Ejemplo n.º 8
0
    public void OnLoginClicked()
    {
        /*m_mainController.SetCurrentPatient(new Patient() { FullName = "MY TEST p" });
         * Therapist therapist = GetUser();
         * therapist.FirstName = "Bar";
         * therapist.LastName = "Attaly";
         * therapist.Email = "*****@*****.**";
         * m_mainController.SetLoggedInTherapist(therapist);
         * m_mainController.ShowScreen(ScreensIndex.TherapistScreen);
         * //return;*/
        int UserName;

        m_statusText.text = "";
        try
        {
            if (m_userNameField.text == string.Empty || m_realPassword == string.Empty)
            {
                m_statusText.text = "Please fill all data";
                return;
            }
            if (!int.TryParse(m_userNameField.text, out UserName))
            {
                m_statusText.text = "Please enter only numbers on username field";
                return;
            }

            Therapist existingUser = QuestFileManager.GetTherapistFromFile(FilePath);

            if (existingUser != null)
            {
                if (existingUser.Password == GetUser().Password)
                {
                    m_mainController.SetLoggedInTherapist(existingUser);
                    m_mainController.ShowScreen(ScreensIndex.TherapistScreen);
                    ClearScreen();
                    return;
                }
                m_statusText.text = "Wrong password";
                return;
            }
            m_statusText.text = "User not found";
        }
        catch (Exception e)
        {
            m_statusText.text = "";
            // This is the first place that if we dont have the permission for some reason
            // an excetion will be thrown so we check that we have the permissions just in case:
            if (!Permission.HasUserAuthorizedPermission(Permission.ExternalStorageWrite) ||
                !Permission.HasUserAuthorizedPermission(Permission.ExternalStorageRead))
            {
                Permission.RequestUserPermission(Permission.ExternalStorageWrite);
                Permission.RequestUserPermission(Permission.ExternalStorageRead);
            }
            else
            {
                m_statusText.text = "Something went wrong. Please restart the application.";
            }
            PrintToLog(e.ToString(), MainController.LogType.Error);
        }
    }
        public IActionResult Register(TherapistDto therapistDto)
        {
            var therapist        = _mapper.Map <Therapist>(therapistDto);
            var validationResult = _validator.Validate(therapist);

            if (!ModelState.IsValid)
            {
                var errors = ModelState.Values.SelectMany(x => x.Errors).Select(x => x.ErrorMessage).ToList();
                return(BadRequest(errors));
            }
            else if (!validationResult.IsValid)
            {
                var validationErrors = validationResult.Errors.Select(x => $"{x.PropertyName} failed validation: ${x.ErrorMessage}.");
                return(BadRequest(string.Join(";", validationErrors)));
            }

            Therapist result = _therapistRepository.Create(therapist, therapistDto.Password);

            if (result != null)
            {
                return(Ok("Therapist created."));
            }

            return(StatusCode(500, "There was a problem trying to create therapist."));
        }
Ejemplo n.º 10
0
    private static void SendAllReportsInMailForThread(Therapist therapist)
    {
        try
        {
            MailMessage mail = new MailMessage();

            mail.From = new MailAddress(SystemEmail);
            mail.To.Add(therapist.Email);
            mail.Subject = therapist.FirstName + " " + therapist.LastName + ": All Patients Reports";
            mail.Body    = "All patients reports are attached as requested.\nIf the file is not displaying correctly, please open it via Google Docs or Notpad.";

            string[] patientsFiles = Directory.GetFiles(PinchConstants.PatientsDirectoryPath);

            foreach (string file in patientsFiles)
            {
                Patient patient = QuestFileManager.GetPatientFromFile(file);

                Attachment attachment = new Attachment(ReportsManager.GetPatientReport(patient), patient.Id + ReportExtention);
                mail.Attachments.Add(attachment);
            }

            SmtpServer.Send(mail);
        }
        catch (Exception e)
        {
            PrintToLog(e.ToString(), LogType.Error);
        }
    }
Ejemplo n.º 11
0
        public static string GetDescriptionText(this Therapist therapist)
        {
            var stringBuilder = new StringBuilder();
            var languageFile  = App.Instance.AppState.LanguageFile;

            var qualification = string.Join(",", therapist.Qualifications.SelectMany(q => q.Content).Select(q => languageFile.TranslateCategory(q.ToLower())));
            var fullName      = therapist.FullName;
            var gender        = languageFile.TranslateGender(therapist.Gender);
            var website       = therapist.KVNWebsite;
            var languages     = string.Join(",", therapist.Languages.Select(s => languageFile.TranslateLanguage(s.ToLower())));
            var offices       = string.Join(",", therapist.Offices.Select(o => o.GetDescriptionText()));
            var contact       = string.Join(",", therapist.TelefoneNumbers.Select(t => t.ToString().ToLower()));
            var id            = therapist.ID.ToString().ToLower();

            stringBuilder.AppendLine(id);
            stringBuilder.AppendLine(fullName);
            stringBuilder.AppendLine(website);
            stringBuilder.AppendLine(gender);
            stringBuilder.AppendLine(contact);
            stringBuilder.AppendLine(offices);
            stringBuilder.AppendLine(languages);
            stringBuilder.AppendLine(qualification);

            var result = stringBuilder.ToString();

            return(result);
        }
Ejemplo n.º 12
0
        public void LoadCurrentTherapist(int therapistid)
        {
            ReadTherapist TherapistReader = new ReadTherapist();

            therapistCollection = TherapistReader.GetOneTherapist(therapistid);
            Therapist currentTherapist = new Therapist();

            currentTherapist = therapistCollection.Where(x => x.therapistId == therapistid).FirstOrDefault();
            if (currentTherapist != null)
            {
                txtbName.Text     = currentTherapist.therapistName;
                txtbLastName.Text = currentTherapist.therapistLastName;
                txtbAdress.Text   = currentTherapist.therapistAdress;
                txtbFunction.Text = currentTherapist.therapistFunction;
                txtbTel.Text      = currentTherapist.therapistTel;
                txtbMail.Text     = currentTherapist.therapistMail;
                txtbMoreInfo.Text = currentTherapist.therapistMoreInfo;
                currentTherapist.patientsList.Add(currentUser.ToString());
                BitmapImage src = new BitmapImage();
                src.BeginInit();
                src.UriSource   = new Uri(currentTherapist.therapistPic);
                src.CacheOption = BitmapCacheOption.None;
                src.EndInit();
                imgPhoto.Source = src;
            }
        }
Ejemplo n.º 13
0
        private void UpdateTherap(string[] selectedSkills, string[] selectedSalons, Therapist therapistUpdate)
        {
            if (selectedSkills == null)
            {
                therapistUpdate.Skills = new List <Skill>();
                return;
            }

            var selectedCoursesHS = new HashSet <string>(selectedSkills);
            var therapistSkills   = new HashSet <int>
                                        (therapistUpdate.Skills.Select(c => c.SkillId));

            foreach (var skill in _context.Skills)
            {
                if (selectedSkills.Contains(skill.SkillId.ToString()))
                {
                    if (!therapistSkills.Contains(skill.SkillId))
                    {
                        therapistUpdate.Skills.Add(skill);
                    }
                }
                else
                {
                    if (therapistSkills.Contains(skill.SkillId))
                    {
                        therapistUpdate.Skills.Remove(skill);
                    }
                }
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Open therapist window
        /// </summary>
        public void OpenAddTherapistWindow()
        {
            if (_group == null || _group.Length < 1 || _indiv == null | _indiv.Length < 1)
            {
                return;
            }

            var dialog = new Dialog.Dialog();

            dialog.Title        = "Add New Therapist";
            dialog.QuestionText = "Please give a name to the new therapist.";

            if (dialog.ShowDialog() == true)
            {
                try
                {
                    string mKeySetName = dialog.ResponseText;
                    therapistListViewModel.AllTherapists.Add(Therapist.CreateTherapist(mKeySetName));
                    using (StreamWriter file = new StreamWriter(Path.Combine(Properties.Settings.Default.SaveLocation, _group, _indiv, "Therapists.json"), false))
                    {
                        Therapists mCollector = new Therapists();
                        mCollector.PrimaryTherapists = therapistListViewModel.AllTherapists;

                        file.WriteLine(JsonConvert.SerializeObject(mCollector));
                    }
                    MessageBox.Show("Successfully added: " + dialog.ResponseText);
                }
                catch (IOException e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
        }
Ejemplo n.º 15
0
        private void ExtractAbilities(Therapist therapist, HtmlElement htmlElement)
        {
            var innerText           = htmlElement.InnerText;
            var lines               = innerText.SplitByNewLine().Select(s => s.ToLower()).ToArray();
            var fachgebiete         = new List <string>();
            var zusatzbezeihnungen  = new List <string>();
            var besondereKenntnisse = new List <string>();

            var currentList = fachgebiete;

            foreach (var line in lines)
            {
                if (string.Equals(line, "fachgebiet:", StringComparison.InvariantCultureIgnoreCase))
                {
                    currentList = fachgebiete;
                    continue;
                }
                if (string.Equals(line, "zusatzbezeichnung:", StringComparison.InvariantCultureIgnoreCase))
                {
                    currentList = zusatzbezeihnungen;
                    continue;
                }
                if (string.Equals(line, "besondere kenntnisse:", StringComparison.InvariantCultureIgnoreCase))
                {
                    currentList = besondereKenntnisse;
                    continue;
                }
                currentList.Add(line.Trim());
            }
            //therapist.BesondereKenntnisse.AddRange(besondereKenntnisse);
            //therapist.Fachgebiete.AddRange(fachgebiete);
            //therapist.Zusatzbezeichnung.AddRange(zusatzbezeihnungen);
        }
Ejemplo n.º 16
0
        //GET: Edit
        public async Task <IActionResult> Edit(int Id)
        {
            Therapist therapist =
                await _db.Therapist.Include(t => t.TherapyType).Where(t => t.Id == Id).FirstOrDefaultAsync();

            return(View(therapist));
        }
Ejemplo n.º 17
0
 public frm_Krb_Gen( )
 {
     InitializeComponent( );
     generator = new Therapist(  );
     specAccum = new SpecificAccumulator( );
     randAccum = new RandomAccumulator( );
 }
Ejemplo n.º 18
0
        private void ExtractLanguages(Therapist therapist, HtmlElement htmlElement)
        {
            var innerText = htmlElement.InnerText;
            var languages = innerText.SplitByNewLine().Select(s => s.Trim()).Skip(1).Distinct().ToArray();

            therapist.Languages.AddRange(languages);
        }
        public void UpdateTherapist(MassageTherapists person)
        {
            MyTherapistEncryption.SecurityController dataEncryptionAlgo = new SecurityController();
            bool      newrecord       = false;
            Therapist therapistRecord = null;

            try
            {
                var therapistQuery = from therapist in therapistDatabaseContext.Therapists where therapist.Id == person.Id select therapist;
                therapistRecord          = therapistQuery.Single <Therapist>();
                therapistRecord.Name     = dataEncryptionAlgo.EncryptData(person.Name);
                therapistRecord.Password = dataEncryptionAlgo.EncryptData(person.Password);
            }
            catch (Exception ex)
            {
                newrecord = true;
            }

            if (newrecord)
            {
                therapistRecord = new Therapist();

                therapistRecord.Id       = Guid.NewGuid();
                therapistRecord.Name     = dataEncryptionAlgo.EncryptData(person.Name);
                therapistRecord.Password = dataEncryptionAlgo.EncryptData(person.Password);

                therapistDatabaseContext.Therapists.InsertOnSubmit(therapistRecord);
            }

            therapistDatabaseContext.SubmitChanges();
        }
Ejemplo n.º 20
0
 public static void Map(this Therapist dbTherapist, Therapist therapist)
 {
     dbTherapist.UserId    = therapist.UserId;
     dbTherapist.CreatedOn = therapist.CreatedOn;
     dbTherapist.Birthday  = therapist.Birthday;
     dbTherapist.Name      = therapist.Name;
     dbTherapist.Gender    = therapist.Gender;
 }
Ejemplo n.º 21
0
        public Therapist GetTherapistInfo(Therapist therapist)
        {
            var therapistInfo = new Therapist();



            return(therapistInfo);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Therapist therapist = db.Therapists.Find(id);

            db.Therapists.Remove(therapist);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 23
0
 public async Task <List <Patient> > List(Therapist therapist)
 {
     return(await _context
            .Patients
            .Where(p => p.Therapist == therapist)
            .Include(p => p.Therapist)
            .ToListAsync());
 }
Ejemplo n.º 24
0
        //GET: Therapist/Details
        public ActionResult Details(int?id)

        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Therapist therapist = _context.Therapists.Find(id);

            if (therapist == null)
            {
                return(HttpNotFound());
            }


            ViewBag.TherapistId = id.Value;

            var commentContent = _context.Comments.Where(d => d.TherapistId.Equals(id.Value)).ToList();

            ViewBag.CommentContent = commentContent;

            var ratings = _context.Comments.Where(d => d.TherapistId.Equals(id.Value)).ToList();



            if (ratings.Count() > 0)
            {
                var ratingSum = ratings.Sum(d => d.Rating.Value);
                ViewBag.RatingSum = ratingSum;
                var ratingCount = ratings.Count();
                ViewBag.RatingCount   = ratingCount;
                therapist.RatingCount = ratingCount;
                therapist.RatingAvg   = (double)ratingSum / (double)ratingCount;
                _context.SaveChanges();
            }
            else
            {
                ViewBag.RatingSym   = 0;
                ViewBag.RatingCount = 0;
            }

            bool wynik;


            if (CheciIfExist(therapist.TherapistId))
            {
                wynik = true;
            }

            else
            {
                wynik = false;
            }


            ViewBag.WynikMetody = wynik;
            return(View(therapist));
        }
Ejemplo n.º 25
0
        public void DeleteTherapist(int id)
        {
            Therapist th = _therapists.FirstOrDefault(t => t.TherapistId == id);

            if (th != null)
            {
                _therapists.Remove(th);
            }
        }
Ejemplo n.º 26
0
        public ActionResult DeleteConfirmed(int id)
        {
            Therapist therapist = db.Therapists.Find(id);

            db.Therapists.Remove(therapist);
            db.SaveChanges();
            TempData["Message"] = "Successfully deleted, " + therapist.Name;
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 27
0
    private Therapist GetUser()
    {
        Therapist user = new Therapist();

        user.Username = m_userNameField.text;
        user.Password = m_realPassword;

        return(user);
    }
Ejemplo n.º 28
0
        public void EditTherapist(int therapistId, Therapist therapist)
        {
            var foundTherapist = _db.Therapists.FirstOrDefault(o => o.Id == therapistId);

            foundTherapist.Name = therapist.Name;
            //_db.Entry(foundTherapist).State = System.Data.Entity.EntityState.Modified;
            //_db.Therapists.Attach(foundTherapist);
            _db.SaveChanges();
        }
Ejemplo n.º 29
0
        private bool AreEqual(Therapist t1, Therapist t2)
        {
            for (int i = 0; i < t1.Qualifications.Count; i++)
            {
                if (t1.Qualifications[i] != t2.Qualifications[i])
                {
                    return(false);
                }
            }

            if (t1.ID != t2.ID)
            {
                return(false);
            }
            if (t1.FamilyName != t2.FamilyName)
            {
                return(false);
            }
            if (t1.FullName != t2.FullName)
            {
                return(false);
            }
            if (t1.Gender != t2.Gender)
            {
                return(false);
            }
            if (t1.KVNWebsite != t2.KVNWebsite)
            {
                return(false);
            }
            for (int i = 0; i < t1.Languages.Count; i++)
            {
                if (t1.Languages[i] != t2.Languages[i])
                {
                    return(false);
                }
            }

            for (int i = 0; i < t1.Offices.Count; i++)
            {
                if (t1.Offices[i] != t2.Offices[i])
                {
                    return(false);
                }
            }

            for (int i = 0; i < t1.TelefoneNumbers.Count; i++)
            {
                if (t1.TelefoneNumbers[i] != t2.TelefoneNumbers[i])
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 30
0
        protected void SubmitTherapist_Click(object sender, EventArgs e)
        {
            DateTime TerminationDate = DateTime.MaxValue;

            if (txtTerminationDate.Text.Length > 0)
            {
                TerminationDate = DateTime.Parse(txtTerminationDate.Text);
            }
            Therapist therapist = new Therapist {
                FirstName = txtFirstName.Text,
                LastName= txtLastName.Text,
                Gender = drpGender.SelectedValue,
                TaxNumber = txtTaxNumber.Text,
                Qualification = txtQualification.Text,
                LicenceNumber = txtLicenceNumber.Text,
                HiringDate = DateTime.Parse(txtHiringDate.Text),
                TerminationDate = TerminationDate,
                EmailAddress = txtEmailAddress.Text,
                Bio = FreeTextBox3.Text,
                MiddleInitial = txtMiddleInitial.Text,
                PictureURL = lblPictureURL.Text,
                NPINumber = txtNPINumber.Text,
                SpecialisedTraining = drpSpecialisedTraining.SelectedValue,
                Password = txtPassword.Text,
                PhoneNumber = txtPhone.Text,
                PhoneType = drpPhoneTypes.SelectedValue,
                DateOfBirth = DateTime.Parse(txtDateOfBirth.Text),
                Title = drpTitle.SelectedValue,
                Active = chkActive.Enabled

            };
            try
            {
                int status = controller.Portal_SaveTherapist(therapist, HttpContext.Current.Session["email"].ToString());

                if (status == 1)
                {
                    //email exists
                    Helper.DisplayAlert(this, "therapist with the entered email already exists!, record was not saved.");
                }

                if (status == 0)
                {
                    //success
                    var redirectPage = ConfigurationManager.AppSettings["TherapistsPage"];
                    Helper.DisplayAlert(this, "therapist saved successfully.");
                    Helper.RegisterStartupScript(this, redirectPage);

                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 31
0
        public IEnumerable <OpeningTimes> GetOpeningTimesForTherapist(int id)
        {
            Therapist ther = _dbContext.Therapist.Where(t => t.TherapistId == id).Include(t => t.OpeningTimes).FirstOrDefault();

            if (ther == null)
            {
                return(null);
            }
            return(ther.OpeningTimes.ToList());
        }
Ejemplo n.º 32
0
    public List<Therapist> GetTherapists()
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "GetTherapists";

        List<Therapist> therapists = new List<Therapist>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            Therapist therapist = new Therapist
            {
                ID = Int64.Parse(dr["ID"].ToString()),
                Guid = Guid.Parse(dr["Guid"].ToString()),
                Name = dr["Name"].ToString(),
                FirstName = dr["FirstName"].ToString(),
                LastName = dr["LastName"].ToString(),
                Gender = dr["Gender"].ToString(),
                TaxNumber = dr["TaxNumber"].ToString(),
                Qualification = dr["Qualification"].ToString(),
                LicenceNumber = dr["LicenceNumber"].ToString(),
                HiringDate = Convert.ToDateTime(dr["HiringDate"].ToString()),
                TerminationDate = Convert.ToDateTime(dr["TerminationDate"].ToString()),
                EmailAddress = dr["EmailAddress"].ToString(),
                Title = dr["Title"].ToString(),
                Bio = dr["Bio"].ToString(),
                MiddleInitial = dr["MiddleInitial"].ToString(),
                PictureURL = dr["PictureURL"].ToString(),
                Sort = Int32.Parse(dr["Sort"].ToString()),
                DateCreated = Convert.ToDateTime(dr["DateCreated"].ToString())

            };

            therapists.Add(therapist);

        }

        return therapists;
    }
Ejemplo n.º 33
0
    public int Portal_SaveTherapist(Therapist therapist, string LoggedInUserEmail)
    {
        dl = new DataLayer();
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_SaveTherapist";

        cmd.Parameters.AddWithValue("@FirstName", therapist.FirstName);
        cmd.Parameters.AddWithValue("@LastName", therapist.LastName);
        cmd.Parameters.AddWithValue("@Gender", therapist.Gender);
        cmd.Parameters.AddWithValue("@TaxNumber", therapist.TaxNumber);
        cmd.Parameters.AddWithValue("@Qualification", therapist.Qualification);
        cmd.Parameters.AddWithValue("@LicenseNumber", therapist.LicenceNumber);
        cmd.Parameters.AddWithValue("@HiringDate", therapist.HiringDate);
        cmd.Parameters.AddWithValue("@TerminationDate", therapist.TerminationDate);
        cmd.Parameters.AddWithValue("@EmailAddress", therapist.EmailAddress);
        cmd.Parameters.AddWithValue("@Title", therapist.Title);
        cmd.Parameters.AddWithValue("@Bio", therapist.Bio);
        cmd.Parameters.AddWithValue("@MiddleInitial", therapist.MiddleInitial);
        cmd.Parameters.AddWithValue("@PictureURL", therapist.PictureURL);
        cmd.Parameters.AddWithValue("@NPINumber", therapist.NPINumber);
        cmd.Parameters.AddWithValue("@SpecialisedTraining", therapist.SpecialisedTraining);
        cmd.Parameters.AddWithValue("@Password", therapist.Password);
        cmd.Parameters.AddWithValue("@PhoneNUmber", therapist.PhoneNumber);
        cmd.Parameters.AddWithValue("@PhoneType", therapist.PhoneType);
        cmd.Parameters.AddWithValue("@DateofBirth", therapist.DateOfBirth);
        cmd.Parameters.AddWithValue("@Active", therapist.Active);
        cmd.Parameters.AddWithValue("@SavedBy", LoggedInUserEmail);

        DataTable dt = dl.Execute(cmd);

        DataRow dr = dt.Rows[0];

        return Int32.Parse(dr["RET"].ToString());
    }
Ejemplo n.º 34
0
 public void UpdateTherapist(Therapist new_therapist, Facility fac, string password, Text message, Button submit_button)
 {
     new_therapist.id = helper.current_therapist.id;
     helper.UpdateTherapist(new_therapist, fac, password);
     ScreenMessage = message;
     active = true;
     button = submit_button;
 }
Ejemplo n.º 35
0
 public void RegisterTherapist(Therapist new_therapist, Facility fac, string password, Text message, Button submit_button)
 {
     helper.RegisterTherapist(new_therapist, fac, password);
     ScreenMessage = message;
     active = true;
     button = submit_button;
 }