public bool UpdateBaoYangActivitySettingItem(BaoYangActivitySettingItem model) { try { if (DalBaoYangActivitySetting.UpdateBaoYangActivitySettingItem(model)) { using (var client = new CacheClient()) { client.UpdateBaoYangActivityAsync(DalBaoYangActivitySetting.GetUpkeepActivitySettingById(model.BaoYangActivityId).ActivityNum); } return(true); } else { return(false); } } catch (TuhuBizException) { throw; } catch (Exception ex) { Logger.Error("UpdateBaoYangActivitySettingItem", ex); throw ex; } }
public bool InsertBaoYangActivitySettingItem(BaoYangActivitySettingItem model, string actId) { try { if (DalBaoYangActivitySetting.InsertBaoYangActivitySettingItem(model)) { using (var client = new CacheClient()) { client.UpdateBaoYangActivityAsync(actId); } return(true); } else { return(false); } } catch (TuhuBizException) { throw; } catch (Exception ex) { Logger.Error("InsertBaoYangActivitySettingItem", ex); throw ex; } }
/// <summary> /// 插入保养活动关联配置 /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool InsertBaoYangActivitySettingItem(BaoYangActivitySettingItem model) { const string sql = @"INSERT INTO BaoYang..[BaoYangActivitySettingItem] ( [BaoYangActivityId] ,[ServicePackagesType] ,[ServicePackagesItems] ,[ServicePackagesName] ,[ServiceType] ,[ServiceCatalog] ,[ServiceCatalogName] ,[Brands] ,[Series] ,[Products] ,[InAdapteTipPrefix] ,[CreateTime] ,[UpdateTime] ,[Grades] )VALUES ( @BaoYangActivityId ,@ServicePackagesType ,@ServicePackagesItems ,@ServicePackagesName ,@ServiceType ,@ServiceCatalog ,@ServiceCatalogName ,@Brands ,@Series ,@Products ,@InAdapteTipPrefix ,GETDATE() ,GETDATE() ,@Grades )"; var sqlParameters = new SqlParameter[] { new SqlParameter("@BaoYangActivityId", model.BaoYangActivityId), new SqlParameter("@Brands", model.Brands ?? string.Empty), new SqlParameter("@Products", model.Products ?? string.Empty), new SqlParameter("@Series", model.Series ?? string.Empty), new SqlParameter("@ServiceCatalog", model.ServiceCatalog ?? string.Empty), new SqlParameter("@ServiceCatalogName", model.ServiceCatalogName ?? string.Empty), new SqlParameter("@ServicePackagesItems", model.ServicePackagesItems ?? string.Empty), new SqlParameter("@ServicePackagesName", model.ServicePackagesName ?? string.Empty), new SqlParameter("@ServicePackagesType", model.ServicePackagesType ?? string.Empty), new SqlParameter("@ServiceType", model.ServiceType ?? string.Empty), new SqlParameter("@InAdapteTipPrefix", model.InAdapteTipPrefix ?? string.Empty), new SqlParameter("@Grades", model.Grades ?? string.Empty) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, sqlParameters) > 0); }
public ActionResult UpdateItem(int id = 0) { if (id == 0) { return(View(new BaoYangActivitySettingItem())); } else { BaoYangActivitySettingItem model = BaoYangActivitySettingManager.GetBaoYangActivitySettingItemById(id); switch (model.ServicePackagesType) { case "ffdyn": ViewBag.BrandList = BrandItem("Dynamo"); ViewBag.SerieList = SeriesList("Dynamo"); break; case "dyn": ViewBag.BrandList = BrandItem("Dynamo"); ViewBag.SerieList = SeriesList("Dynamo"); break; case "ys": ViewBag.BrandList = BrandItem("Wiper"); ViewBag.SerieList = SeriesList("Wiper"); break; case "scp": ViewBag.BrandList = BrandItem("BrakePad"); ViewBag.SerieList = SeriesList("BrakePad"); break; case "scpan": ViewBag.BrandList = BrandItem("BrakeDisc"); ViewBag.SerieList = SeriesList("BrakeDisc"); break; default: ViewBag.BrandList = BrandItem(model.ServiceCatalog); ViewBag.SerieList = SeriesList(model.ServiceCatalog); break; } return(View(model)); } }
public static bool UpdateBaoYangActivitySettingItem(BaoYangActivitySettingItem model) { const string sql = @" UPDATE [BaoYang].[dbo].[BaoYangActivitySettingItem] SET [Brands] = @Brands , [Series] = @Series , [Products] = @Products , [InAdapteTipPrefix] = @InAdapteTipPrefix , [UpdateTime] = GETDATE() WHERE Id = @Id"; var sqlParameters = new SqlParameter[] { new SqlParameter("@Brands", model.Brands ?? string.Empty), new SqlParameter("@Id", model.Id), new SqlParameter("@Products", model.Products ?? string.Empty), new SqlParameter("@Series", model.Series ?? string.Empty), new SqlParameter("@InAdapteTipPrefix", model.InAdapteTipPrefix ?? string.Empty) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, sqlParameters) > 0); }
public ActionResult UpdateBaoYangActivitySettingItem(BaoYangActivitySettingItem model) { return(Json(BaoYangActivitySettingManager.UpdateBaoYangActivitySettingItem(model))); }