/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail> DataTableToList(DataTable dt) { List <MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail> modelList = new List <MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail(); model.RpdCode = dt.Rows[n]["RpdCode"].ToString(); model.ReceiptCode = dt.Rows[n]["ReceiptCode"].ToString(); model.ResourcesID = long.Parse(dt.Rows[n]["ResourcesID"].ToString()); if (dt.Rows[n]["Quantity"].ToString() != "") { model.Quantity = int.Parse(dt.Rows[n]["Quantity"].ToString()); } if (dt.Rows[n]["SalesPrice"].ToString() != "") { model.SalesPrice = decimal.Parse(dt.Rows[n]["SalesPrice"].ToString()); } if (dt.Rows[n]["DiscountPrice"].ToString() != "") { model.DiscountPrice = decimal.Parse(dt.Rows[n]["DiscountPrice"].ToString()); } if (dt.Rows[n]["MemberDiscountPrice"].ToString() != "") { model.MemberDiscountPrice = decimal.Parse(dt.Rows[n]["MemberDiscountPrice"].ToString()); } if (dt.Rows[n]["GroupPrice"].ToString() != "") { model.GroupPrice = decimal.Parse(dt.Rows[n]["GroupPrice"].ToString()); } if (dt.Rows[n]["DetailAmount"].ToString() != "") { model.DetailAmount = decimal.Parse(dt.Rows[n]["DetailAmount"].ToString()); } model.RpdMemo = dt.Rows[n]["RpdMemo"].ToString(); if (dt.Rows[n]["RpdIsDelete"].ToString() != "") { model.RpdIsDelete = int.Parse(dt.Rows[n]["RpdIsDelete"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail model) { dal.Add(model); }