private void initConfig() { lFpn = new List <FNation>(); fpn = new FNation(); fpn.f_patient_nation_id = "f_patient_nation_id"; fpn.patient_nation_description = "patient_nation_description"; fpn.active = "active"; fpn.pkField = "f_patient_nation_id"; fpn.table = "f_patient_nation"; }
public FNation selectByPk1(String copId) { FNation cop1 = new FNation(); DataTable dt = new DataTable(); String sql = "select fpn.* " + "From " + fpn.table + " fpn " + //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " + "Where fpn." + fpn.pkField + " ='" + copId + "' "; dt = conn.selectData(conn.conn, sql); cop1 = setNation(dt); return(cop1); }
public void getlFNation() { //lDept = new List<Position>(); lFpn.Clear(); DataTable dt = new DataTable(); dt = selectAll(); foreach (DataRow row in dt.Rows) { FNation itm1 = new FNation(); itm1.f_patient_nation_id = row[fpn.f_patient_nation_id].ToString(); itm1.patient_nation_description = row[fpn.patient_nation_description].ToString(); lFpn.Add(itm1); } }
private FNation setNation(DataTable dt) { FNation dept1 = new FNation(); if (dt.Rows.Count > 0) { dept1.f_patient_nation_id = dt.Rows[0][fpn.f_patient_nation_id].ToString(); dept1.patient_nation_description = dt.Rows[0][fpn.patient_nation_description].ToString(); } else { dept1.f_patient_nation_id = ""; dept1.patient_nation_description = ""; } return(dept1); }