https://github.com/subsonic/SubSonic-3.0

http://subsonic.codeplex.com/

https://code.google.com/archive/p/subsonicvn/downloads

https://subsonicvn.googlecode.com/

http://www.codeproject.com/Articles/21244/Creating-a-DAL-with-SubSonic

https://www.sencha.com/forum/showthread.php?37577-ExtJS-.NET-SubSonic-AutoScaffolding-Code-Generation

ALTER PROCEDURE [dbo].[SP_GET_BestPrice_Web]
-- Add the parameters for the stored procedure here
@InventoryGUID char(32),
@CustomerGUID char(32),
@Quantity int,
@SelectBestPrice tinyint, --0= false just get the CCP price for this customer,1 = true get best price.
@BasePrice money,
@PricingBandGUID char(32)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
--SET NOCOUNT ON;
-- Declare the return variable here
DECLARE @SpecialPrice money
IF @SelectBestPrice = 1
BEGIN
IF @Quantity = 1
SET @Quantity = 0 -- equivalent abd some pricing use 0 to indicate no qty breaks
-- Add the T-SQL statements to compute the return value here
SELECT @SpecialPrice = SpecialPrice from (Select Top 1 dbo.FN_CalcSpecialPrice(@BasePrice,AdjustmentMode,CASE WHEN AdjustmentMode = 1 THEN Percentage WHEN AdjustmentMode =3 THEN FixedPrice ELSE DollarAmount END)as SpecialPrice FROM Pricing where Pricing.ActiveStatus = 0
and Pricing.InventoryItemGUID = @InventoryGUID and @Quantity>=QuantityBreak and (Pricing.EntityGUID = @CustomerGUID or (Pricing.PricingBandGUID = @PricingBandGUID and Pricing.EntityGUID='00000000000000000000000000000000') or (PricingBandGUID='00000000000000000000000000000000' and EntityGUID='00000000000000000000000000000000')) order by SpecialPrice) as InventoryPrices
END
ELSE -- only get CCP price, ignore others
BEGIN
SELECT @SpecialPrice = SpecialPrice from (Select dbo.FN_CalcSpecialPrice(@BasePrice,AdjustmentMode,CASE WHEN AdjustmentMode = 1 THEN Percentage WHEN AdjustmentMode =3 THEN FixedPrice ELSE DollarAmount END) as SpecialPrice FROM Pricing where Pricing.ActiveStatus = 0
and Pricing.EntityGUID = @CustomerGUID and Pricing.InventoryItemGUID = @InventoryGUID) as InventoryPrices END
--Return our special price
If @SpecialPrice is NULL or @SpecialPrice = 0
SET @SpecialPrice = @BasePrice RETURN @SpecialPrice
END

  

StoredProcedure sp = SPs.SpGetBestPriceWeb(inventoryItemGUID, customerGUID, 1, 1, item.ItmExTaxPrice, "0000000000");
sp.Command.AddReturnParameter();
sp.Execute(); string spResult = sp.Command.Parameters.Find(delegate(QueryParameter qp)
{
return qp.Mode == ParameterDirection.ReturnValue;
}).ParameterValue.ToString(); decimal specialPrice = Convert.ToDecimal(spResult);

  

using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
using SubSonic;
using SubSonic.Utilities;
// <auto-generated />
namespace Southwind{
public partial class SPs{ /// <summary>
/// Creates an object wrapper for the CustOrderHist Procedure
/// </summary>
public static StoredProcedure CustOrderHist()
{
SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("CustOrderHist", DataService.GetInstance("Southwind"), ""); return sp;
} /// <summary>
/// Creates an object wrapper for the CustOrdersDetail Procedure
/// </summary>
public static StoredProcedure CustOrdersDetail()
{
SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("CustOrdersDetail", DataService.GetInstance("Southwind"), ""); return sp;
} /// <summary>
/// Creates an object wrapper for the CustOrdersOrders Procedure
/// </summary>
public static StoredProcedure CustOrdersOrders()
{
SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("CustOrdersOrders", DataService.GetInstance("Southwind"), ""); return sp;
} /// <summary>
/// Creates an object wrapper for the Employee Sales By Country Procedure
/// </summary>
public static StoredProcedure EmployeeSalesByCountry()
{
SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("Employee Sales By Country", DataService.GetInstance("Southwind"), ""); return sp;
} /// <summary>
/// Creates an object wrapper for the Sales by Year Procedure
/// </summary>
public static StoredProcedure SalesByYear()
{
SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("Sales by Year", DataService.GetInstance("Southwind"), ""); return sp;
} /// <summary>
/// Creates an object wrapper for the Ten Most Expensive Products Procedure
/// </summary>
public static StoredProcedure TenMostExpensiveProducts()
{
SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("Ten Most Expensive Products", DataService.GetInstance("Southwind"), ""); return sp;
} } }

  

csharp: .NET Object Relationional Mapper (ORM)- SubSonic的更多相关文章

  1. Django中ORM介绍和字段及字段参数 Object Relational Mapping(ORM)

    Django中ORM介绍和字段及字段参数   Object Relational Mapping(ORM) ORM介绍 ORM概念 对象关系映射(Object Relational Mapping,简 ...

  2. Object Relational Mapping(ORM)

    Object Relational Mapping(ORM) ORM介绍 ORM概念 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据 ...

  3. Django中的Object Relational Mapping(ORM)

    ORM 介绍 ORM 概念 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据库存在的互不匹配的现象的技术. 简单的说,ORM是通过使用 ...

  4. xml与object 之间的ORM

    xml映射为object对象,同时object对象,以xml来表示: public class Tools { private static XmlNodeList SelectNodes(strin ...

  5. Django框架----Object Relational Mapping(ORM)

    Django中的ORM Django项目使用MySQL数据库 1. 在Django项目的settings.py文件中,配置数据库连接信息: DATABASES = { "default&qu ...

  6. 20个很有用的PHP类库

    介绍20个非常有用的PHP类库,相信一定可以为你的WEB开发提供更好和更为快速的方法. 图表库 下面的类库可以让你很简的创建复杂的图表和图片.当然,它们需要GD库的支持. pChart – 一个可以创 ...

  7. 第十九章 数据访问(In .net4.5) 之 处理数据

    1. 概述 本章介绍 数据库.Json和Xml.web services 三种介质上的数据操作. 2. 主要内容 2.1 数据库 ① 建立连接 .net平台中的数据连接类都继承自DbConnectio ...

  8. ASP.NET MVC- Model- An Introduction to Entity Framework for Absolute Beginners

    Introduction This article introduces Entity Framework to absolute beginners. The article is meant fo ...

  9. Php 常用类

    图表库下面的类库可以让你很简单就能创建复杂的图表和图片.当然,它们需要GD库的支持.pChart - 一个可以创建统计图的库.Libchart - 这也是一个简单的统计图库.JpGraph - 一个面 ...

随机推荐

  1. Python黑帽编程2.5 函数

    Python黑帽编程2.5 函数 写了几节的基础知识,真心感觉有点力不从心.这块的内容说实话,看文档是最好的方式,本人的写作水平,真的是找不出更好的写法,头疼.简单带过和没写一样,写详细了和本系列教程 ...

  2. MySQL实现嵌套集合模型

    MySQL实现嵌套集合模型 译文主要是介绍如何用MySQL来存储嵌套集合数据.在其中会增加一些自己的理解,也会删除掉一些自认为无用的废话. 这篇文章主要讲的是嵌套集合模型,所以邻接表不是本文的重点,简 ...

  3. 玩转动态编译 - 高级篇:一,IL访问静态属性和字段

    IL介绍 通用中间语言(Common Intermediate Language,简称CIL,发音为"sill"或"kill")是一种属于通用语言架构和.NET ...

  4. Thread.Sleep引发ThreadAbortException异常

    短信平台记录日志模块,是通过异步方式来记录的,即日志工具类里初始化一个Queue对象,公共的写日志方法的处理逻辑是把日志消息放到Queue里.构造器里设定一个死循环,不停的读队,然后把日志消息持久化到 ...

  5. iOS-iOS开发简单介绍

    概览 终于到了真正接触IOS应用程序的时刻了,之前我们花了很多时间去讨论C语言.ObjC等知识,对于很多朋友而言开发IOS第一天就想直接看到成果,看到可以运行的IOS程序.但是这里我想强调一下,前面的 ...

  6. 初学Python

    初学Python 1.Python初识 life is short you need python--龟叔名言 Python是一种简洁优美语法接近自然语言的一种全栈开发语言,由"龟叔&quo ...

  7. 传智播客--ADO.net--SqlBulkCopy批量插入数据(小白必知)

    一般情况下,我们在向数据库中插入数据时用Insert语句,但是当数据量很大的时候,这种情况就比较缓慢了,这个时候就需要SqlBulkCopy这个类. SqlBulkCopy本身常用的函数有这么几个 D ...

  8. 谈谈基于OAuth 2.0的第三方认证 [下篇]

    从安全的角度来讲,<中篇>介绍的Implicit类型的Authorization Grant存在这样的两个问题:其一,授权服务器没有对客户端应用进行认证,因为获取Access Token的 ...

  9. Vagrant使用

    常用命令 命令 说明 vagrant up 运行vm vagrant status 查看当前虚拟机运行状态 vagrant suspend 暂停虚拟机 vagrant ssh ssh方式登录虚拟机 v ...

  10. 窥探Swift之需要注意的基本运算符和高级运算符

    之前更新了一段时间有关Swift语言的博客,连续更新了有6.7篇的样子.期间间更新了一些iOS开发中SQLite.CollectionViewController以及ReactiveCocoa的一些东 ...