public trn_basic_measure_hdr getBasicHdr(string hn, string en) { string rvisual_out_lens = null; string lvisual_out_lens = null; string rvisual_with_lens = null; string lvisual_with_lens = null; DateTime dateNow = Program.GetServerDateTime(); using (Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls()) { DataSet ds = ws.GetvitalSign(en); if (ds != null) { if (ds.Tables.Count > 0) { string WithContactLens = ds.Tables[0].Rows[0]["WithContactLens"] == null ? "" : ds.Tables[0].Rows[0]["WithContactLens"].ToString(); if (WithContactLens == "N") { rvisual_out_lens = ds.Tables[0].Rows[0]["VisionRt"].ToString(); lvisual_out_lens = ds.Tables[0].Rows[0]["VisionLt"].ToString(); } else if (WithContactLens == "Y") { rvisual_with_lens = ds.Tables[0].Rows[0]["VisionRt"].ToString(); lvisual_with_lens = ds.Tables[0].Rows[0]["VisionLt"].ToString(); } } } } trn_basic_measure_hdr tbm = new trn_basic_measure_hdr { tbm_appearance = "GD", tbm_arrive = "WK", tbm_create_by = "System", tbm_create_date = dateNow, tbm_precaution = "SDP", tbm_purpose = 'W', tbm_triage = '5', tbm_type = 'N', tbm_update_by = "System", tbm_update_date = dateNow, tbm_vision_lvisual_out_lens = lvisual_out_lens, tbm_vision_lvisual_with_lens = lvisual_with_lens, tbm_vision_rvisual_out_lens = rvisual_out_lens, tbm_vision_rvisual_with_lens = rvisual_with_lens }; tbm.trn_basic_measure_dtls.AddRange(getVitalSign(hn, en)); return(tbm); }