Beispiel #1
0
        public PromotionEN GetActivePromotion(int pCountryID)
        {
            PromotionEN promo = new PromotionEN();

            try
            {
                promo = promoDAL.GetActivePromotion(pCountryID);
            }
            catch (Exception ex)
            {
                promo = null;
                Console.WriteLine(ex.InnerException);
                EventViewerLoggerBL.LogError("GetActivePromotion: " + ex.Message);
            }

            return(promo);
        }
        public PromotionsResponse CreatePromosResponse(PromotionEN pPromo)
        {
            PromotionsResponse response = new PromotionsResponse();

            try
            {
                response.description = pPromo.Description;
                response.Method      = pPromo.HttpMethod;
                response.Operator    = pPromo.OperatorBrand;
                response.Tittle      = pPromo.Title;
                response.URL         = pPromo.URL;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            return(response);
        }
        public PromotionEN GetActivePromotion(int pCountryID)
        {
            PromotionEN promo = new PromotionEN();

            try
            {
                connection.Cnn.Close();
                promo = connection.Cnn.Query <PromotionEN>("SpGetPromotions", new { countryID = pCountryID },
                                                           commandType: CommandType.StoredProcedure).FirstOrDefault();
            }
            catch (Exception ex)
            {
                promo = null;
                Console.WriteLine(ex.InnerException);
                EventViewerLoggerDAL.LogError("GetActivePromotion: " + ex.Message);
            }
            finally
            {
                connection.Cnn.Close();
            }

            return(promo);
        }