/// <summary> /// 获得数据列表 /// </summary> public List <JMP.MDL.jmp_app_request_audit> DataTableToList(DataTable dt) { List <JMP.MDL.jmp_app_request_audit> modelList = new List <JMP.MDL.jmp_app_request_audit>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { JMP.MDL.jmp_app_request_audit model; for (int n = 0; n < rowsCount; n++) { model = new JMP.MDL.jmp_app_request_audit(); if (dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } if (dt.Rows[n]["app_id"].ToString() != "") { model.app_id = int.Parse(dt.Rows[n]["app_id"].ToString()); } model.app_name = dt.Rows[n]["app_name"].ToString(); model.message = dt.Rows[n]["message"].ToString(); if (dt.Rows[n]["created_on"].ToString() != "") { model.created_on = DateTime.Parse(dt.Rows[n]["created_on"].ToString()); } if (dt.Rows[n]["is_processed"].ToString() != "") { model.is_processed = int.Parse(dt.Rows[n]["is_processed"].ToString()); } if (dt.Rows[n]["processed_time"].ToString() != "") { model.processed_time = DateTime.Parse(dt.Rows[n]["processed_time"].ToString()); } model.processed_by = dt.Rows[n]["processed_by"].ToString(); model.processed_result = dt.Rows[n]["processed_result"].ToString(); if (dt.Rows[n]["message_send_time"].ToString() != "") { model.message_send_time = DateTime.Parse(dt.Rows[n]["message_send_time"].ToString()); } if (dt.Rows[n]["is_send_message"].ToString() != "") { model.is_send_message = int.Parse(dt.Rows[n]["is_send_message"].ToString()); } if (dt.Rows[n]["type"].ToString() != "") { model.type = int.Parse(dt.Rows[n]["type"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JMP.MDL.jmp_app_request_audit model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(JMP.MDL.jmp_app_request_audit model) { dal.Add(model); }