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; } }
public void WriteJsonExceptionWithNullWriterAndInvalidValue() { // Arrange var gc = new GenderConverter(); // Act gc.WriteJson(null, "abc", null); }
public void CanConvertReturnsFalse() { // Arrange var gc = new GenderConverter(); // Assert Assert.IsFalse(gc.CanConvert(typeof(string))); }
public void WriteJsonExceptionWithNullWriterAndValidValue() { // Arragne var gc = new GenderConverter(); // Act gc.WriteJson(null, OwnerGender.Female, null); }
public void CanConvertReturnsTrue() { // Arrange var gc = new GenderConverter(); // Assert Assert.IsTrue(gc.CanConvert(typeof(OwnerGender))); }
public void ReadJsonExceptionWithNullReader() { // Arrange var gc = new GenderConverter(); // Act gc.ReadJson(null, typeof(OwnerGender), OwnerGender.Male, null); }
/// <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)); }
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); } } }
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) }); }
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"); } }
public Person(string firstName, string lastName, string gender) { FirstName = firstName; LastName = lastName; Gender = GenderConverter.FromString(gender); }