Commit 386643f5 authored by 黄奎's avatar 黄奎

代码优化

parent 8931b245
......@@ -8,7 +8,7 @@ namespace Mall.CacheManager.AppletWeChat
{
public class WeiXinReidsCache
{
static RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_WeiXinToken);
static readonly RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_WeiXinToken);
/// <summary>
/// 设置缓存
/// </summary>
......
......@@ -12,7 +12,7 @@ namespace Mall.CacheManager.ByteDance
public class ByteDanceRedis
{
static RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
static readonly RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
/// <summary>
/// 获取微信用的formID
/// </summary>
......
......@@ -16,7 +16,7 @@ namespace Mall.Module.BaseSetUp
/// </summary>
public class DestinationModule
{
private Rb_destinationRepository rb_DestinationRepository = new Rb_destinationRepository();
private readonly Rb_destinationRepository rb_DestinationRepository = new Rb_destinationRepository();
/// <summary>
/// 根据父节点编号获取子列表
......@@ -48,7 +48,7 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool Set(RB_Destination model)
{
var flag = false;
bool flag;
if (model.ID > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -15,21 +15,21 @@ namespace Mall.Module.BaseSetUp
{
public class MallBaseModule
{
private RB_MiniProgramRepository miniProgramRepository = new RB_MiniProgramRepository();
private RB_MallBaseRepository mallBaseRepository = new RB_MallBaseRepository();
private RB_LogisticsRepository logisticsRepository = new RB_LogisticsRepository();
private RB_Logistics_RulesPriceRepository logisticsRulesPriceRepository = new RB_Logistics_RulesPriceRepository();
private RB_Logistics_RulesRegionRepository logisticsRulesRegionRepository = new RB_Logistics_RulesRegionRepository();
private RB_Logistics_RulesRepository logisticsRulesRepository = new RB_Logistics_RulesRepository();
private RB_Logistics_DeliveryRepository deliveryRepository = new RB_Logistics_DeliveryRepository();
private RB_Logistics_ExpressRepository expressRepository = new RB_Logistics_ExpressRepository();
private RB_ElectronicSheetRepository electronicSheetRepository = new RB_ElectronicSheetRepository();
private readonly RB_MiniProgramRepository miniProgramRepository = new RB_MiniProgramRepository();
private readonly RB_MallBaseRepository mallBaseRepository = new RB_MallBaseRepository();
private readonly RB_LogisticsRepository logisticsRepository = new RB_LogisticsRepository();
private readonly RB_Logistics_RulesPriceRepository logisticsRulesPriceRepository = new RB_Logistics_RulesPriceRepository();
private readonly RB_Logistics_RulesRegionRepository logisticsRulesRegionRepository = new RB_Logistics_RulesRegionRepository();
private readonly RB_Logistics_RulesRepository logisticsRulesRepository = new RB_Logistics_RulesRepository();
private readonly RB_Logistics_DeliveryRepository deliveryRepository = new RB_Logistics_DeliveryRepository();
private readonly RB_Logistics_ExpressRepository expressRepository = new RB_Logistics_ExpressRepository();
private readonly RB_ElectronicSheetRepository electronicSheetRepository = new RB_ElectronicSheetRepository();
private RB_File_StoreRepository storeRepository = new RB_File_StoreRepository();
private RB_FreeShippingCategoryRepository freeShippingCategoryRepository = new RB_FreeShippingCategoryRepository();
private RB_FreeShippingRepository freeShippingRepository = new RB_FreeShippingRepository();
private readonly RB_File_StoreRepository storeRepository = new RB_File_StoreRepository();
private readonly RB_FreeShippingCategoryRepository freeShippingCategoryRepository = new RB_FreeShippingCategoryRepository();
private readonly RB_FreeShippingRepository freeShippingRepository = new RB_FreeShippingRepository();
private RB_MicroShop_BasicsRepository microShopBasicsRepository = new RB_MicroShop_BasicsRepository();
private readonly RB_MicroShop_BasicsRepository microShopBasicsRepository = new RB_MicroShop_BasicsRepository();
......@@ -79,8 +79,8 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool AddOrUpdateMallBase(RB_MallBase_Extend model)
{
bool flag = false;
var trans = mallBaseRepository.DbTransaction;
bool flag;
try
{
if (model.ID == 0)
......@@ -196,8 +196,10 @@ namespace Mall.Module.BaseSetUp
}
else
{
model = new RB_Logistics_Rules_Extend();
model.Detail = new List<RB_Logistics_RulesPrice_Extend>();
model = new RB_Logistics_Rules_Extend
{
Detail = new List<RB_Logistics_RulesPrice_Extend>()
};
}
return model;
}
......@@ -206,8 +208,8 @@ namespace Mall.Module.BaseSetUp
public bool SetDefaultLogisticsRules(RB_Logistics_Rules_Extend query)
{
bool flag = false;
var trans = logisticsRulesRepository.DbTransaction;
bool flag;
try
{
IDictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -393,8 +395,8 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool DelRulesInfo(int id, int uid, int mallBaseId)
{
bool flag = false;
var trans = logisticsRulesRepository.DbTransaction;
bool flag;
try
{
Dictionary<string, object> cols = new Dictionary<string, object>()
......@@ -586,8 +588,8 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool DelPinkageInfo(int id, int uid, int mallBaseId)
{
bool flag = false;
var trans = logisticsRulesRepository.DbTransaction;
bool flag;
try
{
Dictionary<string, object> cols = new Dictionary<string, object>()
......@@ -1137,8 +1139,8 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool DelFreeShipping(int id, int uid, int mallBaseId)
{
bool flag = false;
var trans = freeShippingRepository.DbTransaction;
bool flag;
try
{
Dictionary<string, object> cols = new Dictionary<string, object>()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment