Ejemplo n.º 1
0
 protected void btn_SaveGrid_Click(object sender, EventArgs e)
 {
     try
     {
         if (grd_Uploads.Rows.Count > 0)
         {
             foreach (GridViewRow rw in grd_Uploads.Rows)
             {
                 CheckBox chkApproved = rw.FindControl("chk_Approved") as CheckBox;
                 Label    lblUploadId = rw.FindControl("lbl_UploadId") as Label;
                 int      approved    = Convert.ToInt32(chkApproved.Checked);
                 int      res         = objStudent.SaveUploadedFileStatus(Convert.ToInt32(lblUploadId.Text), approved);
             }
             grd_Uploads.DataBind();
             string popupScript = "alert('Records updated successfully!');";
             ClientScript.RegisterStartupScript(Page.GetType(), "script", popupScript, true);
         }
         else
         {
             string popupScript = "alert('No records to update.');";
             ClientScript.RegisterStartupScript(Page.GetType(), "script", popupScript, true);
         }
     }
     catch { }
 }