Esempio n. 1
0
        protected void dlVersionList_ItemCommand(object sender, DataListCommandEventArgs e)
        {
            int categoryId = (int)dlVersionList.DataKeys[e.Item.ItemIndex];

            switch (e.CommandName)
            {
            case "Delete":
                CSFactory.RemoveVersionCategory(categoryId);
                BindVersion();
                break;

            case "Edit":
                dlVersionList.EditItemIndex = e.Item.ItemIndex;
                BindVersion();
                break;

            case "Cancel":
                dlVersionList.EditItemIndex = -1;
                BindVersion();
                break;

            case "Update":
                TextBox tbedit = (TextBox)e.Item.FindControl("txtEditCategory");

                CSFactory.SaveVersionCategory(categoryId, CommonHelper.fixquotesAccents(tbedit.Text.Trim()));
                dlVersionList.EditItemIndex = -1;
                BindVersion();
                break;
            }
        }