public bool AddPromotionSearchHistory(PromotionSearchHistory promotionSearchHistory)
 {
     try
     {
         db.PromotionSearchHistories.InsertOnSubmit(promotionSearchHistory);
         db.SubmitChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }
    public bool AddPromotionSearchHistory(PromotionHistoryFilterOption promotionHistoryFilterOption, string fullName, 
        string customerType, string channel, int groupId, int regionId, int areaId, int localId, int promoId, string searchResults)
    {
        var searchCriteria = string.Empty;
        if (promotionHistoryFilterOption == PromotionHistoryFilterOption.Customer)
        {
            searchCriteria = string.Format(Constant.CustomerPromotionHistoryTemplateString,
                                           (int)PromotionHistoryFilterOption.Customer,
                                           fullName, customerType, channel, groupId, regionId, areaId, localId);
        }
        else
        {
            searchCriteria = string.Format(Constant.CustomerPromotionHistoryTemplateString,
                                           (int)PromotionHistoryFilterOption.Sales,
                                           fullName, groupId, regionId, areaId, localId);
        }
        var promoHistory = new PromotionSearchHistory
                               {PromotionId = promoId, SearchCriteria = searchCriteria, SearchResults = searchResults};

        return AddPromotionSearchHistory(promoHistory);
    }
 private static PromotionSearchHistory ConvertFromPromotionHistoryResultToPromotionSearchHistory(PromotionHistoryResult hisResult, int promoId)
 {
     PromotionSearchHistory history = new PromotionSearchHistory();
     history.Id = new Guid(hisResult.Id);
     history.PromotionId = promoId;
     history.SearchCriteria = hisResult.SearchCriteria;
     history.SearchCriteriaLiteral = hisResult.SearchCriteriaLiteral;
     history.SearchResults = hisResult.SearchResutls;
     return history;
 }
Esempio n. 4
0
	private void detach_PromotionSearchHistories(PromotionSearchHistory entity)
	{
		this.SendPropertyChanging();
		entity.Promotion = null;
	}
Esempio n. 5
0
	private void attach_PromotionSearchHistories(PromotionSearchHistory entity)
	{
		this.SendPropertyChanging();
		entity.SchedulePromotion = this;
	}
Esempio n. 6
0
 partial void DeletePromotionSearchHistory(PromotionSearchHistory instance);
Esempio n. 7
0
 partial void UpdatePromotionSearchHistory(PromotionSearchHistory instance);
Esempio n. 8
0
 partial void InsertPromotionSearchHistory(PromotionSearchHistory instance);