Ejemplo n.º 1
0
        public bool SaveCouponActivityWebConfig(WebCouponActivity configObject, string userName)
        {
            bool result = false;

            try
            {
                if (configObject != null)
                {
                    configObject.PromotionDescription = string.Empty;
                    configObject.PromotionCodeChannel = string.Empty;
                    result = DbGungnirManager.Execute(conn => handler.SaveCouponActivityWebConfig(conn, configObject, userName));
                    if (result)
                    {
                        var key = configObject.ActivityId == -1 ? configObject.ActivityKey?.ToString() : configObject.ActivityId.ToString();
                        using (var client = new Service.Config.CacheClient())
                        {
                            var serviceResult = client.RemoveRedisCacheKey("Config1", $"WebCouponActivity/{key}");
                            serviceResult.ThrowIfException(true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                var exception = new ActivityException(1, "SaveCouponActivityWebConfig", ex);
                Logger.Error("SaveCouponActivityWebConfig", exception);
                throw ex;
            }
            return(result);
        }
Ejemplo n.º 2
0
 public ActivityBuild GetActivityBuildById(int id)
 {
     try
     {
         return(handlerReadonly.GetActivityBuildById(id));
     }
     catch (Exception ex)
     {
         var exception = new ActivityException(1, "GetActivityBuildById", ex);
         Logger.Error("GetActivityBuildById", exception);
         throw ex;
     }
 }
Ejemplo n.º 3
0
 public bool UpdateActivityBuild(ActivityBuild model, int id)
 {
     try
     {
         return(handler.UpdateActivityBuild(model, id));
     }
     catch (Exception ex)
     {
         var exception = new ActivityException(1, "UpdateActivityBuild", ex);
         Logger.Error("UpdateActivityBuild", exception);
         throw ex;
     }
 }
Ejemplo n.º 4
0
 public bool DeleteActivityBuild(int id)
 {
     try
     {
         return(handler.DeleteActivityBuild(id));
     }
     catch (Exception ex)
     {
         var exception = new ActivityException(1, "DeleteActivityBuild", ex);
         Logger.Error("DeleteActivityBuild", exception);
         throw ex;
     }
 }
Ejemplo n.º 5
0
 public bool InsertActivityBuild(ActivityBuild model)
 {
     try
     {
         return(handler.InsertActivityBuild(model));
     }
     catch (Exception ex)
     {
         var exception = new ActivityException(1, "InsertActivityBuild", ex);
         Logger.Error("InsertActivityBuild", exception);
         throw ex;
     }
 }
Ejemplo n.º 6
0
 public List <ActivityBuild> GetActivityBuild(string sqlStr, int pageSize, int pageIndex, out int recordCount)
 {
     try
     {
         return(handlerReadonly.GetActivityBuild(sqlStr, pageSize, pageIndex, out recordCount));
     }
     catch (Exception ex)
     {
         var exception = new ActivityException(1, "GetActivityBuild", ex);
         Logger.Error("GetActivityBuild", exception);
         throw ex;
     }
 }
 /// <summary>
 /// 工厂店投放-excel导出
 /// </summary>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <returns></returns>
 public List <StarRatingStoreModel> GetStarList(string startTime, string endTime)
 {
     try
     {
         return(DataAccess.DAO.DALStarRatingStore.GetStarList(startTime, endTime));
     }
     catch (Exception ex)
     {
         var exception = new ActivityException(1, "GetStarList", ex);
         Logger.Error("GetStarList", exception);
         throw ex;
     }
 }
 /// <summary>
 /// 工厂店投放-查看详情
 /// </summary>
 /// <param name="PKID"></param>
 /// <returns></returns>
 public StarRatingStoreModel GetStarRatingStoreModel(int PKID)
 {
     try
     {
         return(DataAccess.DAO.DALStarRatingStore.GetStarRatingStoreModel(PKID));
     }
     catch (Exception ex)
     {
         var exception = new ActivityException(1, "GetStarRatingStoreModel", ex);
         Logger.Error("GetStarRatingStoreModel", exception);
         throw ex;
     }
 }
 /// <summary>
 /// 工厂店投放-获取某个时间段的工厂店列表
 /// </summary>
 /// <param name="recordCount"></param>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="pageSize"></param>
 /// <param name="pageIndex"></param>
 /// <returns></returns>
 public List <StarRatingStoreModel> GetStarRatingStoreList(out int recordCount, string startTime, string endTime, int pageSize = 10, int pageIndex = 1)
 {
     try
     {
         return(DataAccess.DAO.DALStarRatingStore.GetStarRatingStoreList(out recordCount, startTime, endTime, pageSize, pageIndex));
     }
     catch (Exception ex)
     {
         var exception = new ActivityException(1, "GetStarRatingStoreList", ex);
         Logger.Error("GetStarRatingStoreList", exception);
         throw ex;
     }
 }
Ejemplo n.º 10
0
        public bool DeleteActivityConfig(string type, string id, string userName)
        {
            bool result = false;

            try
            {
                result = DbGungnirManager.Execute(conn => handler.DeleteActivityConfig(conn, type, id, userName));
            }
            catch (Exception ex)
            {
                var exception = new ActivityException(1, "DeleteActivityConfig", ex);
                Logger.Error("DeleteActivityConfig", exception);
                throw ex;
            }
            return(result);
        }
Ejemplo n.º 11
0
        public Tuple <int, List <CouponActivity> > GetActivityList(string type, int pageSize, int pageIndex)
        {
            Tuple <int, List <CouponActivity> > result = null;

            try
            {
                result = DbGungnirReadOnlyManager.Execute(conn => handler.GetActivityList(conn, type, pageSize, pageIndex));
            }
            catch (Exception ex)
            {
                var exception = new ActivityException(1, "GetActivityList", ex);
                Logger.Error("GetActivityList", exception);
                throw ex;
            }
            return(result);
        }
Ejemplo n.º 12
0
        public bool SaveCouponActivityConfig(CouponActivity configObject, string userName)
        {
            bool result = false;

            try
            {
                result = DbGungnirManager.Execute(conn => handler.SaveCouponActivityConfig(conn, configObject, userName));
            }
            catch (Exception ex)
            {
                var exception = new ActivityException(1, "SaveCouponActivityConfig", ex);
                Logger.Error("SaveCouponActivityConfig", exception);
                throw ex;
            }
            return(result);
        }
Ejemplo n.º 13
0
        public WebCouponActivity GetCurrentWebCouponActivity(string id)
        {
            WebCouponActivity result = null;

            try
            {
                result = DbGungnirReadOnlyManager.Execute(conn => handler.GetCurrentWebCouponActivity(conn, id)) ?? new WebCouponActivity()
                {
                    ActivityId  = -1,
                    ActivityKey = new Guid(Guid.NewGuid().ToString("N")),
                    StartDate   = DateTime.Today,
                    EndDate     = DateTime.Today
                };
            }
            catch (Exception ex)
            {
                var exception = new ActivityException(1, "GetCurrentWebCouponActivity", ex);
                Logger.Error("GetCurrentWebCouponActivity", exception);
            }

            return(result);
        }