protected void BtnRegistrar_Click(object sender, EventArgs e) { DB_AP_DocPresentado nInsDoc = new DB_AP_DocPresentado(); AP_DocPresentado i = new AP_DocPresentado(); int j = 0; int k = 0; CheckBox myCheckBox = new CheckBox(); foreach (GridViewRow dgi in GVInsOrgDocPres.Rows) { myCheckBox = (CheckBox)dgi.Cells[2].Controls[1]; GVInsOrgDocPres.Columns[1].Visible = true; Desplegar_INS_ORG_DOC_PRESENT(); i.Id_Documento = Convert.ToInt32(GVInsOrgDocPres.Rows[j].Cells[1].Text); j++; i.Id_VerificarDoc = Convert.ToInt32(LblIdIsnOrg.Text); i.Estado = Convert.ToBoolean(myCheckBox.Checked); nInsDoc.DB_Modificar_DOC_PRESENT(i); if (myCheckBox.Checked == true) { k++; } } if (k == j) { Modificar_ESTADO_DOC_VERIF(); } Modificar_DOC_VERIF(); Response.Redirect("frmRegistroOrg.aspx"); }
public void DA_Modificar_DOC_PRESENT(AP_DocPresentado dp) { try { using (SqlConnection conexion = new SqlConnection(conexionString)) { SqlCommand cmd = new SqlCommand("GAP_DOC_PRESENTADO_UPDATE", conexion); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id_VerificarDoc", dp.Id_VerificarDoc); cmd.Parameters.AddWithValue("@Id_Documento", dp.Id_Documento); cmd.Parameters.AddWithValue("@Estado", dp.Estado); conexion.Open(); cmd.ExecuteNonQuery(); conexion.Close(); } } catch (Exception err) { throw (new Exception(err.ToString() + "-" + err.Source.ToString() + "-" + err.Message.ToString())); } }
public void DB_Modificar_DOC_PRESENT(AP_DocPresentado dp) { DA_AP_DocPresentado registrar = new DA_AP_DocPresentado(); registrar.DA_Modificar_DOC_PRESENT(dp); }