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