Exemplo n.º 1
0
 protected void btnApproveAll_Click(object sender, EventArgs e)
 {
     ProductBL productBL=new ProductBL();
     for (int i = 0; i < dgvProducts.Rows.Count; i++)
     {
         if (((CheckBox)dgvProducts.Rows[i].FindControl("chkSelect")).Checked)
             productBL.SetApproved(int.Parse(((Label)dgvProducts.Rows[i].FindControl("lblProductID")).Text), true);
     }
 }
Exemplo n.º 2
0
        protected void chkApproved_CheckChanged(object sender, EventArgs e)
        {
            CheckBox chkApproved = (CheckBox)sender;
            GridViewRow row = (GridViewRow)chkApproved.NamingContainer;

            ProductBL productBL = new ProductBL();
            if (productBL.SetApproved(int.Parse(((Label)row.FindControl("lblProductID")).Text), bool.Parse(((CheckBox)row.FindControl("chkApproved")).Checked.ToString())) > 0)
            {
                setStatus("Proizvod uspešno izmenjen", System.Drawing.Color.Green, true);
            }
        }