/// <summary> /// 增加一条数据 /// </summary> public int Add(lgk.Model.tb_OrderInvest model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(lgk.Model.tb_OrderInvest model) { return(dal.Update(model)); }
/// <summary> /// 获得数据列表 /// </summary> public List <lgk.Model.tb_OrderInvest> DataTableToList(DataTable dt) { List <lgk.Model.tb_OrderInvest> modelList = new List <lgk.Model.tb_OrderInvest>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { lgk.Model.tb_OrderInvest model; for (int n = 0; n < rowsCount; n++) { model = new lgk.Model.tb_OrderInvest(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["GetDays"].ToString() != "") { model.GetDays = int.Parse(dt.Rows[n]["GetDays"].ToString()); } if (dt.Rows[n]["GetInterest"].ToString() != "") { model.GetInterest = decimal.Parse(dt.Rows[n]["GetInterest"].ToString()); } if (dt.Rows[n]["UserID"].ToString() != "") { model.UserID = long.Parse(dt.Rows[n]["UserID"].ToString()); } model.OrderCode = dt.Rows[n]["OrderCode"].ToString(); if (dt.Rows[n]["AccountType"].ToString() != "") { model.AccountType = int.Parse(dt.Rows[n]["AccountType"].ToString()); } if (dt.Rows[n]["InvestType"].ToString() != "") { model.InvestType = int.Parse(dt.Rows[n]["InvestType"].ToString()); } if (dt.Rows[n]["Amount"].ToString() != "") { model.Amount = decimal.Parse(dt.Rows[n]["Amount"].ToString()); } if (dt.Rows[n]["AddTime"].ToString() != "") { model.AddTime = DateTime.Parse(dt.Rows[n]["AddTime"].ToString()); } if (dt.Rows[n]["OutType"].ToString() != "") { model.OutType = int.Parse(dt.Rows[n]["OutType"].ToString()); } if (dt.Rows[n]["OutTime"].ToString() != "") { model.OutTime = DateTime.Parse(dt.Rows[n]["OutTime"].ToString()); } if (dt.Rows[n]["ReleasedPhase"].ToString() != "") { model.ReleasedPhase = decimal.Parse(dt.Rows[n]["ReleasedPhase"].ToString()); } modelList.Add(model); } } return(modelList); }