Пример #1
0
        public static void Add(BuyInTimeProductModel action)
        {
            action.Id = ModulesRepository.ModuleExecuteScalar <int>(
                "Insert Into [Module].[" + ModuleName + "]" +
                " (ProductId,DateStart,DateExpired,DiscountInTime,ActionText,ShowMode,IsRepeat,DaysRepeat,Picture,SortOrder) " +
                "Values (@ProductId,@DateStart,@DateExpired,@DiscountInTime,@ActionText,@ShowMode,@IsRepeat,@DaysRepeat,@Picture,@SortOrder); " +
                "Select scope_identity();",
                CommandType.Text,
                new SqlParameter("@ProductId", action.ProductId),
                new SqlParameter("@DateStart", action.DateStart),
                new SqlParameter("@DateExpired", action.DateExpired),
                new SqlParameter("@DiscountInTime", action.DiscountInTime),
                new SqlParameter("@ActionText", action.ActionText),
                new SqlParameter("@ShowMode", action.ShowMode),
                new SqlParameter("@IsRepeat", action.IsRepeat),
                new SqlParameter("@DaysRepeat", action.DaysRepeat),
                new SqlParameter("@Picture", action.Picture ?? (object)DBNull.Value),
                new SqlParameter("@SortOrder", action.SortOrder));

            CacheManager.RemoveByPattern(CacheKey);
        }
Пример #2
0
 public static int GetMarketOrderId(int orderId)
 {
     return(ModulesRepository.ModuleExecuteScalar <int>(
                "Select MarketOrderId From Module.YaMarketOrder Where OrderId = @OrderId", CommandType.Text,
                new SqlParameter("@OrderId", orderId)));
 }