?? flowercategoryblbase.cs
字號(hào):
?//注意:當(dāng)前類文件由開發(fā)助手自動(dòng)產(chǎn)生,以后每次生成代碼時(shí)都將自動(dòng)更新。用戶不可編輯此文件的任何內(nèi)容,以免被覆蓋!
// This source code was auto-generated by DevHelper, on 2006-1-2 22:09:04. don't modify this file!
using System;
using System.Text;
using System.Data;
using System.Collections;
using DingHaokai.BussinessLogic;
using FlowerShop.MOD;
using FlowerShop.DAL;
namespace FlowerShop.BLL.Base
{
public class FlowerCategoryBLBase : BaseBL
{
/// <summary>
/// 受保護(hù)的內(nèi)部構(gòu)造函數(shù),用戶不能創(chuàng)建該類實(shí)例,而應(yīng)創(chuàng)建FlowerCategoryBL類實(shí)例
/// </summary>
protected internal FlowerCategoryBLBase()
{
}
/// <summary>
/// 從數(shù)據(jù)庫中獲取FlowerCategoryDS數(shù)據(jù)集的所有數(shù)據(jù)
/// </summary>
/// <param name="ds">輸出加載后的數(shù)據(jù)集類實(shí)例,注意此參數(shù)為out類型參數(shù)。</param>
public virtual void GetItems(out FlowerCategoryDS ds)
{
ds = new FlowerCategoryDS();
try
{
new FlowerCategoryDA().Load(ds);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
/// <summary>
/// 保存FlowerCategoryDS數(shù)據(jù)集
/// </summary>
/// <param name="ds">FlowerCategoryDS數(shù)據(jù)</param>
public void Save(FlowerCategoryDS ds)
{
int transID;
FlowerCategoryDA.BeginTrans(out transID);
try
{
Save(ds, transID);
FlowerCategoryDA.CommitTrans(transID);
}
catch(Exception ex)
{
FlowerCategoryDA.RollbackTrans(transID);
throw new BLException(ExceptionType.UpdateFailed, ex.Message);
}
}
/// <summary>
/// 保存FlowerCategoryDS數(shù)據(jù)集
/// </summary>
/// <param name="ds">FlowerCategoryDS數(shù)據(jù)</param>
/// <param name="transID">數(shù)據(jù)庫事務(wù)ID</param>
public void Save(FlowerCategoryDS ds, int transID)
{
FlowerCategoryDA da = new FlowerCategoryDA();
//
//根據(jù)數(shù)據(jù)集中各表間的關(guān)聯(lián)關(guān)系,先處理子表刪除的記錄
//
if(ds.FlowerCategory.GetChanges() != null)
da.Update(ds.FlowerCategory, transID);
//da.Update(ds, transID);
}
/// <summary>
/// 根據(jù)枚舉表數(shù)組建立相應(yīng)的枚舉表表名數(shù)組
/// </summary>
private string[] BuildDataTableNameArray(FlowerCategoryDS.TableEnum[] relatedTables, params FlowerCategoryDS.TableEnum[] excludeTables)
{
if (relatedTables != null && relatedTables.Length>0)
{
ArrayList relatedTableNames = new ArrayList();
foreach (FlowerCategoryDS.TableEnum relatedTable in relatedTables)
{
if (Array.IndexOf(excludeTables, relatedTable)<0)
{
relatedTableNames.Add(relatedTable.ToString());
}
}
return (string[])relatedTableNames.ToArray(typeof(string));
}
else
{
return null;
}
}
/// <summary>
/// 根據(jù)CategoryID獲取FlowerCategory表數(shù)據(jù)及并填充關(guān)聯(lián)的數(shù)據(jù)表
/// </summary>
/// <param name="relatedTables">指定填充關(guān)聯(lián)表范圍,在此范圍之外的關(guān)聯(lián)表將被忽略。此參數(shù)為空時(shí)將被忽略。</param>
/// <returns>返回主鍵值對(duì)應(yīng)的數(shù)據(jù)行</returns>
public virtual FlowerCategoryDS.FlowerCategoryRow GetFlowerCategory(FlowerCategoryDS ds, int CategoryID, params FlowerCategoryDS.TableEnum[] relatedTables)
{
try
{
string[] relatedTableNames = BuildDataTableNameArray(relatedTables);
FlowerCategoryDA da = new FlowerCategoryDA();
da.LoadWithRelated(ds, da.DataTables[FlowerCategoryDS.TableEnum.FlowerCategory.ToString()],"CategoryID="+CategoryID.ToString(), relatedTableNames);
return ds.FlowerCategory.FindByCategoryID(CategoryID);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
/// <summary>
/// 根據(jù)CategoryID獲取FlowerCategory表數(shù)據(jù)及并填充向上關(guān)聯(lián)的數(shù)據(jù)表數(shù)據(jù)(不填充下級(jí)子表數(shù)據(jù))
/// </summary>
/// <param name="loadParentRecursive">是否遞歸裝載所有關(guān)聯(lián)的上級(jí)(父)數(shù)據(jù)表,為false時(shí)只裝載上一層關(guān)聯(lián)數(shù)據(jù)表</param>
/// <param name="relatedTables">指定填充關(guān)聯(lián)表范圍,在此范圍之外的關(guān)聯(lián)表將被忽略。此參數(shù)為空時(shí)將被忽略。</param>
/// <returns>返回主鍵值對(duì)應(yīng)的數(shù)據(jù)行</returns>
public virtual FlowerCategoryDS.FlowerCategoryRow GetFlowerCategory(FlowerCategoryDS ds, int CategoryID, bool loadParentRecursive, params FlowerCategoryDS.TableEnum[] relatedTables)
{
try
{
string[] relatedTableNames = BuildDataTableNameArray(relatedTables);
FlowerCategoryDA da = new FlowerCategoryDA();
da.LoadWithRequired(ds, da.DataTables[FlowerCategoryDS.TableEnum.FlowerCategory.ToString()],"CategoryID="+CategoryID.ToString(), loadParentRecursive, relatedTableNames);
return ds.FlowerCategory.FindByCategoryID(CategoryID);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
/// <summary>
/// 根據(jù)CategoryID獲取FlowerCategory表數(shù)據(jù)及并填充關(guān)聯(lián)的數(shù)據(jù)表
/// </summary>
/// <param name="withRequired">是否裝載所有關(guān)聯(lián)的上級(jí)(父)數(shù)據(jù)表</param>
/// <param name="loadRecursive">是否遞歸裝載所有下級(jí)(子)數(shù)據(jù)表,為false時(shí)只裝載關(guān)聯(lián)的一級(jí)子數(shù)據(jù)表</param>
/// <param name="relatedTables">指定填充關(guān)聯(lián)表范圍,在此范圍之外的關(guān)聯(lián)表將被忽略。此參數(shù)為空時(shí)將被忽略。</param>
/// <returns>返回主鍵值對(duì)應(yīng)的數(shù)據(jù)行</returns>
public virtual FlowerCategoryDS.FlowerCategoryRow GetFlowerCategory(FlowerCategoryDS ds, int CategoryID, bool withRequired, bool loadRecursive, params FlowerCategoryDS.TableEnum[] relatedTables)
{
try
{
string[] relatedTableNames = BuildDataTableNameArray(relatedTables);
FlowerCategoryDA da = new FlowerCategoryDA();
da.LoadWithRelated(ds, da.DataTables[FlowerCategoryDS.TableEnum.FlowerCategory.ToString()],"CategoryID="+CategoryID.ToString(), withRequired, loadRecursive, relatedTableNames);
return ds.FlowerCategory.FindByCategoryID(CategoryID);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
/// <summary>
/// 根據(jù)CategoryID獲取FlowerCategory表數(shù)據(jù)
/// </summary>
/// <returns>返回主鍵值對(duì)應(yīng)的數(shù)據(jù)行</returns>
public virtual FlowerCategoryDS.FlowerCategoryRow GetFlowerCategory(FlowerCategoryDS.FlowerCategoryDataTable tb, int CategoryID)
{
try
{
new FlowerCategoryDA().Load(tb, "CategoryID="+CategoryID.ToString());
return tb.FindByCategoryID(CategoryID);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
/// <summary>
/// 獲取符合條件的FlowerCategory記錄并填充相關(guān)聯(lián)的數(shù)據(jù)
/// </summary>
/// <param name="ds">接受數(shù)據(jù)填充的數(shù)據(jù)集實(shí)例(需已創(chuàng)建)</param>
/// <param name="condition">條件(不帶where前綴)</param>
/// <param name="relatedTables">指定填充關(guān)聯(lián)表范圍,在此范圍之外的關(guān)聯(lián)表將被忽略。此參數(shù)為空時(shí)將被忽略。</param>
public virtual void GetFlowerCategorys(FlowerCategoryDS ds, string condition, params FlowerCategoryDS.TableEnum[] relatedTables)
{
try
{
string[] relatedTableNames = BuildDataTableNameArray(relatedTables);
FlowerCategoryDA da = new FlowerCategoryDA();
da.LoadWithRelated(ds, da.DataTables[FlowerCategoryDS.TableEnum.FlowerCategory.ToString()], condition, relatedTableNames);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
/// <summary>
/// 獲取符合條件的FlowerCategory記錄并填充向上關(guān)聯(lián)的數(shù)據(jù)表數(shù)據(jù)(不填充下級(jí)子表數(shù)據(jù))
/// </summary>
/// <param name="ds">接受數(shù)據(jù)填充的數(shù)據(jù)集實(shí)例(需已創(chuàng)建)</param>
/// <param name="condition">條件(不帶where前綴)</param>
/// <param name="loadParentRecursive">是否遞歸裝載所有關(guān)聯(lián)的上級(jí)(父)數(shù)據(jù)表,為false時(shí)只裝載上一層關(guān)聯(lián)數(shù)據(jù)表</param>
/// <param name="relatedTables">指定填充關(guān)聯(lián)表范圍,在此范圍之外的關(guān)聯(lián)表將被忽略。此參數(shù)為空時(shí)將被忽略。</param>
public virtual void GetFlowerCategorys(FlowerCategoryDS ds, string condition, bool loadParentRecursive, params FlowerCategoryDS.TableEnum[] relatedTables)
{
try
{
string[] relatedTableNames = BuildDataTableNameArray(relatedTables);
FlowerCategoryDA da = new FlowerCategoryDA();
da.LoadWithRequired(ds, da.DataTables[FlowerCategoryDS.TableEnum.FlowerCategory.ToString()], condition, loadParentRecursive, relatedTableNames);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
/// <summary>
/// 獲取符合條件的FlowerCategory記錄并填充相關(guān)聯(lián)的數(shù)據(jù)
/// </summary>
/// <param name="ds">接受數(shù)據(jù)填充的數(shù)據(jù)集實(shí)例(需已創(chuàng)建)</param>
/// <param name="condition">條件(不帶where前綴)</param>
/// <param name="withRequired">是否裝載所有關(guān)聯(lián)的上級(jí)(父)數(shù)據(jù)表</param>
/// <param name="loadRecursive">是否遞歸裝載所有下級(jí)(子)數(shù)據(jù)表,為false時(shí)只裝載關(guān)聯(lián)的一級(jí)子數(shù)據(jù)表</param>
/// <param name="relatedTables">指定填充關(guān)聯(lián)表范圍,在此范圍之外的關(guān)聯(lián)表將被忽略。此參數(shù)為空時(shí)將被忽略。</param>
public virtual void GetFlowerCategorys(FlowerCategoryDS ds, string condition, bool withRequired, bool loadRecursive, params FlowerCategoryDS.TableEnum[] relatedTables)
{
try
{
string[] relatedTableNames = BuildDataTableNameArray(relatedTables);
FlowerCategoryDA da = new FlowerCategoryDA();
da.LoadWithRelated(ds, da.DataTables[FlowerCategoryDS.TableEnum.FlowerCategory.ToString()], condition, withRequired, loadRecursive, relatedTableNames);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
/// <summary>
/// 獲取符合條件的FlowerCategory記錄
/// </summary>
/// <param name="tb">接受數(shù)據(jù)填充的數(shù)據(jù)表(需已創(chuàng)建)</param>
/// <param name="condition">條件(不帶where前綴)</param>
public virtual void GetFlowerCategorys(FlowerCategoryDS.FlowerCategoryDataTable tb, string condition)
{
try
{
FlowerCategoryDA da = new FlowerCategoryDA();
da.Load(tb, condition);
}
catch(Exception ex)
{
throw new BLException(ExceptionType.DataLoadFailed, ex.Message);
}
}
}//end of class
}//end of namespace
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -