/// <summary> /// 获得数据列表 /// </summary> public List<ForKids.DB.Model.KIDPAYMENT> DataTableToList(DataTable dt) { List<ForKids.DB.Model.KIDPAYMENT> modelList = new List<ForKids.DB.Model.KIDPAYMENT>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ForKids.DB.Model.KIDPAYMENT model; for (int n = 0; n < rowsCount; n++) { model = new ForKids.DB.Model.KIDPAYMENT(); if(dt.Rows[n]["ID"]!=null && dt.Rows[n]["ID"].ToString()!="") { model.ID=int.Parse(dt.Rows[n]["ID"].ToString()); } if(dt.Rows[n]["KIDID"]!=null && dt.Rows[n]["KIDID"].ToString()!="") { //model.KIDID=dt.Rows[n]["KIDID"].ToString(); } if(dt.Rows[n]["CHARGEID"]!=null && dt.Rows[n]["CHARGEID"].ToString()!="") { //model.CHARGEID=dt.Rows[n]["CHARGEID"].ToString(); } if(dt.Rows[n]["PAYMENT"]!=null && dt.Rows[n]["PAYMENT"].ToString()!="") { //model.PAYMENT=dt.Rows[n]["PAYMENT"].ToString(); } if(dt.Rows[n]["PAYDATE"]!=null && dt.Rows[n]["PAYDATE"].ToString()!="") { model.PAYDATE=DateTime.Parse(dt.Rows[n]["PAYDATE"].ToString()); } modelList.Add(model); } } return modelList; }
/// <summary> /// 获得数据列表 /// </summary> public List <ForKids.DB.Model.KIDPAYMENT> DataTableToList(DataTable dt) { List <ForKids.DB.Model.KIDPAYMENT> modelList = new List <ForKids.DB.Model.KIDPAYMENT>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ForKids.DB.Model.KIDPAYMENT model; for (int n = 0; n < rowsCount; n++) { model = new ForKids.DB.Model.KIDPAYMENT(); if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["KIDID"] != null && dt.Rows[n]["KIDID"].ToString() != "") { model.KIDID = int.Parse(dt.Rows[n]["KIDID"].ToString()); } if (dt.Rows[n]["CHARGEID"] != null && dt.Rows[n]["CHARGEID"].ToString() != "") { model.CHARGEID = int.Parse(dt.Rows[n]["CHARGEID"].ToString()); } if (dt.Rows[n]["PAYMENT"] != null && dt.Rows[n]["PAYMENT"].ToString() != "") { model.PAYMENT = double.Parse(dt.Rows[n]["PAYMENT"].ToString()); } if (dt.Rows[n]["PAYDATE"] != null && dt.Rows[n]["PAYDATE"].ToString() != "") { model.PAYDATE = DateTime.Parse(dt.Rows[n]["PAYDATE"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(ForKids.DB.Model.KIDPAYMENT model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(ForKids.DB.Model.KIDPAYMENT model) { return(dal.Add(model)); }