//--------------------------------------------------------
    #endregion

    #region --------------dgItems_DeleteCommand--------------
    //---------------------------------------------------------
    //dgItems_DeleteCommand
    //---------------------------------------------------------
    protected void dgItems_DeleteCommand(object source, DataGridCommandEventArgs e)
    {
        int itemID = Convert.ToInt32(dgItems.DataKeys[e.Item.ItemIndex]);

        if (ItemsFactory.Delete(itemID))
        {
            General.MakeAlertSucess(lblResult, Resources.AdminText.DeletingOprationDone);
            //if one item in datagrid
            if (dgItems.Items.Count == 1)
            {
                --pager.CurrentPage;
            }
            LoadData();
        }
        else
        {
            General.MakeAlertError(lblResult, Resources.AdminText.DeletingOprationFaild);
        }
    }
Beispiel #2
0
    //--------------------------------------------------------
    #endregion

    #region --------------dgItems_DeleteCommand--------------
    //---------------------------------------------------------
    //dgItems_DeleteCommand
    //---------------------------------------------------------
    protected void dgItems_DeleteCommand(object source, DataGridCommandEventArgs e)
    {
        int itemID = Convert.ToInt32(dgItems.DataKeys[e.Item.ItemIndex]);

        if (ItemsFactory.Delete(itemID))
        {
            lblResult.CssClass = "lblResult_Done";
            lblResult.Text     = Resources.AdminText.DeletingOprationDone;
            //if one item in datagrid
            if (dgItems.Items.Count == 1)
            {
                --pager.CurrentPage;
            }
            LoadData();
        }
        else
        {
            lblResult.CssClass = "lblResult_Faild";
            lblResult.Text     = Resources.AdminText.DeletingOprationFaild;
        }
    }