public List<ServiceCharge> GetAllServiceCharge() { List<ServiceCharge> list = new List<ServiceCharge>(); using (SqlCommand cmd = GetCommand("getAllServiceCharge", CommandType.StoredProcedure)) { ServiceCharge serviceCharge = new ServiceCharge(); using (SqlDataReader dr = ExeDataReader(cmd)) { if (dr.HasRows) { while (dr.Read()) { list.Add(serviceCharge.ServiceChargeIDatareader(dr)); } } } serviceCharge = null; } return list; }
public List<ServiceCharge> GetServiceChargeByID(string id) { List<ServiceCharge> list = new List<ServiceCharge>(); using (SqlCommand cmd = GetCommand("getServiceChargeByID", CommandType.StoredProcedure)) { AddParameter(cmd, "@ID", Convert.ToInt32(id)); ServiceCharge serviceCharge = new ServiceCharge(); using (SqlDataReader dr = ExeDataReader(cmd)) { if (dr.HasRows) { while (dr.Read()) { list.Add(serviceCharge.ServiceChargeIDatareader(dr)); } } } serviceCharge = null; } return list; }