protected void lvRateExchange_ItemUpdating(object sender, ListViewUpdateEventArgs e)
        {
            ExchangeRatesRepository facade = new ExchangeRatesRepository();
            StoreProRepository storeFacade = new StoreProRepository();

            TextBox tbcurrency = (lvRateExchange.EditItem.FindControl("tbCurrency")) as TextBox;
            RadNumericTextBox rnbVNDRate = (lvRateExchange.EditItem.FindControl("rnbVNDRate")) as RadNumericTextBox;
            Label lbl = (lvRateExchange.Items[e.ItemIndex].FindControl("lbID")) as Label;
            String ids = "";
            if (lbl != null)
                ids = lbl.Text;

            B_ExchangeRates exchangeRate = new B_ExchangeRates();
            exchangeRate.Rate = (decimal)rnbVNDRate.Value;
            exchangeRate.Currency = tbcurrency.Text;
            exchangeRate.Id = Int32.Parse(ids);

            B_ExchangeRates exits = facade.GetById(exchangeRate.Id);
            if (exits != null)
            {
                storeFacade.StoreProcessor().B_ExchangeRate_history_process(exchangeRate.Currency, exchangeRate.Rate, this.UserId, 2);
                facade.Update(facade.GetById(exchangeRate.Id), exchangeRate);
                facade.Commit();
            }
            lvRateExchange.EditIndex = -1;
            LoadDataTolvRateExchange();
        }
        protected void lvRateExchange_ItemInserting(object sender, ListViewInsertEventArgs e)
        {
            ExchangeRatesRepository facade = new ExchangeRatesRepository();
            StoreProRepository storeFacade = new StoreProRepository();

            TextBox tbcurrency = (lvRateExchange.InsertItem.FindControl("tbCurrency")) as TextBox;
            RadNumericTextBox rnbVNDRate = (lvRateExchange.InsertItem.FindControl("rnbVNDRate")) as RadNumericTextBox;

            B_ExchangeRates exchangeRate = new B_ExchangeRates();

            exchangeRate.Rate = (decimal)rnbVNDRate.Value;
            exchangeRate.Currency = tbcurrency.Text;
            storeFacade.StoreProcessor().B_ExchangeRate_history_process(exchangeRate.Currency, exchangeRate.Rate, this.UserId, 1);

            facade.Add(exchangeRate);
            facade.Commit();
            LoadDataTolvRateExchange();
        }