/// <summary>
        /// 更新模块信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <ActionResult> UpdateModule(CarProductsHomePageModuleConfig model)
        {
            if (model.PKID <= 0)
            {
                return(Json(false));
            }
            var result = _manager.UpdateHomePageModuleConfig(model);

            if (result)
            {
                using (var client = new ConfigLogClient())
                {
                    client.InsertDefaultLogQueue("CommonConfigLog", JsonConvert.SerializeObject(new
                    {
                        ObjectId    = model.PKID,
                        ObjectType  = "CarProductsModule",
                        BeforeValue = JsonConvert.SerializeObject(model),
                        AfterValue  = "",
                        Remark      = "更新",
                        Creator     = User.Identity.Name,
                    }));
                }
                using (var client = new RefreshClient())
                {
                    var refResult = await client.RefreshSelectHomePageConfigAsync();

                    refResult.ThrowIfException(true);
                    return(Json(refResult.Result));
                }
            }

            return(Json(result));
        }
Esempio n. 2
0
 /// <summary>
 /// 更新模块信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateHomePageModuleConfig(CarProductsHomePageModuleConfig model)
 {
     try
     {
         return(DALCarProducts.UpdateHomePageModuleConfig(model));
     }
     catch (Exception ex)
     {
         logger.Error("UpdateHomePageModuleConfig", ex);
     }
     return(false);
 }
Esempio n. 3
0
 /// <summary>
 /// 修改模块信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static bool UpdateHomePageModuleConfig(CarProductsHomePageModuleConfig model)
 {
     using (var conn = new SqlConnection(StrConn))
     {
         const string sql      = @"UPDATE Configuration..CarProductsHomePageModuleConfig
                         SET ModuleName = @ModuleName,IsEnabled = @IsEnabled,UpdateTime = GETDATE()
                         WHERE PKID = @PKID";
         var          sqlPrams = new[]
         {
             new SqlParameter("@ModuleName", model.ModuleName),
             new SqlParameter("@IsEnabled", model.IsEnabled),
             new SqlParameter("@PKID", model.PKID)
         };
         return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, sqlPrams) > 0);
     }
 }