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

1using System; 2
using System.Collections.Generic; 3
using System.Text; 4
using System.Data; 5
6
using AcomLb.Model; 7
namespace AcomLb.BLL 8
{ 9
public class ShDataBack 10
{ 11
AcomLb.SqlDAL.ShDataBack dal; 12
13
public ShDataBack() 14
{ 15
dal = new AcomLb.SqlDAL.ShDataBack(); 16
} 17
18
/// <summary> 19
/// 保存数据 20
/// </summary> 21
/// <param name="ds">数据集</param> 22
/// <returns></returns> 23
public bool Save(ShDataBackData ds) 24
{ 25
if (ds.Tables[0].Rows.Count != 1) 26
return false; 27
DataRow dr = ds.Tables[0].Rows[0]; 28
ds.AcceptChanges(); 29
if (dr[ShDataBackData.ID_FIELD] == DBNull.Value) 30
{ 31
dr.SetAdded(); 32
return dal.InsertData(ds); 33
} 34
else 35
{ 36
dr.SetModified(); 37
return dal.UpdateData(ds); 38
} 39
} 40
41
public ShDataBackData GetAllData() 42
{ 43
return dal.GetAllData(true); 44
} 45
46
public bool DeleteById(int id) 47
{ 48
return dal.DeleteData(id); 49
} 50
51
public ShDataBackData GetDataById(int id) 52
{ 53
return dal.GetDataByID(id); 54
} 55
56
// <summary> 57
/// 备份数据库 58
/// </summary> 59
/// <param name="PathDataName">数库库的完整路径和文件名</param> 60
/// <returns></returns> 61
public bool SetDataBack(string PathDataName, string FileName) 62
{ 63
return dal.SetDataBack(PathDataName, FileName); 64
} 65
} 66
} 67





}
}