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