温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Acom进出仓管理系统源码
当前文件路径:AcomStore/BLL/ShDept.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 ShDept 11
{ 12
AcomLb.SqlDAL.ShDept dal; 13
14
public ShDept() 15
{ 16
dal = new AcomLb.SqlDAL.ShDept(); 17
} 18
19
/// <summary> 20
/// 保存数据 21
/// </summary> 22
/// <param name="ds">数据集</param> 23
/// <returns></returns> 24
public bool Save(ShDeptData 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[ShDeptData.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 DataSet GetAllData() 48
{ 49
return dal.GetAllData(true); 50
} 51
52
public ShDeptData GetDataByID(int Id) 53
{ 54
return dal.GetDataByID(Id); 55
} 56
} 57
} 58





}
}