Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
        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);
            }
        }