Beispiel #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        ManagerPagePowerBll     managerPagePowerBll    = new ManagerPagePowerBll();
        ManagerPagePowerEnitity managerPagePowerEntity = new ManagerPagePowerEnitity();
        string managerID = this.GetManagerID();

        managerPagePowerEntity.ManagerID = managerID;
        managerPagePowerBll.DeleteByManager(managerPagePowerEntity);
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBoxList checkBoxList = (CheckBoxList)this.GridView1.Rows[i].FindControl("ckChild");
            LinkButton   linkButton   = (LinkButton)this.GridView1.Rows[i].FindControl("lkPages");
            CheckBox     checkBox     = (CheckBox)this.GridView1.Rows[i].FindControl("ckParent");
            if (checkBoxList != null && linkButton != null && checkBox != null && checkBox.Checked)
            {
                managerPagePowerEntity.ManagerID = managerID;
                managerPagePowerEntity.Id        = int.Parse(linkButton.CommandArgument);
                managerPagePowerBll.Add(managerPagePowerEntity);
                for (int j = 0; j < checkBoxList.Items.Count; j++)
                {
                    if (checkBoxList.Items[j].Selected)
                    {
                        managerPagePowerEntity.Id = int.Parse(checkBoxList.Items[j].Value);
                        managerPagePowerBll.Add(managerPagePowerEntity);
                    }
                }
            }
        }
    }
Beispiel #2
0
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        ManagerPagePowerBll teacherPagePowerBll = new ManagerPagePowerBll();

        teacherPagePowerBll.DeleteByManager(new ManagerPagePowerEnitity
        {
            ManagerID = e.CommandArgument.ToString().Trim()
        });
        this.LoadPage();
    }