public static int AddDebtorGroup(tDebtorGroup debtorGroup)
 {
     try
     {
         return AccountingDataProvider.AddDebtorGroup(debtorGroup);
     }
     catch (Exception exception)
     {
         throw new Exception(exception.Message);
     }
 }
        public static int UpdateDebtorGroup(tDebtorGroup debtorGroup)
        {
            int rowsAdded;

            using (IDbConnection connection = DbConnectionHelper.GetConnection())
            {
                var query =
                    new StringBuilder(
                        "UPDATE tDebtorGroup SET Currency = @Currency,InterestRatePerMonth = @InterestRatePerMonth,IsTaxFree = @IsTaxFree,ReceivableAccountId = @ReceivableAccountId ");
                query.Append("SaleAccountId = @SaleAccountId, PurchaseAccountId = @PurchaseAccountId, CounterAccountId = @CounterAccountId WHERE DebtorGroupId = @DebtorGroupId");

                rowsAdded = connection.Execute(query.ToString(), debtorGroup);
            }

            return rowsAdded;
        }
        public static int DeleteDebtorGroup(tDebtorGroup debtorGroup)
        {
            int rowsAdded;

            using (IDbConnection connection = DbConnectionHelper.GetConnection())
            {
                var query =
                    new StringBuilder("DELETE FROM tDebtorGroup WHERE DebtorGroupId = @DebtorGroupId");

                rowsAdded = connection.Execute(query.ToString(), debtorGroup);
            }

            return rowsAdded;
        }
        public static int AddDebtorGroup(tDebtorGroup debtorGroup)
        {
            int rowsAdded;

            using (IDbConnection connection = DbConnectionHelper.GetConnection())
            {
                var query =
                    new StringBuilder(
                        "INSERT INTO tDebtorGroup(DebtorGroupId, Currency, InterestRatePerMonth,IsTaxFree,ReceivableAccountId,SaleAccountId,PurchaseAccountId,CounterAccountId)");
                query.Append("VALUES(@DebtorGroupId, @Currency, @InterestRatePerMonth,@IsTaxFree,@ReceivableAccountId,@SaleAccountId,@PurchaseAccountId,@CounterAccountId)");

                rowsAdded = connection.Execute(query.ToString(), debtorGroup);

            }

            return rowsAdded;
        }