| | |
| | | <Compile Include="db\PostgreHelper.cs" /> |
| | | <Compile Include="db\PubDBHelper.cs" /> |
| | | <Compile Include="db\SQLiteHelper.cs" /> |
| | | <Compile Include="db\TaskDBHelper.cs" /> |
| | | <Compile Include="Global.asax.cs"> |
| | | <DependentUpon>Global.asax</DependentUpon> |
| | | </Compile> |
对比新文件 |
| | |
| | | 锘縰sing ExportMap.cs; |
| | | using ExportMap.Models; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.Common; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace ExportMap.db |
| | | { |
| | | public class TaskDBHelper |
| | | { |
| | | /// <summary> |
| | | /// 鏍规嵁ID闆嗗悎鏌ヨ |
| | | /// </summary> |
| | | public static List<SysTask> selectByIds(List<int> ids) |
| | | { |
| | | string sql = string.Format("select * from lf.sys_task where id in ({0}) order by id desc", string.Join(",", ids.ToArray())); |
| | | |
| | | DataTable dt = SQLiteHelper.GetDataTable(sql); |
| | | List<SysTask> list = ModelHandler.FillModel<SysTask>(dt); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 鎻掑叆浠诲姟 |
| | | /// </summary> |
| | | public static int insert(SysTask task) |
| | | { |
| | | string sql = "insert into lf.sys_task (name, status, type, descr, err, ip, pid, gids, depcode, dircode, create_user) values (@name, @status, @type, @descr, @err, @ip, @pid, @gids, @depcode, @dircode, @create_user)"; |
| | | |
| | | List<DbParameter> list = Tools.GetParams<SysTask>(sql, task); |
| | | |
| | | object obj = Tools.DBHelper.GetScalar(sql, list.ToArray()); |
| | | |
| | | return obj == null ? 0 : Convert.ToInt32(obj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 鏇存柊浠诲姟 |
| | | /// </summary> |
| | | public static int update(SysTask task) |
| | | { |
| | | string sql = "update lf.sys_task set name=@name, status=@status, type=@type, descr=@descr, err=@err, ip=@ip, pid=@pid, gids=@gids, depcode=@depcode, dircode=@dircode, update_user=@update_user, update_time=now() where id=@id"; |
| | | |
| | | List<DbParameter> list = Tools.GetParams<SysTask>(sql, task); |
| | | |
| | | object obj = Tools.DBHelper.GetScalar(sql, list.ToArray()); |
| | | |
| | | return obj == null ? 0 : Convert.ToInt32(obj); |
| | | } |
| | | } |
| | | } |