/// <summary> /// 获得数据列表 /// </summary> public List <JMP.MDL.jmp_sales_pay> DataTableToList(DataTable dt) { List <JMP.MDL.jmp_sales_pay> modelList = new List <JMP.MDL.jmp_sales_pay>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { JMP.MDL.jmp_sales_pay model; for (int n = 0; n < rowsCount; n++) { model = new JMP.MDL.jmp_sales_pay(); if (dt.Rows[n]["r_id"].ToString() != "") { model.r_id = int.Parse(dt.Rows[n]["r_id"].ToString()); } if (dt.Rows[n]["r_paymode"].ToString() != "") { model.r_paymode = int.Parse(dt.Rows[n]["r_paymode"].ToString()); } if (dt.Rows[n]["r_moneys"].ToString() != "") { model.r_moneys = decimal.Parse(dt.Rows[n]["r_moneys"].ToString()); } if (dt.Rows[n]["r_date"].ToString() != "") { model.r_date = DateTime.Parse(dt.Rows[n]["r_date"].ToString()); } if (dt.Rows[n]["r_appid"].ToString() != "") { model.r_appid = int.Parse(dt.Rows[n]["r_appid"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JMP.MDL.jmp_sales_pay model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JMP.MDL.jmp_sales_pay model) { return(dal.Add(model)); }