private void lvRedeemPrizeList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            
            try
            {
               if (lvRedeemPrizeList.Items.Count > 0)
                {
                    if (lvRedeemPrizeList.SelectedItem != null)
                    {
                        listReedeem = (PrizeInfoDTO)lvRedeemPrizeList.SelectedItem;

                        lblPrizeDescription.Content = listReedeem.PrizeName;
                        lblUnitPointValue.Content = listReedeem.RedeemPoints;
                        txtPrizeQty.Text = "1";
                        lblCashValue.Content = (oCommonUtilities.CreateInstance()).GetCurrency(double.Parse(listReedeem.AuthAward.Substring(1)) * double.Parse(txtPrizeQty.Text));
                        
                    }
                }
                if (int.Parse(lblUnitPointValue.Content.ToString()) != 0)
                {
                    UpdateToRedeemPoints();
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get the Prize Information for the player
        /// </summary>
        /// <param name="AccountNumber"></param>
        /// <returns>List of prizes available</returns>
        public List<PrizeInfoDTO> GetPrizeInfo(string AccountNumber)
        {
            List<PrizeInfoDTO> listPrizeInfo = new List<PrizeInfoDTO>();

            try
            {

                LoginInfoDTO loginInfoDTO = GetLoginInformation();
                serviceResult = kioskService.EmployeeLogin(loginInfo);

                if (MethodResult.Success == serviceResult.Result)
                {
                    loginInfo.LocationCode = serviceResult.Data[0].ToString();
                    loginInfoDTO.LocationCode = serviceResult.Data[0].ToString();
                    DateTime gamingdate = DateTime.Today;
                    if (true == DateTime.TryParse(serviceResult.Data[1].ToString(), out gamingdate))
                    {
                        loginInfo.GamingDate = gamingdate;
                        loginInfoDTO.GamingDate = gamingdate;
                    }
                    else
                    {
                        loginInfo.GamingDate = DateTime.Today;
                        loginInfoDTO.GamingDate = DateTime.Today;
                    }

                    loginInfo.Shift = int.Parse(serviceResult.Data[2].ToString());
                    loginInfoDTO.Shift = int.Parse(serviceResult.Data[2].ToString());
                }
                PrizeInfo[] PrizeInfoTbl = kioskService.RetrievePriceList(AccountNumber, loginInfo);
                List<PrizeInfoDTO> prizeInfoArray = new List<PrizeInfoDTO>();

                foreach (PrizeInfo item in PrizeInfoTbl)
                {
                    PrizeInfoDTO PrizeInfoObject = new PrizeInfoDTO();
                    PrizeInfoObject.AuthAward = item.AuthAward.ToString();
                    PrizeInfoObject.AwardUsed = item.AwardUsed.ToString();
                    PrizeInfoObject.BasePoints = item.BasePoints.ToString();
                    PrizeInfoObject.BonusPoints = item.BonusPoints.ToString();
                    PrizeInfoObject.PrizeId = item.PrizeId;
                    PrizeInfoObject.PrizeName = item.PrizeName;
                    PrizeInfoObject.RedeemPoints = item.RedeemPoints.ToString();
                    prizeInfoArray.Add(PrizeInfoObject);
                }

                foreach (PrizeInfoDTO objPrizeInfo in prizeInfoArray)
                {
                    listPrizeInfo.Add(objPrizeInfo);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return null;
            }
            return listPrizeInfo;
        }
 private void FillPrizeList()
 {
     List<PrizeInfoDTO> objPrizeList = null;
     Binding bind = null;
     try
     {
         objPrizeList = playerInformationBusinessObject.RetreivePrizeInfo(txtAcctNo.Text);
         IList<PrizeInfoDTO> objPrizeInfoDTOList = new List<PrizeInfoDTO>();
         PrizeInfoDTO objPrizeInfoDTO = null;
         
         if (objPrizeList != null)
         {
             foreach (PrizeInfoDTO objPInfo in objPrizeList)
             {
                 objPrizeInfoDTO = new PrizeInfoDTO();
                 objPrizeInfoDTO.AuthAward = CommonBusinessObjects.GetCurrency(objPInfo.AuthAward);
                 objPrizeInfoDTO.AwardUsed = objPInfo.AwardUsed.ToString();
                 objPrizeInfoDTO.BasePoints = objPInfo.BasePoints.ToString();
                 objPrizeInfoDTO.BonusPoints = objPInfo.BonusPoints.ToString();
                 objPrizeInfoDTO.PrizeId = objPInfo.PrizeId.ToString();
                 objPrizeInfoDTO.PrizeName = objPInfo.PrizeName.ToString();
                 objPrizeInfoDTO.RedeemPoints = objPInfo.RedeemPoints.ToString();
                 objPrizeInfoDTOList.Add(objPrizeInfoDTO);
             }
             bind = new Binding();
             bind.Source = objPrizeInfoDTOList;
             lvRedeemPrizeList.SetBinding(ListView.ItemsSourceProperty, bind);
             bind.Source = null;
         }
         else
         {
             bind = new Binding();
             bind.Source = null;
             lvRedeemPrizeList.SetBinding(ListView.ItemsSourceProperty, bind);                    
             lblCashValue.Content = (oCommonUtilities.CreateInstance()).GetCurrency(0.00);
             lblUnitPointValue.Content = "0";
             lblPrizeDescription.Content = string.Empty;
         }                
     }
     catch (Exception ex)
     {
         ExceptionManager.Publish(ex);
     }
 }