/// <summary> /// 修改DianZanLogInfo /// </summary> /// <param name="dianzanlog"></param> /// <returns></returns> public static int UpdateDianZanLog(DianZanLogInfo dianzanlog) { string sql = @"UPDATE [DianZanLog] SET MId=@MId, CId=@CId, UserId=@UserId, Ip=@Ip, IsCancel=@IsCancel, CancelTime=@CancelTime, Type=@Type, CreateTime=@CreateTime WHERE Id=@Id"; var par = new DynamicParameters(); par.Add("@Id", dianzanlog.Id, DbType.Int64); par.Add("@MId", dianzanlog.MId, DbType.Int64); par.Add("@CId", dianzanlog.CId, DbType.Int64); par.Add("@UserId", dianzanlog.UserId, DbType.Int32); par.Add("@Ip", dianzanlog.Ip, DbType.AnsiString); par.Add("@IsCancel", dianzanlog.IsCancel, DbType.Boolean); par.Add("@CancelTime", dianzanlog.CancelTime, DbType.DateTime); par.Add("@Type", dianzanlog.Type, DbType.Int16); par.Add("@CreateTime", dianzanlog.CreateTime, DbType.DateTime); return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par)); }
/// <summary> /// 添加DianZanLogInfo /// </summary> /// <param name="dianzanlog"></param> /// <returns></returns> public static long AddDianZanLog(DianZanLogInfo dianzanlog) { string sql = @"INSERT INTO [DianZanLog] ([MId],[CId],[UserId],[Ip],[Type]) VALUES (@MId,@CId,@UserId,@Ip,@Type) SELECT SCOPE_IDENTITY() " ; var par = new DynamicParameters(); par.Add("@MId", dianzanlog.MId, DbType.Int64); par.Add("@CId", dianzanlog.CId, DbType.Int64); par.Add("@UserId", dianzanlog.UserId, DbType.Int32); par.Add("@Ip", dianzanlog.Ip, DbType.AnsiString); par.Add("@Type", dianzanlog.Type, DbType.Int16); return(DapWrapper.InnerQueryScalarSql <long>(DbConfig.ArticleManagerConnString, sql, par)); }
/// <summary> /// DataModel 转 ViewModel /// </summary> /// <param name="dianzanlog"></param> /// <returns></returns> public static DianZanLogVModel DianZanLogInfoToVModel(DianZanLogInfo dianzanlog) { if (dianzanlog == null) { return(new DianZanLogVModel()); } return(new DianZanLogVModel { Id = dianzanlog.Id, MId = dianzanlog.MId, CId = dianzanlog.CId, UserId = dianzanlog.UserId, Ip = dianzanlog.Ip, IsCancel = dianzanlog.IsCancel, CancelTime = dianzanlog.CancelTime, Type = dianzanlog.Type, CreateTime = dianzanlog.CreateTime }); }
/// <summary> /// 修改DianZanLogInfo /// </summary> /// <param name="dianzanlog"></param> /// <returns></returns> public static int UpdateDianZanLog(DianZanLogInfo dianzanlog) { return(DataProvider.DianZanLogs.UpdateDianZanLog(dianzanlog)); }
/// <summary> /// 添加DianZanLogInfo /// </summary> /// <param name="dianzanlog"></param> /// <returns></returns> public static long AddDianZanLog(DianZanLogInfo dianzanlog) { return(DataProvider.DianZanLogs.AddDianZanLog(dianzanlog)); }