温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Acom进出仓管理系统源码
当前文件路径:AcomStore/BLL/ShBillList.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 ShBillList 11
{ 12
AcomLb.SqlDAL.ShBillList dal; 13
14
public ShBillList() 15
{ 16
dal = new AcomLb.SqlDAL.ShBillList(); 17
} 18
19
/// <summary> 20
/// 保存数据 21
/// </summary> 22
/// <param name="ds">数据集</param> 23
/// <returns></returns> 24
public bool Save(ShBillListData 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[ShBillListData.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 ShBillListData GetDataByID(int Id) 48
{ 49
return dal.GetDataByID(Id); 50
} 51
52
/// <summary> 53
/// 单据明细 54
/// </summary> 55
/// <param name="BillId"></param> 56
/// <returns></returns> 57
public DataSet GetBillList(int BillId) 58
{ 59
return dal.GetBillList(BillId); 60
} 61
62
/// <summary> 63
/// 检查条形码是否存在 64
/// </summary> 65
/// <param name="ds"></param> 66
/// <returns></returns> 67
public string ChkBarCode(ShBillListData ds) 68
{ 69
string result = string.Empty; 70
foreach (DataRow dr in ds.Tables[0].Rows) 71
{ 72
if (dal.ChkCodeIsExits(dr[ShBillListData.MAINBARCODE_FIELD].ToString(), (int)dr[ShBillListData.PROID_FIELD])) 73
{ 74
result = dr[ShBillListData.MAINBARCODE_FIELD].ToString(); 75
continue; 76
} 77
} 78
return result; 79
} 80
81
public bool SetWasById(int Id) 82
{ 83
return dal.SetWasById(Id); 84
} 85
} 86
} 87





}
}