Beispiel #1
0
    protected void Delete()
    {
        // Check whether admin section is in readonly mode.
        if (!Config.isAdminActionAllowed())
        {
            Response.Redirect(Config.GetUrl("adm/sc/Default.aspx?action_error=true"));
            return;
        }
        int  index;
        bool flg = false;

        for (index = 0; index < MyList.Items.Count; index++)
        {
            CheckBox select_chk;
            select_chk = (CheckBox)MyList.Items[index].FindControl("chk_inbox");
            if (select_chk.Checked)
            {
                long   id            = Convert.ToInt64(((Label)MyList.Items[index].FindControl("lbl_id")).Text);
                long   contentid     = Convert.ToInt64(((Label)MyList.Items[index].FindControl("lbl_contentid")).Text);
                int    type          = Convert.ToInt32(((Label)MyList.Items[index].FindControl("lbl_type")).Text);
                string profileid     = ((Label)MyList.Items[index].FindControl("lbl_profileid")).Text;
                int    TotalComments = CommentsBLL.Fetch_Total_Comments(contentid, profileid, type);
                CommentsBLL.Delete(id, type, contentid, profileid, TotalComments);
                if (flg == false)
                {
                    flg = true;
                }
            }
        }
        if (flg == false)
        {
            Config.ShowMessageV2(msg, "please select record", "Info!", 2);
        }
        else
        {
            Config.ShowMessageV2(msg, "selected records have been deleted successfully", "Success!", 1);
        }

        BindList();
    }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.IsPostBack())
            {
                string chk = Request["chk"];
                if (string.IsNullOrEmpty(chk))
                {
                    return;
                }
                string[] delArray = chk.Split(',');

                foreach (var item in delArray)
                {
                    commentsBLL.Delete(item.ToInt32());
                }
            }
            page       = Request["page"].ToInt32(1);
            size       = Request["size"].ToInt32(10);
            total      = commentsBLL.QueryCount(null);
            totalCount = (int)Math.Ceiling(total * 1.0 / size);
            comments   = commentsBLL.QueryList(page, size, null, null);
        }
        public int Delete(int Id)
        {
            var result = bll.Delete(Id);

            return(result);
        }