public ActionResult AddCard(string UserId, string AgentId) { CardModel cardModel = new CardModel(); cardModel.UserId = UserId.DecryptParameter(); cardModel.AgentId = AgentId.DecryptParameter(); var cardType = _card.GetCardType(); foreach (var item in cardType.Where(kvp => kvp.Value.ToUpper() == "VIRTUAL CARD").ToList()) { cardType.Remove(item.Key); } cardModel.CardTypeList = ApplicationUtilities.SetDDLValue(cardType as Dictionary <string, string>, "", "--Card Type--"); return(View(cardModel)); }
public ActionResult Index() { string userid = Session["UserId"].ToString(); var cardCommonList = _card.GetCardList(userid).MapObjects <CardModel>(); List <CardModel> cardModels = new List <CardModel>(); var cardType = _card.GetCardType(); foreach (var item in cardCommonList) { CardModel model = new CardModel(); model.FullName = item.FullName; model.UserId = item.UserId; model.Amount = item.Amount; model.CardId = item.CardId; model.CardNo = item.CardNo; model.CardType = item.CardType; model.CardTypeName = cardType.FirstOrDefault(x => x.Key == item.CardType).Value;; model.ExpiryDate = item.ExpiryDate; model.Status = item.Status.Trim();//== "Y" ? "checked" : ""; model.IsReceived = item.IsReceived.Trim(); model.ReceivedFrom = item.ReceivedFrom; cardModels.Add(model); } Dictionary <string, string> cardoptions = new Dictionary <string, string>() { { "0", "--Select Card Options--" }, { "1", "Add New Card" }, { "2", "Card Balance Add/Retrieve" }, { "3", "Card Transfer/Retrieve" } }; ViewBag.CardOptions = ApplicationUtilities.SetDDLValue(cardoptions, "", ""); return(View(cardModels)); }