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 - 一个面 ...
随机推荐
- 架构之路(七)MVC点滴
我们目前正在开发中的是任务管理系统,一个前端复杂的项目,所以我们先从MVC讲起吧. WebForm 随着ASP.NET MVC的兴起,WebForm已成昨日黄花,但我其实还很想为WebForm说几句. ...
- Entity Framework 基础知识走马观花
本文目录: 一.EF中的edmx文件探秘 二.EF中的代理模式探秘 三.EF中的延迟加载与即时加载 一.EF中的edmx文件 1.1 emdx文件本质:一个XML文件 (1)通过选择以XML方式打开e ...
- [.net 面向对象程序设计进阶] (23) 团队开发利器(二)优秀的版本控制工具SVN(上)
[.net 面向对象程序设计进阶] (23) 团队开发利器(二)优秀的版本控制工具SVN(上) 本篇导读: 上篇介绍了常用的代码管理工具VSS,看了一下评论,很多同学深恶痛绝,有的甚至因为公司使用VS ...
- quick-cocos2d-x 2.2.3 rc版本中 crypto.md5file() 的C++实现在ANDROID上有BUG
原来的版本是用fopen打开文件的,如果要从ANDROID的APK中取文件,直接就洗白了修改如下 void CCCrypto::MD5File(const char* path, unsigned c ...
- jws.mono脚本安装详解
就在最近两天,最新版本的jws.mono上线了,这个版本除了提供与之前版本拥有的功能外,还额外提供了一个“自动化”的安装脚本,通过执行该脚本,jws.mono将自动快速的安装到指定的目录,同时,通过改 ...
- 京东招聘Java开发人员
软件开发工程师(JAVA) 岗位职责: 1. 负责京东核心业务系统的需求分析.设计.开发工作 2. 负责相关技术文档编写工作 3. 解决系统中的关键问题和技术难题 任职要求: 1. 踏实诚恳.责任心强 ...
- EF连接PostgreSql
1.用nuget安装npgsql和EF 注意,Nuget一定要安装Npgsql的2.2.7版本,更高版本nuget在后面安装EF的时候无法自动解析. install-Package Npgsql -V ...
- DOM访问元素样式和操作元素样式
在HTML中定义样式的方式有三种:通过<link/>元素包含外部样式表文件(外部样式表).使用<style/>元素定义嵌入式样式(嵌入式样式表).使用style特性定义针对特定 ...
- 大叔也学Xamarin系列
回到占占推荐博客索引 我就是我,请叫我仓储大叔 大叔听很多客户说,xamarin的资料网上太少了,是的,大叔也相信,因为大叔在学xamarin里确实很费劲,只能看看androd for java了,呵 ...
- iOS----自定义UIView,绘制一个UIView
绘制一个UIVIew最灵活的方式就是由它自己完成绘制.实际上你不是绘制一个UIView,你只是子类化了UIView并赋予子类绘制自己的能力.当一个UIVIew需要执行绘图操作的时,drawRect:方 ...