📄 models.smark.cs
字号:
public static object SUM(string field) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Detail.SUM(_context, field, false, null);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object SUM(string field, bool DISTINCT) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Detail.SUM(_context, field, DISTINCT, null);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object MAX(IConnectinContext context, string field, Expression expression) {
return EntityBase.OnAggregation(context, "[order details]", "MAX", field, false, expression, Detail.mGroupString);
}
public static object MAX(IConnectinContext context, string field) {
return Detail.MAX(context, field, null);
}
public static object MAX(string field, Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Detail.MAX(_context, field, expression);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object MAX(string field) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Detail.MAX(_context, field, null);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object MIN(IConnectinContext context, string field, Expression expression) {
return EntityBase.OnAggregation(context, "[order details]", "MIN", field, false, expression, Detail.mGroupString);
}
public static object MIN(IConnectinContext context, string field) {
return Detail.MIN(context, field, null);
}
public static object MIN(string field, Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Detail.MIN(_context, field, expression);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object MIN(string field) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Detail.MIN(_context, field, null);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
protected override void OnLoadData(System.Data.IDataReader reader) {
if ((reader["_OrderID"] != System.DBNull.Value)) {
this.OrderID = ((int)(this.Convert(typeof(int), reader["_OrderID"])));
}
if ((reader["_ProductID"] != System.DBNull.Value)) {
this.ProductID = ((int)(this.Convert(typeof(int), reader["_ProductID"])));
}
if ((reader["_UnitPrice"] != System.DBNull.Value)) {
this.UnitPrice = ((decimal)(this.Convert(typeof(decimal), reader["_UnitPrice"])));
}
if ((reader["_Quantity"] != System.DBNull.Value)) {
this.Quantity = ((int)(this.Convert(typeof(int), reader["_Quantity"])));
}
if ((reader["_Discount"] != System.DBNull.Value)) {
this.Discount = ((int)(this.Convert(typeof(int), reader["_Discount"])));
}
}
public static void Delete(IConnectinContext context, Expression expression) {
EntityBase.OnDelete(context, "[order details]", expression);
}
public static void Delete(Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
Detail.Delete(_context, expression);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
}
/// <summary>
/// Smark.Data.VSGenerator Copyright 泥水佬
/// Email:henryfan@msn.com
/// MappingTable:Customers
///
/// </summary>
[Serializable()]
public partial class Customer : EntityBase {
private string mCustomerID;
public static FieldInfo customerID = new FieldInfo("Customers", "CustomerID");
private string mCompanyName;
public static FieldInfo companyName = new FieldInfo("Customers", "CompanyName");
static string mSelectString = "Select (CustomerID) as _CustomerID,(CompanyName) as _CompanyName from Customers";
static string mGroupString = null;
/// <summary>
///
/// </summary>
public virtual string CustomerID {
get {
return this.mCustomerID;
}
set {
this.mCustomerID = value;
this.EntityState.FieldChange("CustomerID");
}
}
/// <summary>
///
/// </summary>
public virtual string CompanyName {
get {
return this.mCompanyName;
}
set {
this.mCompanyName = value;
this.EntityState.FieldChange("CompanyName");
}
}
public static string Table {
get {
return " Customers ";
}
}
public static System.Collections.Generic.IList<Customer> List(IConnectinContext context, Expression expression, Region region, string OrderBy) {
return EntityBase.OnList<Customer>(context, Customer.mSelectString, expression, region, OrderBy, Customer.mGroupString);
}
public static System.Collections.Generic.IList<Customer> List(IConnectinContext context, Expression expression) {
return Customer.List(context, expression, null, null);
}
public static System.Collections.Generic.IList<Customer> List(Expression expression, Region region, string OrderBy) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.List(_context, expression, region, OrderBy);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static System.Collections.Generic.IList<Customer> List(Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.List(_context, expression, null, null);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static Customer ListFirst(IConnectinContext context, Expression expression, string OrderBy) {
return EntityBase.OnListFirst<Customer>(context, Customer.mSelectString, expression, OrderBy, Customer.mGroupString);
}
public static Customer ListFirst(IConnectinContext context, Expression expression) {
return Customer.ListFirst(context, expression);
}
public static Customer ListFirst(Expression expression, string OrderBy) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.ListFirst(_context, expression, OrderBy);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static Customer ListFirst(Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.ListFirst(_context, expression, null);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static int Count(IConnectinContext context, Expression expression) {
return EntityBase.OnCount(context, "Customers", expression, Customer.mGroupString);
}
public static int Count(Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.Count(_context, expression);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object AVG(IConnectinContext context, string field, bool DISTINCT, Expression expression) {
return EntityBase.OnAggregation(context, "Customers", "AVG", field, DISTINCT, expression, Customer.mGroupString);
}
public static object AVG(IConnectinContext context, string field, Expression expression) {
return Customer.AVG(context, field, false, expression);
}
public static object AVG(IConnectinContext context, string field) {
return Customer.AVG(context, field, false, null);
}
public static object AVG(IConnectinContext context, string field, bool DISTINCT) {
return Customer.AVG(context, field, DISTINCT, null);
}
public static object AVG(string field, bool DISTINCT, Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.AVG(_context, field, DISTINCT, expression);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object AVG(string field, Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.AVG(_context, field, false, expression);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object AVG(string field) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.AVG(_context, field, false, null);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object AVG(string field, bool DISTINCT) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.AVG(_context, field, DISTINCT, null);
}
catch (System.Exception e_) {
throw e_;
}
finally {
_context.Dispose();
}
}
public static object SUM(IConnectinContext context, string field, bool DISTINCT, Expression expression) {
return EntityBase.OnAggregation(context, "Customers", "SUM", field, DISTINCT, expression, Customer.mGroupString);
}
public static object SUM(IConnectinContext context, string field, Expression expression) {
return Customer.SUM(context, field, false, expression);
}
public static object SUM(IConnectinContext context, string field) {
return Customer.SUM(context, field, false, null);
}
public static object SUM(IConnectinContext context, string field, bool DISTINCT) {
return Customer.SUM(context, field, DISTINCT, null);
}
public static object SUM(string field, bool DISTINCT, Expression expression) {
IConnectinContext _context;
_context = DBContext.Context;
try {
return Customer.SUM(_context,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -