/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.SalesPrice model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.SalesPrice model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.SalesPrice> DataTableToList(DataTable dt) { List <Hownet.Model.SalesPrice> modelList = new List <Hownet.Model.SalesPrice>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.SalesPrice model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.SalesPrice(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } else { model.ID = 0; } if (dt.Rows[n]["MTID"].ToString() != "") { model.MTID = int.Parse(dt.Rows[n]["MTID"].ToString()); } else { model.MTID = 0; } if (dt.Rows[n]["Price"].ToString() != "") { model.Price = decimal.Parse(dt.Rows[n]["Price"].ToString()); } else { model.Price = 0; } if (dt.Rows[n]["SalesID"].ToString() != "") { model.SalesID = int.Parse(dt.Rows[n]["SalesID"].ToString()); } else { model.SalesID = 0; } if (dt.Rows[n]["Amount"].ToString() != "") { model.Amount = int.Parse(dt.Rows[n]["Amount"].ToString()); } else { model.Amount = 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(); model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }