?? bitem.cs
字號(hào):
using System;
using System.Collections.Generic;
using System.Text;
using Model;
using IDDal;
/************菜肴的業(yè)務(wù)邏輯層***********
* 關(guān)于菜肴的增加,刪除,修改,查詢
* 類設(shè)計(jì)者:魏瑩
* 設(shè)計(jì)時(shí)間5月30日
***************************************/
namespace Business
{
/// <summary>
/// 菜肴操作的業(yè)務(wù)邏輯層
/// </summary>
public class BItem
{
ItemDal<Item> itemop = new ImpDDal.ImpItemDal();
/// <summary>
/// 增加一個(gè)菜肴
/// </summary>
/// <param name="item">菜肴對(duì)象</param>
/// <returns>1成功增加,0增加失敗</returns>
public int AddItem(Item item)
{
try
{
return itemop.AddItem(item);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 修改一個(gè)菜肴信息
/// </summary>
/// <param name="item">菜肴對(duì)象</param>
/// <returns>1成功修改,0修改失敗</returns>
public int ModifyItem(Item item)
{
try
{
return itemop.EditItem(item);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 修改一個(gè)菜肴的分類信息
/// </summary>
/// <param name="item">菜肴對(duì)象</param>
/// <returns>1成功修改,0修改失敗</returns>
public int ModifyItemType(Item item)
{
try
{
return itemop.EditItemType(item);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 刪除一個(gè)菜肴
/// </summary>
/// <param name="item">菜肴對(duì)象</param>
/// <returns>1成功刪除,0刪除失敗</returns>
public int DeleteItem(Item item)
{
try
{
return itemop.DeleteItem(item);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 根據(jù)菜肴類別查詢菜肴
/// </summary>
/// <param name="type">類別編號(hào)</param>
/// <returns>菜肴集合</returns>
public IList<Item> Select(int type)
{
try
{
return itemop.SelectItem(type);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 根據(jù)菜肴名模糊查詢
/// </summary>
/// <param name="itemName">菜肴名稱</param>
/// <returns>菜肴集合</returns>
public IList<Item> Select(string itemName)
{
try
{
return itemop.SelectItem(itemName);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 查詢新加入的菜肴,提供主頁(yè)瀏覽
/// </summary>
/// <returns>菜肴集合</returns>
public IList<Item> SelectNewItem()
{
try
{
return itemop.SelectNewItemByIndex();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 查詢某種菜肴的前幾條記錄
/// </summary>
/// <param name="type">菜肴類型</param>
/// <param name="top">前幾條記錄</param>
/// <returns>菜肴集合</returns>
public IList<Item> SelectSubItem(int type,int top)
{
try
{
return itemop.SelectItem(type,top);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 根據(jù)菜肴編號(hào)返回一個(gè)菜肴信息
/// </summary>
/// <param name="systemId">菜肴編號(hào)</param>
/// <returns>菜肴對(duì)象</returns>
public Item SelectOneItem(long systemId)
{
try
{
return itemop.SelectOneItem(systemId);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
/// 隨機(jī)讀取前TOP個(gè)菜肴
/// </summary>
/// <param name="top">前幾個(gè)</param>
/// <returns>菜肴集合</returns>
public IList<Item> SelectRandom(int top)
{
try
{
return itemop.SelectItemTop(top);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public IList<Item> SelectHotItems()
{
try
{
return itemop.SelectHotItems();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -