Beispiel #1
0
        protected void lbtn_Currency_Select_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                _currencyid             = e.CommandArgument.ToString();
                ViewState["CurrencyID"] = _currencyid;

                CurrencyMgr myCurrencyMgr = new CurrencyMgr();

                Currency myCurrency = myCurrencyMgr.Get_Currency(_currencyid);

                lbl_Currency_Name.Text = string.Format("{0} ({1})", myCurrency.Currency_Name, myCurrency.Currency_ShortName);

                GridView_Currency.DataSource = myCurrencyMgr.Get_Currency_OriginRates(_currencyid);
                GridView_Currency.DataBind();
            }
        }
Beispiel #2
0
        protected void btn_Edit_Currency_Click(object sender, EventArgs e)
        {
            if (!DataEval.IsEmptyQuery(_currencyid))
            {
                Control_FillData();

                CurrencyMgr myCurrencyMgr = new CurrencyMgr();

                Currency myCurrency = myCurrencyMgr.Get_Currency(_currencyid);

                tbx_EditCurrency_Name.Text           = myCurrency.Currency_Name;
                tbx_EditCurrency_ShortName.Text      = myCurrency.Currency_ShortName;
                tbx_EditCurrency_WebCode.Text        = myCurrency.Currency_WebCode;
                tbx_EditCurrency_Description.Text    = myCurrency.Currency_Description;
                chkbox_EditCurrency_IsActive.Checked = myCurrency.IsActive;

                btn_EditCurrency_Update.CommandArgument = myCurrency.CurrencyID;

                MultiView_Currency.SetActiveView(View_Edit);
            }
        }
Beispiel #3
0
        private void Control_Init()
        {
            CurrencyMgr myCurrencyMgr = new CurrencyMgr();

            List <Currency> myCurrencies = myCurrencyMgr.Get_Currencies();

            DataList_CurrencyList.DataSource = myCurrencies;
            DataList_CurrencyList.DataBind();

            if (DataEval.IsEmptyQuery(_currencyid))
            {
                _currencyid             = myCurrencies[0].CurrencyID;
                ViewState["CurrencyID"] = _currencyid;
            }

            Currency selectCurrency = myCurrencyMgr.Get_Currency(_currencyid);

            GridView_Currency.DataSource = myCurrencyMgr.Get_Currency_OriginRates(selectCurrency.CurrencyID);
            GridView_Currency.DataBind();



            lbl_Currency_Name.Text = string.Format("{0} ({1})", selectCurrency.Currency_Name, selectCurrency.Currency_ShortName);

            MultiView_Currency.SetActiveView(View_CurrencyList);

            Panel_EditExchangeRate.Visible = false;

            #region Create Exchange Rate Table

            // Header
            Literal_ExchangeRate.Text = "<Table class='exchangeRate'> \n"
                                        + "<tr>\n <td></td> \n";

            foreach (Currency myCurrency in myCurrencies)
            {
                Literal_ExchangeRate.Text += "<td>" + myCurrency.Currency_ShortName + "</td> \n";
            }

            Literal_ExchangeRate.Text += "</tr> \n";

            // Sider
            foreach (Currency myCurrency in myCurrencies)
            {
                Literal_ExchangeRate.Text += "<tr>\n <td>" + myCurrency.Currency_ShortName + "</td> \n";

                List <Currency_Rate> myCurrency_Rates = myCurrencyMgr.Get_Currency_OriginRates(myCurrency.CurrencyID);

                // Body
                foreach (Currency_Rate myCurrency_Rate in myCurrency_Rates)
                {
                    Literal_ExchangeRate.Text += "<td>" + string.Format("{0:f}", myCurrency_Rate.Exchange_Rate) + "</td> \n";
                }

                Literal_ExchangeRate.Text += "</tr> \n";
            }

            // Footer
            Literal_ExchangeRate.Text += "</Table> \n";


            #endregion
        }