Ejemplo n.º 1
0
        /// <summary>
        /// 新的 日志 记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool ADDCommonConfigLogInfo(CommonConfigLogModel model)
        {
            var connString = ConfigurationManager.ConnectionStrings["Tuhu_log"].ConnectionString;

            using (var conn = new SqlConnection(connString))
            {
                return(dal.ADDCommonConfigLogInfo(conn, model));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 新的 日志 记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddCommonConfigLogInfo(CommonConfigLogModel model)
        {
            var connString = ConfigurationManager.ConnectionStrings["Tuhu_log"].ConnectionString;

            if (string.IsNullOrWhiteSpace(model.CreateDateTime))
            {
                model.CreateDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            if (string.IsNullOrWhiteSpace(model.LastUpdateDateTime))
            {
                model.LastUpdateDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            using (var conn = new SqlConnection(connString))
            {
                return(dal.ADDCommonConfigLogInfo(conn, model));
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// ADD 日志
 /// </summary>
 /// <param name="conn"></param>
 /// <param name="id"></param>
 /// <returns></returns>
 public bool ADDCommonConfigLogInfo(SqlConnection conn, CommonConfigLogModel model)
 {
     #region SQL
     string sql = @"insert into   [Tuhu_log].[dbo].[CommonConfigLog]
                           ([ObjectId]
                           ,[ObjectType]
                           ,[BeforeValue]
                           ,[AfterValue]
                           ,[Remark]
                           ,[Creator]
                           ,[CreateDateTime]
                           ,[LastUpdateDateTime])
                    Values( @ObjectId
                           ,@ObjectType
                           ,@BeforeValue
                           ,@AfterValue
                           ,@Remark
                           ,@Creator
                           ,@CreateDateTime
                           ,@LastUpdateDateTime)";
     #endregion );
     return(conn.Execute(sql, model) > 0);
 }