Beispiel #1
0
        /// <summary>
        /// Init page
        /// </summary>
        private void InitPage()
        {
            pcBll                   = new ExchangeRateBLL();
            genericBLL              = new Generic <PNK_ExchangeRate>();
            generic2CBLL            = new Generic2C <PNK_ExchangeRate, PNK_ExchangeRateDesc>();
            this.template_path      = WebUtils.GetWebPath();
            msg_confirm_delete_item = LocalizationUtility.GetText("mesConfirmDelete");
            msg_no_selected_item    = LocalizationUtility.GetText("mesSelectItem");
            LocalizationUtility.SetValueControl(this);

            GetMessage();
        }
Beispiel #2
0
        public decimal GetExchangeRate()
        {
            int                      total;
            decimal                  amount = decimal.MinValue;
            ExchangeRateBLL          pcBll  = new ExchangeRateBLL();
            IList <PNK_ExchangeRate> lst    = pcBll.GetList(1, string.Empty, string.Empty, string.Empty, 1, 1, out total);

            if (total > 0)
            {
                amount = lst[0].ExchangeRateDesc.Amount;
            }
            return(amount);
        }
Beispiel #3
0
        public decimal GetExchangeRate()
        {
            int     total;
            decimal amount = decimal.MinValue;

            try
            {
                ExchangeRateBLL          pcBll = new ExchangeRateBLL();
                IList <PNK_ExchangeRate> lst   = pcBll.GetList(1, string.Empty, string.Empty, string.Empty, 1, 1, out total);
                if (total > 0)
                {
                    amount = lst[0].ExchangeRateDesc.Amount;
                }
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
            }
            return(amount);
        }
        public bool UpdateRate(ExchangeRateBLL ubll)
        {
            bool   IsSuccess = false;
            string sql       = "UPDATE [dbo].[CurrencyExchange]" +
                               "SET[USCurrency] = @USCurrency" +
                               ",[LocalCurrencyPerUS] = @LocalCurrencyPerUS" +
                               " WHERE [ID] = @ID";
            SqlCommand cmd = new SqlCommand(sql, con);

            try
            {
                cmd.Parameters.AddWithValue("@USCurrency", ubll.USCurrency);
                cmd.Parameters.AddWithValue("@LocalCurrencyPerUS", ubll.LocalCurrency);
                cmd.Parameters.AddWithValue("@ID", ubll.ID);
                con.Open();
                int i = cmd.ExecuteNonQuery();
                if (i > 0)
                {
                    IsSuccess = true;
                }
                else
                {
                    IsSuccess = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Data Access Error");
            } finally
            {
                cmd.Dispose();
                con.Close();
            }

            return(IsSuccess);
        }