Exemplo n.º 1
0
        private bool Delete()
        {
            bool   boRetValue = false;
            string stIDs      = "";

            foreach (DataListItem item in lstItem.Items)
            {
                HtmlInputCheckBox chkList = (HtmlInputCheckBox)item.FindControl("chkList");
                if (chkList != null)
                {
                    if (chkList.Checked == true)
                    {
                        stIDs     += chkList.Value + ",";
                        boRetValue = true;
                    }
                }
            }
            if (boRetValue)
            {
                Promo clsPromo = new Promo();
                clsPromo.Delete(stIDs.Substring(0, stIDs.Length - 1));
                clsPromo.CommitAndDispose();
            }

            return(boRetValue);
        }
Exemplo n.º 2
0
    void Delete()
    {
        bool isError = false;

        try {
            Promo.RemoveProducts(int.Parse(lblID.Text));
            Promo.Delete(int.Parse(lblID.Text));
        } catch (Exception x) {
            isError = true;
            ThrowError(x.Message);
        }
        if (!isError)
        {
            Response.Redirect("admin_promos.aspx", false);
        }
    }