예제 #1
0
 private void FinishEdit(bool rebind)
 {
     CurrencyGrid.EditIndex = -1;
     if (rebind)
     {
         CurrencyGrid.DataBind();
     }
     CurrencyAjax.Update();
 }
예제 #2
0
        protected void CurrencyGrid_RowEditing(object sender, GridViewEditEventArgs e)
        {
            int      currencyId = (int)CurrencyGrid.DataKeys[e.NewEditIndex].Value;
            Currency currency   = CurrencyDataSource.Load(currencyId);

            if (currency != null)
            {
                AbleCommerce.Admin._Store.Currencies.EditCurrencyDialog editDialog = CurrencyAjax.FindControl("EditCurrencyDialog1") as AbleCommerce.Admin._Store.Currencies.EditCurrencyDialog;
                if (editDialog != null)
                {
                    editDialog.CurrencyId = currencyId;
                }
            }
        }
예제 #3
0
 protected void CurrencyGrid_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "UpdateRate")
     {
         Currency currency = CurrencyDataSource.Load(AlwaysConvert.ToInt(e.CommandArgument));
         if (currency != null)
         {
             try
             {
                 currency.UpdateExchangeRate(true);
                 CurrencyGrid.DataBind();
                 CurrencyAjax.Update();
             }
             catch (Exception ex)
             {
                 // Throw the exception with proper error message
                 throw new Exception("Unable to update the exchange rate.  The rate provider may be experiencing technical difficulties, please try again later.  Exception message: " + ex.Message, ex);
             }
         }
     }
 }
예제 #4
0
 private void AddCurrencyDialog1_ItemAdded(object sender, PersistentItemEventArgs e)
 {
     CurrencyGrid.DataBind();
     CurrencyAjax.Update();
 }