/// <summary> /// 获得数据列表 /// </summary> public List <lgk.Model.tb_PacketReceive> DataTableToList(DataTable dt) { List <lgk.Model.tb_PacketReceive> modelList = new List <lgk.Model.tb_PacketReceive>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { lgk.Model.tb_PacketReceive model; for (int n = 0; n < rowsCount; n++) { model = new lgk.Model.tb_PacketReceive(); if (dt.Rows[n]["ReceiveID"].ToString() != "") { model.ReceiveID = long.Parse(dt.Rows[n]["ReceiveID"].ToString()); } if (dt.Rows[n]["PackID"].ToString() != "") { model.PackID = long.Parse(dt.Rows[n]["PackID"].ToString()); } if (dt.Rows[n]["Amount"].ToString() != "") { model.Amount = decimal.Parse(dt.Rows[n]["Amount"].ToString()); } if (dt.Rows[n]["ReceiveFlag"].ToString() != "") { model.ReceiveFlag = int.Parse(dt.Rows[n]["ReceiveFlag"].ToString()); } if (dt.Rows[n]["ReceiveUserID"].ToString() != "") { model.ReceiveUserID = long.Parse(dt.Rows[n]["ReceiveUserID"].ToString()); } if (dt.Rows[n]["ReceiveTime"].ToString() != "") { model.ReceiveTime = DateTime.Parse(dt.Rows[n]["ReceiveTime"].ToString()); } if (dt.Rows[n]["CancelTime"].ToString() != "") { model.CancelTime = DateTime.Parse(dt.Rows[n]["CancelTime"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(lgk.Model.tb_PacketReceive model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public long Add(lgk.Model.tb_PacketReceive model) { return(dal.Add(model)); }