public void retrieveRewardoCardViewModel() { foreach (var item in m_RewardoDAL.getCardsFromRW()) { RewardoCardViewModel rwcvm = new RewardoCardViewModel(); rwcvm.CardCRMId = item.CardCRMId; rwcvm.CardId = item.CardId; rwcvm.Cardno = item.Cardno; rwcvm.CardPoolId = item.CardPoolId; rwcvm.CardProductId = item.CardProductId; rwcvm.CustomerId = item.CustomerId; rwcvm.DailyLimit = item.DailyLimit; rwcvm.ExpiryDate = item.ExpiryDate; rwcvm.InsertDate = item.InsertDate; rwcvm.LastUpdateDate = item.LastUpdateDate; rwcvm.MerchantId = item.MerchantId; rwcvm.NextDailyLimit = item.NextDailyLimit; rwcvm.OrderInPackage = item.OrderInPackage; rwcvm.OrganizationId = item.OrganizationId; rwcvm.PackageId = item.PackageId; rwcvm.Status = item.Status; rwcvm.TransactionLimit = item.TransactionLimit; m_rewardoCLVM.rclvm.Add(rwcvm); } }
/// <summary> /// get the first <card_id> from from item.content /// get the creation_datetime from item.creation_datetime /// loop in rewardo [CARD] table where card.insert_date >= creation_datetime && card.crm_id == <card_id> /// </summary> /// <param name="item"></param> /// <returns></returns> private bool orderIsProcessing(CardOrderRequest item) { // initialization of [REWARDO].[CARD] table m_rewardoDAL = new RewardoDAL(); var pomRewardoCards = m_rewardoDAL.getCardsFromRW(); // get the first <card_id> from from item.content var xelement = XElement.Parse(item.Content); var firstXMLCardIdElementValue = Convert.ToInt64(xelement.Element("card").Element("card_id").Value); // get the creation_datetime from item.creation_datetime var creationDatetime = item.CreationDateTime; // loop in rewardo[CARD] table where card.insert_date >= creation_datetime && card.crm_id == < card_id > var pom = false; var i = 0; while (pom == false && i < pomRewardoCards.Count) { pom = pomRewardoCards.Where(x => x.InsertDate >= creationDatetime && x.CardCRMId == firstXMLCardIdElementValue).Select(x => x).FirstOrDefault() == null ? false : true; i += 1; } return(pom); }