private static GynCases MapGynCase(IDataReader reader) { GynCases item = new GynCases(); Hospitals hosp = new Hospitals(); GynCategories cat = new GynCategories(); int startingIndex = 0; item.Id = reader.GetSafeInt32(startingIndex++); item.PatientID = reader.GetSafeString(startingIndex++); item.Age = reader.GetSafeInt32(startingIndex++); item.Gravity = reader.GetSafeInt32(startingIndex++); item.Parity = reader.GetSafeInt32(startingIndex++); item.Admission = reader.GetSafeString(startingIndex++); item.Treatment = reader.GetSafeString(startingIndex++); item.SurgicalPath = reader.GetSafeString(startingIndex++); cat.Id = reader.GetSafeInt32(startingIndex++); cat.Category = reader.GetSafeString(startingIndex++); hosp.Id = reader.GetSafeInt32(startingIndex++); hosp.Name = reader.GetSafeString(startingIndex++); item.DaysInHospital = reader.GetSafeInt32(startingIndex++); item.DateAdded = reader.GetSafeDateTime(startingIndex++); item.DateModified = reader.GetSafeDateTime(startingIndex++); item.Hospital = hosp; item.Complication = cat; return(item); }
public static GynCases GetGynCase(int id) { GynCases item = null; DataProvider.ExecuteCmd(GetConnection, "dbo.GynCases_SelectById", inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@Id", id); }, map : delegate(IDataReader reader, short set) { item = MapGynCase(reader); }); return(item); }
public static List <GynCases> GetGynCaseList() { List <GynCases> list = null; DataProvider.ExecuteCmd(GetConnection, "dbo.GynCases_SelectAll", inputParamMapper : null, map : delegate(IDataReader reader, short set) { GynCases item = MapGynCase(reader); if (list == null) { list = new List <GynCases>(); } list.Add(item); }); return(list); }
public static List <GynCases> GetGynCaseByHospital(int hospitalId) { List <GynCases> list = null; DataProvider.ExecuteCmd(GetConnection, "dbo.GynCases_SelectByHospitalID", inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@HospitalID", hospitalId); }, map : delegate(IDataReader reader, short set) { GynCases item = MapGynCase(reader); if (list == null) { list = new List <GynCases>(); } list.Add(item); //list = MapGynCase(reader); }); return(list); }