/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.PayCostsInfo model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.PayCostsInfo model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.PayCostsInfo> DataTableToList(DataTable dt) { List <Hownet.Model.PayCostsInfo> modelList = new List <Hownet.Model.PayCostsInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.PayCostsInfo model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.PayCostsInfo(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } else { model.ID = 0; } if (dt.Rows[n]["MainID"].ToString() != "") { model.MainID = int.Parse(dt.Rows[n]["MainID"].ToString()); } else { model.MainID = 0; } if (dt.Rows[n]["EmployeeID"].ToString() != "") { model.EmployeeID = int.Parse(dt.Rows[n]["EmployeeID"].ToString()); } else { model.EmployeeID = 0; } if (dt.Rows[n]["Money"].ToString() != "") { model.Money = decimal.Parse(dt.Rows[n]["Money"].ToString()); } else { model.Money = 0; } model.Remark = dt.Rows[n]["Remark"].ToString(); if (dt.Rows[n]["IsDeposit"].ToString() != "") { if ((dt.Rows[n]["IsDeposit"].ToString() == "1") || (dt.Rows[n]["IsDeposit"].ToString().ToLower() == "true")) { model.IsDeposit = true; } else { model.IsDeposit = false; } } model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }