示例#1
0
    protected void Chk_CheckedChanged(object sender, EventArgs e)
    {
        GridViewRow row          = ((GridViewRow)((CheckBox)sender).NamingContainer);
        int         index        = row.RowIndex;
        CheckBox    cb           = (CheckBox)EntGridView.Rows[index].FindControl("Chk");
        string      SectorID     = ((HiddenField)EntGridView.Rows[index].FindControl("FocalPointsSector")).Value;
        string      AreaID       = ((HiddenField)EntGridView.Rows[index].FindControl("FocalPointsArea")).Value;
        string      FocalPointID = ((HiddenField)EntGridView.Rows[index].FindControl("FocalPointsID")).Value;

        if (cb.Checked)
        {
            objFocalPoints.CustomUpdateFocalPoints(" FocalPointsNotification=1 where FocalPointsID=" + FocalPointID
                                                   + " and FocalPointsSector=" + SectorID + " and FocalPointsArea=" + AreaID);
        }
        else
        {
            objFocalPoints.CustomUpdateFocalPoints(" FocalPointsNotification=0 where FocalPointsID=" + FocalPointID
                                                   + " and FocalPointsSector=" + SectorID + " and FocalPointsArea=" + AreaID);
        }
    }