Exemple #1
0
        protected void btnDeleteLink_Click(Object Sender, ImageClickEventArgs e)
        {
            ImageButton oButton = (ImageButton)Sender;

            oBanks.Delete(Int32.Parse(oButton.CommandArgument));
            Response.Redirect(Request.Path);
        }
Exemple #2
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)
            {
                Banks clsBank = new Banks();
                clsBank.Delete(stIDs.Substring(0, stIDs.Length - 1));
                clsBank.CommitAndDispose();
            }

            return(boRetValue);
        }