예제 #1
0
        public Physician(string clientId)
        {
            this.ClientId = clientId;

            this.IsAcceptingNewPatients = false;
            this.IsActive = false;

            this.Locations = new List <Location>();

            this.Specialties            = new TaxonomyFacet("Specialties");
            this.Subspecialties         = new TaxonomyFacet("Subspecialties");
            this.ProfessionalTitles     = new TaxonomyFacet("Professional Titles");
            this.Affiliations           = new TaxonomyFacet("Affiliations");
            this.Languages              = new TaxonomyFacet("Languages");
            this.PatientTimeframe       = new TaxonomyFacet("Patient Timeframe");
            this.SocietyMemberships     = new TaxonomyFacet("Society Memberships");
            this.Regions                = new TaxonomyFacet("Regions");
            this.ProviderType           = new TaxonomyFacet("Provider Type");
            this.AreasOfInterest        = new TaxonomyFacet("Areas of Interest");
            this.PromotionalDesignation = new TaxonomyFacet("Promotional Designations");
            this.ServiceLine            = new TaxonomyFacet("Service Line");

            this.ClinicalInterests               = new CustomDetail("Clinical Interests");
            this.SpecialFocus                    = new CustomDetail("Special Focus");
            this.BoardCertifications             = new CustomDetail("Board Certifications", CustomDetailContentStyle.BulletedList);
            this.ProfessionalMemberships         = new CustomDetail("Professional Memberships", CustomDetailContentStyle.BulletedList);
            this.TeachingOrProfessionalPositions = new CustomDetail("Teaching or Professional Positions", CustomDetailContentStyle.BulletedList);
            this.HonorsAwards                    = new CustomDetail("Honors, Awards, etc.", CustomDetailContentStyle.BulletedList);

            this.MedicalSchool       = new EducationBackground("Medical School");
            this.Residency           = new EducationBackground("Residency");
            this.Fellowship          = new EducationBackground("Fellowship");
            this.Masters             = new EducationBackground("Masters");
            this.DentalSchool        = new EducationBackground("Dental School");
            this.GradSchool          = new EducationBackground("Graduate School");
            this.NursingSchool       = new EducationBackground("Nursing School");
            this.Undergrad           = new EducationBackground("Undergraduate");
            this.TravelingFellowship = new EducationBackground("Traveling Fellowship");
            this.Internships         = new EducationBackground("Internships");
        }
 public void UpdateBackground(EducationBackground educationBackground)
 {
     educationBackgroundRepository.Update(educationBackground);
     SaveEducationBackground();
 }
 public void Delete(EducationBackground educationBackground)
 {
     educationBackgroundRepository.Delete(educationBackground);
     SaveEducationBackground();
 }
 public void CreateEducationBackground(EducationBackground educationBackground)
 {
     educationBackgroundRepository.Add(educationBackground);
     SaveEducationBackground();
 }
예제 #5
0
        private String AddExpert()
        {
            context.Response.ContentType = "text/plain";
            DataClassesDataContext dc = new DataClassesDataContext();
            bool insert  = false;
            User newUser = dc.User.SingleOrDefault(user => user.F_ID.Equals(paras["F_ID"]));

            if (newUser == null)
            {
                newUser        = new User();
                newUser.F_Role = RoleType.Expert;
                newUser.F_ID   = paras["F_ID"];
                insert         = true;
            }
            newUser.F_userName         = paras["F_userName"];
            newUser.F_realName         = paras["F_realName"];
            newUser.F_sexual           = paras["F_sexual"];
            newUser.F_idType           = paras["F_idType"];
            newUser.F_nationality      = paras["F_nationality"];
            newUser.F_highestDegree    = paras["F_highestDegree"];
            newUser.F_highestEducation = paras["F_highestEducation"];
            newUser.F_idNumber         = paras["F_idNumber"];
            if (String.IsNullOrWhiteSpace(newUser.F_idNumber) == false)
            {
                User t = dc.User.SingleOrDefault(_user => _user.F_idType.Equals(newUser.F_idType) && _user.F_idNumber.Equals(newUser.F_idNumber));
                if (t != null && t.F_ID.Equals(newUser.F_ID) == false)
                {
                    return("系统中已存在相同的证件号和证件名");
                }
            }
            DateTime dt = DateTime.Now;

            if (String.IsNullOrEmpty(paras["F_birthday"]) == false)
            {
                newUser.F_birthday = DateTime.Parse(paras["F_birthday"]);
            }
            newUser.F_workspace           = paras["F_workspace"];
            newUser.F_phone               = paras["F_phone"];
            newUser.F_workDept            = paras["F_workDept"];
            newUser.F_legalCode           = paras["F_legalCode"];
            newUser.F_phone2              = paras["F_phone2"];
            newUser.F_position            = paras["F_position"];
            newUser.F_title               = paras["F_title"];
            newUser.F_email               = paras["F_email"];
            newUser.F_mobile              = paras["F_mobile"];
            newUser.F_adminUnit           = paras["F_adminUnit"];
            newUser.F_email2              = paras["F_email2"];
            newUser.F_fax                 = paras["F_fax"];
            newUser.F_freeAddress         = paras["F_freeAddress"];
            newUser.F_freeZipCode         = paras["F_freeZipCode"];
            newUser.F_mostFamiliarSubject = paras["F_mostFamiliarSubject"];
            newUser.F_academicDuty        = paras["F_academicDuty"];
            if (!String.IsNullOrWhiteSpace(paras["F_familiarSubject"]))
            {
                String[] subjects = paras["F_familiarSubject"].Split(new char[] { ',' });
                if (subjects.Length >= 1)
                {
                    newUser.F_familiarSubject1 = subjects[0];
                }
                if (subjects.Length == 2)
                {
                    newUser.F_familiarSubject2 = subjects[1];
                }
            }

            var educationBackgrounds = dc.EducationBackground.Where(eb => eb.F_userID.Equals(newUser.F_ID));

            dc.EducationBackground.DeleteAllOnSubmit(educationBackgrounds);

            if (!String.IsNullOrWhiteSpace(paras["F_school"]))
            {
                String[] schools       = paras["F_school"].Split(new char[] { ',' });
                String[] majors        = paras["F_major"].Split(new char[] { ',' });
                String[] entryDates    = paras["F_entryDate"].Split(new char[] { ',' });
                String[] educations    = paras["F_education"].Split(new char[] { ',' });
                String[] degrees       = paras["F_degree"].Split(new char[] { ',' });
                String[] graduateDates = paras["F_graduateDate"].Split(new char[] { ',' });
                String[] countrys      = paras["F_country"].Split(new char[] { ',' });
                for (int i = 0; i < schools.Length; i++)
                {
                    EducationBackground eb = new EducationBackground();
                    eb.F_userID = newUser.F_ID;
                    eb.F_ID     = Guid.NewGuid().ToString();
                    eb.F_school = schools[i];
                    eb.F_major  = majors[i];
                    dt          = DateTime.Now;
                    if (entryDates[i].Trim().Length > 0)
                    {
                        DateTime.TryParse(entryDates[i], out dt);
                        eb.F_entryDate = dt;
                    }
                    if (graduateDates[i].Trim().Length > 0)
                    {
                        DateTime.TryParse(graduateDates[i], out dt);
                        eb.F_graduateDate = dt;
                    }
                    eb.F_education = educations[i];
                    eb.F_degree    = degrees[i];
                    eb.F_country   = countrys[i];
                    dc.EducationBackground.InsertOnSubmit(eb);
                }
            }

            var certificates = dc.Certificate.Where(cert => cert.F_userID.Equals(newUser.F_ID));

            dc.Certificate.DeleteAllOnSubmit(certificates);

            if (!String.IsNullOrWhiteSpace(paras["F_name"]))
            {
                String[] F_names      = paras["F_name"].Split(new char[] { ',' });
                String[] F_codes      = paras["F_code"].Split(new char[] { ',' });
                String[] F_grantDates = paras["F_grantDate"].Split(new char[] { ',' });
                String[] F_grantOrgs  = paras["F_grantOrg"].Split(new char[] { ',' });
                for (int i = 0; i < F_names.Length; i++)
                {
                    Certificate cert = new Certificate();
                    cert.F_ID     = Guid.NewGuid().ToString();
                    cert.F_userID = newUser.F_ID;
                    cert.F_name   = F_names[i];
                    cert.F_code   = F_codes[i];
                    if (F_grantDates[i].Trim().Length > 0)
                    {
                        DateTime.TryParse(F_grantDates[i], out dt);
                        cert.F_grantDate = dt;
                    }
                    cert.F_grantOrg = F_grantOrgs[i];
                    dc.Certificate.InsertOnSubmit(cert);
                }
            }

            if (insert)
            {
                dc.User.InsertOnSubmit(newUser);
            }
            dc.SubmitChanges();
            return("保存成功");
        }