Пример #1
0
        /// <summary>
        /// 删除操作
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void ExpensesListDataGrid_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            string id          = string.Empty;
            int    selectindex = e.Item.ItemIndex;

            if (e.CommandName == "ExpensesImageDelete")
            {
                id = this.ExpensesListDataGrid.Items[selectindex].Cells[0].Text;
                if (!string.IsNullOrEmpty(id) && this.deleteflag == true)
                {
                    int iSuccess = ExpensesMethods.DeleteExpenses(Convert.ToInt32(id));
                    if (iSuccess > 0)
                    {
                        Alert.Show(this, "删除成功!");
                    }
                    else
                    {
                        Alert.Show(this, "删除失败!");
                    }
                    if (queryList == null)
                    {
                        queryList = new List <QueryElement>();
                    }
                    BindExpensesListDataGrid(queryList);
                }
            }
        }