//-------------------------------------------------------------------------------- #region --------------dgItemCategories_DeleteCommand-------------- //--------------------------------------------------------- //dgItemCategories_DeleteCommand //--------------------------------------------------------- protected void dgItemCategories_DeleteCommand(object source, DataGridCommandEventArgs e) { //Check Delete permission //------------------------------------------------------------------------------- int categoryID = Convert.ToInt32(dgItemCategories.DataKeys[e.Item.ItemIndex]); bool status = ItemCategoriesFactory.Delete(categoryID); if (status) { lblResult.CssClass = "lblResult_Done"; lblResult.Text = Resources.AdminText.DeletingOprationDone; //if one item in datagrid /*if (dgItemCategories.Items.Count == 1) * { * --pager.CurrentPage; * }*/ LoadData(); } else { lblResult.CssClass = "lblResult_Faild"; lblResult.Text = Resources.AdminText.DeletingOprationFaild; } }
//-------------------------------------------------------------------------------- #region --------------dgItemCategories_DeleteCommand-------------- //--------------------------------------------------------- //dgItemCategories_DeleteCommand //--------------------------------------------------------- protected void dgItemCategories_DeleteCommand(object source, DataGridCommandEventArgs e) { //Check Delete permission //------------------------------------------------------------------------------- int categoryID = Convert.ToInt32(dgItemCategories.DataKeys[e.Item.ItemIndex]); bool status = ItemCategoriesFactory.Delete(categoryID); if (status) { General.MakeAlertSucess(lblResult, Resources.AdminText.DeletingOprationDone); //if one item in datagrid /*if (dgItemCategories.Items.Count == 1) * { * --pager.CurrentPage; * }*/ LoadData(); } else { General.MakeAlertError(lblResult, Resources.AdminText.DeletingOprationFaild); } }