/// <summary> /// 获得数据列表 /// </summary> public List <tdps.Model.UserFunction> DataTableToList(DataTable dt) { List <tdps.Model.UserFunction> modelList = new List <tdps.Model.UserFunction>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { tdps.Model.UserFunction model; for (int n = 0; n < rowsCount; n++) { model = new tdps.Model.UserFunction(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } model.NSRSBH = dt.Rows[n]["NSRSBH"].ToString(); model.DLZH = dt.Rows[n]["DLZH"].ToString(); model.GNBH = dt.Rows[n]["GNBH"].ToString(); if (dt.Rows[n]["SFKY"].ToString() != "") { if ((dt.Rows[n]["SFKY"].ToString() == "1") || (dt.Rows[n]["SFKY"].ToString().ToLower() == "true")) { model.SFKY = "1"; } else { model.SFKY = "0"; } } if (dt.Rows[n]["SFBX"].ToString() != "") { if ((dt.Rows[n]["SFBX"].ToString() == "1") || (dt.Rows[n]["SFBX"].ToString().ToLower() == "true")) { model.SFBX = "1"; } else { model.SFBX = "0"; } } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(tdps.Model.UserFunction model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(tdps.Model.UserFunction model, object trans) { dal.Add(model, trans); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(tdps.Model.UserFunction model) { dal.Add(model); }