Ejemplo n.º 1
0
        public bool FeeUpdateByID(DataFees fees)
        {
            bool noError = true;

            try
            {
                using (SqlConnection connection = new SqlConnection(ConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("dbo.sp_FeeUpdateByID", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;

                        command.Parameters.AddWithValue("@Tax", fees.Tax);
                        command.Parameters.AddWithValue("@ShippingFee", fees.ShippingFee);
                        command.Parameters.AddWithValue("@Active", fees.Active);

                        connection.Open();
                    }
                }
            }
            catch (Exception exception)
            {
                Logger.LogError(exception);
            }

            return(noError);
        }
Ejemplo n.º 2
0
        public DataFees FeeGetByID(int FeeID)
        {
            DataFees dFee = new DataFees();

            try
            {
                using (SqlConnection connection = new SqlConnection(ConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("dbo.sp_FeeGetByID", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.AddWithValue("@FeeID", FeeID);
                        connection.Open();
                        SqlDataReader reader = command.ExecuteReader();

                        while (reader.Read())
                        {
                            dFee.FeeID            = reader.GetInt32(0);
                            dFee.Tax              = reader.GetDecimal(1);
                            dFee.ShippingFee      = reader.GetDecimal(2);
                            dFee.RateCreationDate = reader.GetDateTime(3);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Logger.LogError(exception);
            }

            return(dFee);
        }
Ejemplo n.º 3
0
        public ModelFees Map(DataFees dFee)
        {
            ModelFees mFee = new ModelFees();

            mFee.FeeID            = dFee.FeeID;
            mFee.Tax              = dFee.ShippingFee;
            mFee.ShippingFee      = dFee.ShippingFee;
            mFee.RateCreationDate = dFee.RateCreationDate;
            mFee.Active           = dFee.Active;

            return(mFee);
        }
Ejemplo n.º 4
0
        public DataFees Map(ModelFees mFee)
        {
            DataFees dFee = new DataFees();

            dFee.FeeID            = mFee.FeeID;
            dFee.Tax              = mFee.ShippingFee;
            dFee.ShippingFee      = mFee.ShippingFee;
            dFee.RateCreationDate = mFee.RateCreationDate;
            dFee.Active           = mFee.Active;

            return(dFee);
        }
Ejemplo n.º 5
0
        public List <DataFees> FeeGetAll()
        {
            List <DataFees> dFees = new List <DataFees>();

            try
            {
                using (SqlConnection connection = new SqlConnection(ConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("dbo.sp_FeesGetAll", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;

                        connection.Open();
                        SqlDataReader reader = command.ExecuteReader();

                        while (reader.Read())
                        {
                            DataFees dFee = new DataFees();

                            dFee.FeeID            = reader.GetInt32(0);
                            dFee.Tax              = reader.GetDecimal(1);
                            dFee.ShippingFee      = reader.GetDecimal(2);
                            dFee.RateCreationDate = reader.GetDateTime(3);

                            dFees.Add(dFee);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Logger.LogError(exception);
            }

            return(dFees);
        }