protected void grdLista_RowUpdating(object sender, GridViewUpdateEventArgs e) { var idpersona = grdLista.DataKeys[e.RowIndex].Value; TextBox txtnombres = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtNOMBRES"); TextBox txtapellidos = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtAPELLIDOS"); TextBox txtidentificacion = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtIDENTIFICACION"); TextBox txtemail = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtEMAIL"); TextBox txtcargo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtCARGO"); TextBox txtdependencia = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtDEPENDENCIA"); TextBox txtfunciones = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtFUNCIONES"); TextBox txtsueldo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtSUELDO"); //TextBox txtactivo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtACTIVO"); DropDownList Drpactivo = (DropDownList)grdLista.Rows[e.RowIndex].FindControl("DrpACTIVO"); //String txtnombres = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtNOMBRES"); //String txtapellidos = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtAPELLIDOS"); //String txtidentificacion = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtIDENTIFICACION"); //String txtemail = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtEMAIL"); //String txtcargo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtCARGO"); //String txtdependencia = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtDEPENDENCIA"); //String txtfunciones = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtFUNCIONES"); //String txtsueldo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtSUELDO"); if (txtnombres.Text != "" && txtapellidos.Text != "" && txtidentificacion.Text != "" && txtemail.Text != "" && txtcargo.Text != "" && txtdependencia.Text != "" && txtfunciones.Text != "" && txtsueldo.Text != "" && Drpactivo.SelectedItem.ToString() != "") { if (PERSONASCER.PERSONASCERActualizarbyIDPERSONA(Convert.ToDecimal(idpersona), txtidentificacion.Text, txtnombres.Text, txtapellidos.Text, DateTime.Now, txtemail.Text, "", "", "", "", 0, DateTime.Now, 0, DateTime.Now, txtcargo.Text, txtdependencia.Text, txtfunciones.Text, txtsueldo.Text, Drpactivo.SelectedItem.ToString())) { grdLista.EditIndex = -1; CARGARGRILLA(); Alerta.notiffy("Registro Exitoso", "Se ha registrado correctamenta la actualización de los datos", "sucessful", this, GetType()); } else { Alerta.notiffy("Operacion incompleta", "No se han podido actualizar los cambios!", "warning", this, GetType()); return; } } }
protected void BTNMODALGUARDAR_Click(object sender, EventArgs e) { PERSONACERSELECCIONADA = (List <DCPERSONASCER>)Session["PERSONACERSELECCIONADA"]; if (PERSONASCER.PERSONASCERActualizarbyIDPERSONA(PERSONACERSELECCIONADA[0].IDPERSONA, txt_IDENTIFICACION.Text, txt_NOMBRES.Text, txt_APELLIDOS.Text, DateTime.Now, txt_EMAIL.Text, txt_TELEFONO.Text, txt_MOVIL.Text, "PRUEBA", "SOLTERO", 0, DateTime.Now, 0, DateTime.Now, txt_CARGO.Text, txt_DEPENDENCIA.Text, txt_FUNCIONES.Text, txt_SUELDO.Text, "SI")) { //grdLista.EditIndex = -1; //CARGARGRILLA(); Alerta.notiffy("Registro Exitoso", "Se ha registrado correctamenta la actualización de los datos", "sucessful", this, GetType()); } else { Alerta.notiffy("Operacion incompleta", "No se han podido actualizar los cambios!", "warning", this, GetType()); } CARGARGRILLA3(); //List<DCPERSONAS> lstPERSONAS = new List<DCPERSONAS>(); //DataTable DTPERSONAS = new DataTable(); //DTPERSONAS = PERSONAS.PERSONASObtenerbyCriterio(txt_NumeroId.Text, 0); //if (DTPERSONAS.Rows.Count == 0) //{ // PERSONAS.PERSONASRegistrar(0, txt_NumeroId.Text, // cbo_tipoId.SelectedItem.Text, Convert.ToDateTime(dtpFechaExpedicion.Text), Convert.ToDateTime(dtpFechaNacimiento.Text), // txt_nombres.Text.ToUpper(), txt_apellidos.Text.ToUpper(), txtDireccion.Text, cboPais.SelectedItem.Text, // cboDepto.SelectedItem.Text, cboCiudad.SelectedItem.Text, TextCorreoElectronico.Text, cboGenero.SelectedItem.Text, // txtTelefono.Text, txtCelular.Text, "PERSONA", "SI", 0, DateTime.Now, 0, DateTime.Now); // //string script = " $.growl.notice({ title: 'Registro Exitoso',message: '' });"; // //ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true); // Alerta.notiffy("Registro Exitoso", "Se ha registrado correctamenta en la BD, los datos de la persona", "sucessful", this, GetType()); //} //else //{ // //string script = "alert(\"No se ha podido agregar la persona pues el numero de identificación ya existe!\");"; // //ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true); // Alerta.notiffy("Operacion incompleta", "No se ha podido agregar la persona, el numero de identificación ya existe!", "warning", this, GetType()); //} }