Example #1
0
 void BindData()
 {
     if (Session["RegId"] != null && Session["RegId"] != "")
     {
         EntityServiceReference.EntityServiceClient ServiceClient1 = new EntityServiceReference.EntityServiceClient();
         ServiceClient1.Open();
         // get card details by m id
         var    dbreturns = ServiceClient1.GetUserDetails(Session["RegId"].ToString());
         String Name      = dbreturns[0].FirstName.ToString();
         lblName.Text     = Name;
         lblMemberID.Text = dbreturns[0].MemberID.ToString();
         lblDate.Text     = dbreturns[0].DateonCard.ToString();
         if (dbreturns.Length > 0)
         {
             String CardType = dbreturns[0].CardCode.ToString();
             // get card details by card type
             EntityServiceReference.EntityServiceClient ServiceClient = new EntityServiceReference.EntityServiceClient();
             ServiceClient.Open();
             var arr = ServiceClient.GetCardsDetailsbyType(CardType);
             GridCardList.DataSource = arr;
             GridCardList.DataBind();
             ServiceClient.Close();
             if (CardType.ToString().ToUpper().Equals("BLUE"))
             {
                 ImgCard.ImageUrl = "../Skins/images/blueCard.png";
             }
             else if (CardType.ToString().ToUpper().Equals("GOLD"))
             {
                 ImgCard.ImageUrl = "../Skins/images/goldCard.png";
             }
             else if (CardType.ToString().ToUpper().Equals("PLATINUM"))
             {
                 ImgCard.ImageUrl = "../Skins/images/platinumCard.png";
             }
             else if (CardType.ToString().ToUpper().Equals("PURPLE"))
             {
                 ImgCard.ImageUrl = "../Skins/images/purpleCard.png";
             }
             else if (CardType.ToString().ToUpper().Equals("TITANIUM"))
             {
                 ImgCard.ImageUrl = "../Skins/images/titaniumCard.png";
             }
             else if (CardType.ToString().ToUpper().Equals("PRINCE"))
             {
                 ImgCard.ImageUrl = "../Skins/images/princeCard.png";
             }
             else if (CardType.ToString().ToUpper().Equals("KING"))
             {
                 ImgCard.ImageUrl = "../Skins/images/kingCard.png";
             }
         }
         EntityServiceReference.EntityServiceClient ServiceClient2 = new EntityServiceReference.EntityServiceClient();
         ServiceClient2.Open();
         var    CardDetails     = ServiceClient2.GetCardsBalanceByMemberId(Session["RegId"].ToString());
         String RemainingAmount = CardDetails[0].RemainingAmount.ToString();
         lblavailableVal.Text = RemainingAmount;
         String RemainingPoints = CardDetails[0].RemainingPoints.ToString();
         lblAvailablePoints.Text = RemainingPoints;
         String After24Hrs = CardDetails[0].After24HourPoints.ToString();
         lblAfter24hrs.Text = After24Hrs;
         String RechargeAmount = CardDetails[0].RechargeAmount.ToString();
         lblTotalRedemption.Text = RechargeAmount;
         ServiceClient1.Close();
         ServiceClient2.Close();
     }
 }
Example #2
0
        void BindData()
        {
            if (Session["RegId"] != null && Session["RegId"] != "")
            {
                EntityServiceReference.EntityServiceClient ServiceClient1 = new EntityServiceReference.EntityServiceClient();
                ServiceClient1.Open();
                // get card details by m id
                var dbreturns = ServiceClient1.GetUserDetails(Session["RegId"].ToString());
                String Name = dbreturns[0].FirstName.ToString();
                lblName.Text = Name;
                lblMemberID.Text = dbreturns[0].MemberID.ToString();
                lblDate.Text = dbreturns[0].DateonCard.ToString();
                if (dbreturns.Length > 0)
                {
                    String CardType = dbreturns[0].CardCode.ToString();
                    // get card details by card type
                    EntityServiceReference.EntityServiceClient ServiceClient = new EntityServiceReference.EntityServiceClient();
                    ServiceClient.Open();
                    var arr = ServiceClient.GetCardsDetailsbyType(CardType);
                    GridCardList.DataSource = arr;
                    GridCardList.DataBind();
                    ServiceClient.Close();
                    if (CardType.ToString().ToUpper().Equals("BLUE"))
                    {
                        ImgCard.ImageUrl = "../Skins/images/blueCard.png";
                    }
                    else if (CardType.ToString().ToUpper().Equals("GOLD"))
                    {
                        ImgCard.ImageUrl = "../Skins/images/goldCard.png";
                    }
                    else if (CardType.ToString().ToUpper().Equals("PLATINUM"))
                    {
                        ImgCard.ImageUrl = "../Skins/images/platinumCard.png";
                    }
                    else if (CardType.ToString().ToUpper().Equals("PURPLE"))
                    {
                        ImgCard.ImageUrl = "../Skins/images/purpleCard.png";
                    }
                    else if (CardType.ToString().ToUpper().Equals("TITANIUM"))
                    {
                        ImgCard.ImageUrl = "../Skins/images/titaniumCard.png";
                    }
                    else if (CardType.ToString().ToUpper().Equals("PRINCE"))
                    {
                        ImgCard.ImageUrl = "../Skins/images/princeCard.png";
                    }
                    else if (CardType.ToString().ToUpper().Equals("KING"))
                    {
                        ImgCard.ImageUrl = "../Skins/images/kingCard.png";
                    }
                }
                EntityServiceReference.EntityServiceClient ServiceClient2 = new EntityServiceReference.EntityServiceClient();
                ServiceClient2.Open();
                var CardDetails = ServiceClient2.GetCardsBalanceByMemberId(Session["RegId"].ToString());
                String RemainingAmount = CardDetails[0].RemainingAmount.ToString();
                lblavailableVal.Text = RemainingAmount;
                String RemainingPoints = CardDetails[0].RemainingPoints.ToString();
                lblAvailablePoints.Text = RemainingPoints;
                String After24Hrs = CardDetails[0].After24HourPoints.ToString();
                lblAfter24hrs.Text = After24Hrs;
                String RechargeAmount = CardDetails[0].RechargeAmount.ToString();
                lblTotalRedemption.Text = RechargeAmount;
                ServiceClient1.Close();
                ServiceClient2.Close();

            }
        }