Example #1
0
        protected void itemGrid_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int    itemid     = Convert.ToInt32(itemGrid.DataKeys[e.RowIndex].Value.ToString());
            IAdmin RemoveItem = new AdminItems();
            int    removed    = RemoveItem.removeItems(itemid);

            if (removed == -1)
            {
                lbl_status.Text = HardCodedValues.BuddaResource.ItemDeleted;
                ClearCache();
                int grpCatId = Int32.Parse(ddl_catagory.SelectedValue.ToString());
                if (txt_itemname.Text == "")
                {
                    getItems(grpCatId);
                }
                else
                {
                    searchDT(txt_itemname.Text, grpCatId);
                }
            }
            else
            {
                lbl_status.Text = HardCodedValues.BuddaResource.ItemRemovalError;
            }
        }
        protected void itemGrid_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int    itemid     = Convert.ToInt32(itemGrid.DataKeys[e.RowIndex].Value.ToString());
            IAdmin RemoveItem = new AdminItems();
            int    removed    = RemoveItem.removeItems(itemid);

            if (removed == -1)
            {
                lbl_status.Text = "Item Removed";
                if (txt_itemname.Text == "Enter Item Name/Id")
                {
                    int grpCatId = Int32.Parse(ddl_catagory.SelectedValue.ToString());
                    getItems(grpCatId);
                }
                else
                {
                    searchDT(txt_itemname.Text);
                }
            }
            else
            {
                lbl_status.Text = "Error Occured while Removing the Item, Try again";
            }
        }