public List <WeightTicket> GetWeightTicketsAvailablesToSettleFullDetails(int cicleId, int producerId) { List <WeightTicket> tickets = new List <WeightTicket>(); using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConnectionString; command.Connection = connection; command.CommandText = "spGetWeightTicketsAvailablesToSettle"; command.Parameters.Add("@CicleId", SqlDbType.Int).Value = cicleId; command.Parameters.Add("@ProducerId", SqlDbType.Int).Value = producerId; command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataReader reader = command.ExecuteReader(); excludedPropertiesInReader.Remove("ProductName"); tickets = DataReaderMapper.Map <WeightTicket>(reader, excludedPropertiesInReader); excludedPropertiesInReader.Add("ProductName"); reader.Close(); connection.Close(); } return(tickets); } }
public List <SelectableModel> GetBasicModels() { List <SelectableModel> saleCustomers = new List <SelectableModel>(); using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConnectionString; command.Connection = connection; command.CommandText = "spGetSaleCustomerSelectableModels"; command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataReader reader = command.ExecuteReader(); saleCustomers = DataReaderMapper.Map <SelectableModel>(reader); reader.Close(); connection.Close(); } return(saleCustomers); } }
public List <SelectableModel> GetPresentations() { List <SelectableModel> presentations = new List <SelectableModel>(); using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConnectionString; command.Connection = connection; command.CommandText = "spGetPresentations"; command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataReader reader = command.ExecuteReader(); presentations = DataReaderMapper.Map <SelectableModel>(reader); reader.Close(); connection.Close(); } return(presentations); } }
public List <WeightTicket> GetWeightTicket(int?id = null) { List <WeightTicket> tickets = new List <WeightTicket>(); using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConnectionString; command.Connection = connection; command.CommandText = "spGetWeightTicket"; command.Parameters.Add("@Id", SqlDbType.Int).Value = id; command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataReader reader = command.ExecuteReader(); tickets = DataReaderMapper.Map <WeightTicket>(reader, excludedPropertiesInReader); reader.Close(); connection.Close(); } return(tickets); } }
public List <SaleCustomer> GetSaleCustomer(int?id = null) { List <SaleCustomer> producers = new List <SaleCustomer>(); using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConnectionString; command.Connection = connection; command.CommandText = "spGetSaleCustomer"; command.Parameters.Add("@Id", SqlDbType.Int).Value = id; command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataReader reader = command.ExecuteReader(); producers = DataReaderMapper.Map <SaleCustomer>(reader); reader.Close(); connection.Close(); } return(producers); } }
public List <WareHouse> GetWareHouse(int?id = null) { List <WareHouse> wareHouses = new List <WareHouse>(); using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConnectionString; command.Connection = connection; command.CommandText = "spWareHouse"; command.Parameters.Add("@Id", SqlDbType.Int).Value = id; command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataReader reader = command.ExecuteReader(); wareHouses = DataReaderMapper.Map <WareHouse>(reader); reader.Close(); connection.Close(); } return(wareHouses); } }
public List <SelectableModel> GetProductByProductGroupId(WeightTicketType type) { List <SelectableModel> products = new List <SelectableModel>(); using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConnectionString; command.Connection = connection; command.CommandText = "spGetWeightTicketProducts"; command.Parameters.Add("@WeightTicketType", SqlDbType.Int).Value = (int)type; command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataReader reader = command.ExecuteReader(); products = DataReaderMapper.Map <SelectableModel>(reader); reader.Close(); connection.Close(); } return(products); } }
public List <SettlementPayment> GetSettlementPayments(int settlementId) { List <SettlementPayment> payments = new List <SettlementPayment>(); using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConnectionString; command.Connection = connection; command.CommandText = "spGetSettlementPayments"; command.Parameters.Add("@SettlementId", SqlDbType.Int).Value = settlementId; command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataReader reader = command.ExecuteReader(); payments = DataReaderMapper.Map <SettlementPayment>(reader, excludedPropertiesInReader); reader.Close(); connection.Close(); } return(payments); } }