示例#1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in gvwMaster.Rows)
        {
            string   contractNo  = row.Cells[1].Text;
            CheckBox chkActivate = row.FindControl("chkActivate") as CheckBox;
            if (chkActivate != null && !String.IsNullOrEmpty(contractNo))
            {
                if (row.Enabled)
                {
                    if (chkActivate.Checked)
                    {
                        contractProvider.ActivateContract(contractNo);
                    }
                    else
                    {
                        contractProvider.DeActivateContract(contractNo);
                    }
                }
            }
        }

        gvwMaster.DataBind();
    }