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 - 一个面 ...
随机推荐
- UI控件(UIScrollView)
@implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; //创建一个scrollview UIScrollV ...
- MySQL 存储过程和函数
概述 一提到存储过程可能就会引出另一个话题就是存储过程的优缺点,这里也不做讨论,一般别人问我我就这样回答你觉得它好你就用它.因为mysql中存储过程和函数的语法非常接近所以就放在一起,主要区别就是函数 ...
- upload4j安全、高效、易用的java http文件上传框架
简介 upload4j是一款轻量级http文件上传框架,使用简单,实现高效,功能专一,摆脱传统http文件上传框架的繁琐. upload4j的诞生并不是为了解决所有上传需求,而是专注于基础通用需求. ...
- TODO:小程序集成WeUI
TODO:小程序集成WeUI WeUI 为微信 Web 服务量身设计.WeUI 是一套同微信原生视觉体验一致的基础样式库,由微信官方设计团队为微信 Web 开发量身设计,可以令用户的使用感知更加统一. ...
- 《Spark快速大数据分析》—— 第六章 Spark编程进阶
这章讲述了Spark编程中的高级部分,比如累加器和广播等,以及分区和管道...
- iOS --------Crash 分析(一)
iOS Crash 分析(文一)- 开始 1. 名词解释 1. UUID 一个字符串,在iOS上每个可执行文件或库文件都包含至少一个UUID.目的是为了唯一识别这个文件. 2. dwarfdump 苹 ...
- Android笔记——提升ListView的运行效率
之所以说 ListView 这个控件很难用,就是因为它有很多的细节可以优化,其中运行效率就是很重要的一点.目前我们ListView 的运行效率是很低的,因为在 FruitAdapter 的getVie ...
- Utility3:Understand Dashboard Report
To see data in the SQL Server Utility dashboard, select the top node in the Utility Explorer tree - ...
- 【WP8.1开发】RenderTargetBitmap类的特殊用途
相信,耍过WPF的人都知道RenderTargetBitmap这个玩意儿,这家伙比较有意思,它可以将用户界面上呈现的东西写入到内存的位图对象,从而开发者可以在应用程序中使用它,或者将其保存为图像文件. ...
- Huffman树进行编码和译码
//编码#include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> ...