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