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 - 一个面 ...
随机推荐
- Hadoop学习笔记—7.计数器与自定义计数器
一.Hadoop中的计数器 计数器:计数器是用来记录job的执行进度和状态的.它的作用可以理解为日志.我们通常可以在程序的某个位置插入计数器,用来记录数据或者进度的变化情况,它比日志更便利进行分析. ...
- IIS发布站点错误收集(持续更新)
本文主要收集IIS在发布站点过程中遇到的错误,并提供解决办法.并亲测可行.如果您也在使用IIS发布站点的过程中遇到了一些问题,欢迎留言提问. (1.) HTTP错误500.21-Internal Se ...
- 用chrome来映射查找样式对应的sass
较新版本的sass(3.3+)支持source-map功能,可以配合谷歌浏览器或者livestyle来映射查找对应的样式. 要生成source-map可以在grunt中使用 grunt-contrib ...
- MySQL Dll语句
标签:MYSQL数据库/DBA/删除数据库表 概述 因为遇到一些事情,从发表上一篇文章到现在中间间隔了好几个月时间:在接下来的时间里会陆续发表关于mysql的一些文章,从基础到优化最后到管理,欢迎关注 ...
- Worktile 技术架构概要
其实早就该写这篇博客了,一直说忙于工作没有时间,其实时间挤挤总会有的,可能就是因为懒吧!从2013年11月一直拖到现在,今天就简单谈谈 Worktile 的技术架构吧 . Worktile 自上线到现 ...
- Jquery UI - DatePicker 在Dialog中无法自动隐藏的解决思路
通过Jquery UI Dialog模态展示如下的一个员工编辑页面,但是遇到一个奇怪的问题:点击Start Date的input元素后,其无法失去焦点.从而导致DatePicker控件在选择日期后无法 ...
- GitFlow
git工作流 始终保持有master分支(只要有目录,git就自动创建)和develop分支(手动创建) 一.主分支Master二.开发分支Develop三.临时性分支(最后发布要删除的)* 功能(f ...
- Screeps ———— A MMO Strategy Sandbox Game for Programmers
At the beginning, let's see three of this game's captures. Yes, As what you see in these pictures, y ...
- 判断手机端用户打开页面时是android还是ios,并将判断结果通过ajax返回给url接口,传递回去
首先判断页面是android还是ios,然后利用ajax将结果通过接口url返回回去,记录到log日志中,以统计android和ios用户访问该页面的数量(数据统计) <script type= ...
- Clash Detection
Clash Detection eryar@163.com Abstract. Clash detection is used for the model collision check. The p ...