温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Acom进出仓管理系统源码
当前文件路径:AcomStore/BLL/ShProduct.cs

1using System; 2
using System.Collections.Generic; 3
using System.Text; 4
using System.Data; 5
6
using AcomLb.Model; 7
8
namespace AcomLb.BLL 9
{ 10
public class ShProduct 11
{ 12
AcomLb.SqlDAL.ShProduct dal; 13
14
public ShProduct() 15
{ 16
dal = new AcomLb.SqlDAL.ShProduct(); 17
} 18
19
/// <summary> 20
/// 保存数据 21
/// </summary> 22
/// <param name="ds">数据集</param> 23
/// <returns></returns> 24
public bool Save(ShProductData ds) 25
{ 26
if (ds.Tables[0].Rows.Count != 1) 27
return false; 28
DataRow dr = ds.Tables[0].Rows[0]; 29
ds.AcceptChanges(); 30
if (dr[ShProductData.ID_FIELD] == DBNull.Value) 31
{ 32
dr.SetAdded(); 33
return dal.InsertData(ds); 34
} 35
else 36
{ 37
dr.SetModified(); 38
return dal.UpdateData(ds); 39
} 40
} 41
42
public bool DeleteById(int Id) 43
{ 44
return dal.DeleteData(Id); 45
} 46
47
public ShProductData GetDataByID(int Id) 48
{ 49
return dal.GetDataByID(Id); 50
} 51
52
/// <summary> 53
/// 获取产品信息 54
/// </summary> 55
/// <param name="strSearch"></param> 56
/// <returns></returns> 57
public DataSet GetProductInfo(string strSearch, string OrderBy) 58
{ 59
return dal.GetProductInfo(strSearch, OrderBy); 60
} 61
62
public bool SetWasById(int Id) 63
{ 64
return dal.SetWasById(Id); 65
} 66
} 67
} 68





}
}