예제 #1
0
        private void LoadUserDetails(string userIdQs)
        {
            BLL.PatientDetailsBll bll          = new BLL.PatientDetailsBll();
            UserProfile           oUserProfile = new UserProfile();

            oUserProfile.Id = Convert.ToInt32(userIdQs);
            DataTable userInfoDt = bll.GetUserInfo(oUserProfile);

            if (userInfoDt.Rows.Count > 0)
            {
                lblUserId.Text     = userInfoDt.Rows[0]["user_id"].ToString();
                txtName.Text       = userInfoDt.Rows[0]["name"].ToString();
                txtFatherName.Text = userInfoDt.Rows[0]["father_name"].ToString();
                txtMobileNo.Text   = userInfoDt.Rows[0]["cell_phone"].ToString();
                string birthDate = userInfoDt.Rows[0]["birth_date"].ToString();

                string getAge = new AgeCalculator().GetAge(birthDate);
                txtBirthDate.Text = getAge;

                txtAddress.Text = userInfoDt.Rows[0]["address"].ToString();
                int    gender          = Convert.ToInt32(userInfoDt.Rows[0]["gender"]);
                string convertedGender = new GenderConverter().GetGender(gender);
                txtGender.Text = convertedGender;
            }
        }
예제 #2
0
        public void WriteJsonExceptionWithNullWriterAndInvalidValue()
        {
            // Arrange
            var gc = new GenderConverter();

            // Act
            gc.WriteJson(null, "abc", null);
        }
예제 #3
0
        public void CanConvertReturnsFalse()
        {
            // Arrange
            var gc = new GenderConverter();

            // Assert
            Assert.IsFalse(gc.CanConvert(typeof(string)));
        }
예제 #4
0
        public void WriteJsonExceptionWithNullWriterAndValidValue()
        {
            // Arragne
            var gc = new GenderConverter();

            // Act
            gc.WriteJson(null, OwnerGender.Female, null);
        }
예제 #5
0
        public void CanConvertReturnsTrue()
        {
            // Arrange
            var gc = new GenderConverter();

            // Assert
            Assert.IsTrue(gc.CanConvert(typeof(OwnerGender)));
        }
예제 #6
0
        public void ReadJsonExceptionWithNullReader()
        {
            // Arrange
            var gc = new GenderConverter();

            // Act
            gc.ReadJson(null, typeof(OwnerGender), OwnerGender.Male, null);
        }
예제 #7
0
        /// <summary>Creates an instance for the default language.</summary>
        /// <returns>A repository.</returns>
        public override ICharacterRepository ForDefaultCulture()
        {
            var genderConverter              = new GenderConverter();
            var professionConverter          = new ProfesionConverter();
            var raceConverter                = new RaceConverter();
            var characterConverter           = new CharacterConverter(genderConverter, professionConverter, raceConverter);
            var identifiersResponseConverter = new ResponseConverter <ICollection <string>, ICollection <string> >(new ConverterAdapter <ICollection <string> >());
            var responseConverter            = new ResponseConverter <CharacterDTO, Character>(characterConverter);
            var bulkResponseConverter        = new DictionaryRangeResponseConverter <CharacterDTO, string, Character>(characterConverter, c => c.Name);
            var pageResponseConverter        = new CollectionPageResponseConverter <CharacterDTO, Character>(characterConverter);

            return(new CharacterRepository(this.serviceClient, identifiersResponseConverter, responseConverter, bulkResponseConverter, pageResponseConverter));
        }
예제 #8
0
        public void WriteJsonExceptionWithValidWriterAndInvalidValue()
        {
            // Arrange
            var gc = new GenderConverter();

            // Act
            using (var wrt = new StringWriter())
            {
                using (var jw = new JsonTextWriter(wrt))
                {
                    gc.WriteJson(jw, "abc", null);
                }
            }
        }
예제 #9
0
        public void WriteJsonSuccessWithValidWriterAndValidValue()
        {
            // Arrange
            var gc = new GenderConverter();

            // Act
            using (var wrt = new StringWriter())
            {
                using (var jw = new JsonTextWriter(wrt))
                {
                    gc.WriteJson(jw, OwnerGender.Male, null);
                }
            }
        }
        public virtual Teacher Convert(KLehrer source)
        {
            if (source == null)
            {
                return(null);
            }

            return(new Teacher
            {
                Id = source.Id,
                Acronym = source.Kuerzel,
                Firstname = source.Vorname,
                Lastname = source.Nachname,
                Title = source.Titel,
                Gender = GenderConverter.Convert(source.Geschlecht),
                Email = source.EmailDienstlich,
                SectionData = source.Abschnittsdaten?.Select(x => TeacherDataConverter.Convert(x)).ToArray(),
                IsVisible = sichtbarBooleanConverter.Convert(source.Sichtbar)
            });
        }
예제 #11
0
        private void LoadPrescriptionInfo(string appointId)
        {
            BLL.PrescriptionFormBll bll = new BLL.PrescriptionFormBll();
            DataTable patientDt         = bll.GetPatientInfo(appointId);
            int       countRows         = patientDt.Rows.Count;

            if (countRows > 0)
            {
                string patientSerial = Request.QueryString["srlNo"];
                lblSerialNo.Text = patientSerial;
                //lblAppointNo.Text = patientDt.Rows[0]["name"].ToString();
                lblAppointNo.Text   = patientDt.Rows[0]["appointment_id"].ToString();
                lblPatientName.Text = patientDt.Rows[0]["name"].ToString();
                string birthDate = patientDt.Rows[0]["birth_date"].ToString();
                string getAge    = new AgeCalculator().GetAge(birthDate);
                lblPatientAge.Text = getAge;
                int    gender          = Convert.ToInt32(patientDt.Rows[0]["gender"]);
                string convertedGender = new GenderConverter().GetGender(gender);
                lblGender.Text    = convertedGender;
                lblTodayDate.Text = DateTime.Now.ToString("dd-MM-yyyy");
            }
        }
예제 #12
0
 public Person(string firstName, string lastName, string gender)
 {
     FirstName = firstName;
     LastName  = lastName;
     Gender    = GenderConverter.FromString(gender);
 }