csharp: .NET Object Relationional Mapper (ORM)- SubSonic
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的更多相关文章
- Django中ORM介绍和字段及字段参数 Object Relational Mapping(ORM)
Django中ORM介绍和字段及字段参数 Object Relational Mapping(ORM) ORM介绍 ORM概念 对象关系映射(Object Relational Mapping,简 ...
- Object Relational Mapping(ORM)
Object Relational Mapping(ORM) ORM介绍 ORM概念 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据 ...
- Django中的Object Relational Mapping(ORM)
ORM 介绍 ORM 概念 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据库存在的互不匹配的现象的技术. 简单的说,ORM是通过使用 ...
- xml与object 之间的ORM
xml映射为object对象,同时object对象,以xml来表示: public class Tools { private static XmlNodeList SelectNodes(strin ...
- Django框架----Object Relational Mapping(ORM)
Django中的ORM Django项目使用MySQL数据库 1. 在Django项目的settings.py文件中,配置数据库连接信息: DATABASES = { "default&qu ...
- 20个很有用的PHP类库
介绍20个非常有用的PHP类库,相信一定可以为你的WEB开发提供更好和更为快速的方法. 图表库 下面的类库可以让你很简的创建复杂的图表和图片.当然,它们需要GD库的支持. pChart – 一个可以创 ...
- 第十九章 数据访问(In .net4.5) 之 处理数据
1. 概述 本章介绍 数据库.Json和Xml.web services 三种介质上的数据操作. 2. 主要内容 2.1 数据库 ① 建立连接 .net平台中的数据连接类都继承自DbConnectio ...
- 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 ...
- Php 常用类
图表库下面的类库可以让你很简单就能创建复杂的图表和图片.当然,它们需要GD库的支持.pChart - 一个可以创建统计图的库.Libchart - 这也是一个简单的统计图库.JpGraph - 一个面 ...
随机推荐
- Azure 新的管理模式 —— Resource Manager
var appInsights=window.appInsights||function(config){ function r(config){t[config]=function(){var i= ...
- 移动端手势库hammerJS 2.0.4官方文档翻译
hammerJS是一个优秀的.轻量级的触屏设备手势库,现在已经更新到2.04版本,跟1.0版本有点天壤地别了,毕竟改写了事件名并新增了许多方法,允许同时监听多个手势.自定义识别器,也可以识别滑动方向. ...
- 《CLR.via.C#第三版》第二部分第10,11章节读书笔记(五)
第10章是对 属性 做阐述 属性本质上是方法 匿名类型的使用: }; Console.WriteLine("Name={0},Year={1}",o1.Name,o1.Year); ...
- SharpFileDB - a file database for small apps
SharpFileDB - a file database for small apps 本文中文版在此处. I'm not an expert of database. Please feel fr ...
- Python 学习之路 (前言)
为什么要学Python 1,脚本语言本身很方便简洁,未来会有趋势 2,web 方向 3,运维方向 我是学静态语言出身的,java,毕业后从事android 应用开发,曾在工作期间学习过linux,想 ...
- C#实现二维码功能,winform 以及 asp.net均可以用
二维码现在用途很多,怎么用C#编程生成呢? 准备 ThoughtWorks.QRCode.dll 需要 一个类 QRCode,这个类专门来生成二维码的 using System; using Syst ...
- Java 超简单实现发送邮件(可动态控制发送人数)
发送邮件的实现 需要事先引入以下几个架包,最重要的架包是jodd-3.7这个 以上架包下载地址:http://pan.baidu.com/s/1kVs7Tyv 提取密码:h22x 新建一个Util类 ...
- CSS list-style属性控制ul标签样式
试一试 <style type="text/css" media="all"> ul { list-style-type: disc; } ul#c ...
- Android之自定义标题
我们知道我们创建的每一个Activity,系统默认为我们提供了一下黑色的标题,本篇我将带领大家接触一下如何实现自定义标题样式.相比系统为我们提供的样式,自定义标题可以满足我们唯心所欲的自定义设计,使我 ...
- 【开源】OSharp3.3框架解说系列:重新开源及3.3版本新特性
OSharp是什么? OSharp是个快速开发框架,但不是一个大而全的包罗万象的框架,严格的说,OSharp中什么都没有实现.与其他大而全的框架最大的不同点,就是OSharp只做抽象封装,不做实现.依 ...