Exemplo n.º 1
0
        protected void txt_OrderIndex_OnTextChanged(object sender, EventArgs e)
        {
            var textBox  = (TextBox)sender;
            var dataItem = ((GridDataItem)textBox.Parent.Parent);

            if (dataItem != null)
            {
                try
                {
                    var bankAccountsId = new Guid(dataItem.GetDataKeyValue("BankAccountsId").ToString());
                    var orderIndex     = Convert.ToInt32(textBox.Text);
                    orderIndex = orderIndex > 0 ? orderIndex : 1;
                    _bankAccountsWrite.UpdateOrderIndex(bankAccountsId, orderIndex);
                }
                catch (Exception ex)
                {
                    RAM.Alert("无效的操作。" + ex.Message);
                }
            }
            BankAccountsGrid.Rebind();
        }