Пример #1
0
        public int UpdateBrokeragePayment(BO.SaleBrokerageBO brokerage)
        {
            int _ID;

            try
            {
                DatabaseAccess.OpenConnection(true);
                var _ourParams = DatabaseAccess.ExecuteProcedureDML("P_Sale_BrokeragePayment", new List <DAL.DatabaseParameter>()
                {
                    new DAL.DatabaseParameter("@BDID", DAL.ParameterDirection.In, DAL.DataType.Int, brokerage.BDID),
                    new DAL.DatabaseParameter("@PayDate", DAL.ParameterDirection.In, DAL.DataType.Date, brokerage.PayDate),
                    new DAL.DatabaseParameter("@PayComments", DAL.ParameterDirection.In, DAL.DataType.String, brokerage.PayComments, 1000)
                });
                DatabaseAccess.CommitTransaction();
                _ID        = brokerage.BDID;
                _ourParams = null;
            }
            catch
            {
                DatabaseAccess.RollbackTransaction();
                throw;
            }
            finally
            {
                DatabaseAccess.CloseConnection();
            }
            return(_ID);
        }
Пример #2
0
        public int AddBrokerage(BO.SaleBrokerageBO brokerage)
        {
            int _ID;

            try
            {
                DatabaseAccess.OpenConnection(true);
                var _ourParams = DatabaseAccess.ExecuteProcedureDML("P_Sale_AddBrokerage", new List <DAL.DatabaseParameter>()
                {
                    new DAL.DatabaseParameter("@BDID", DAL.ParameterDirection.InOut, DAL.DataType.Int, brokerage.BDID),
                    new DAL.DatabaseParameter("@SaleID", DAL.ParameterDirection.In, DAL.DataType.Int, brokerage.SaleID),
                    new DAL.DatabaseParameter("@BrokerID", DAL.ParameterDirection.In, DAL.DataType.Int, brokerage.BrokerID),
                    new DAL.DatabaseParameter("@Brokerage", DAL.ParameterDirection.In, DAL.DataType.Decimal, brokerage.Brokerage)
                });
                DatabaseAccess.CommitTransaction();
                _ID        = Convert.ToInt32(_ourParams["@BDID"]);
                _ourParams = null;
            }
            catch
            {
                DatabaseAccess.RollbackTransaction();
                throw;
            }
            finally
            {
                DatabaseAccess.CloseConnection();
            }
            return(_ID);
        }