protected void Listar(string campo, string direccion) { string centro = string.Empty; if (ddlcentro.SelectedIndex == 0) { centro = string.Empty; } else { centro = ddlcentro.SelectedValue.ToString(); } BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_MOD_REQUERIMIENTO_BANDEJA(txtTicket.Text, ddlcentro.SelectedValue.ToString(), Convert.ToInt32(ddlanio.SelectedValue.ToString())); if (dtResultado.Rows.Count > 0) { dlCustomers.DataSource = dtResultado; dlCustomers.DataBind(); } else { dlCustomers.DataSource = dtResultado; dlCustomers.DataBind(); } }
protected void Eliminar_Req(object sender, ImageClickEventArgs e) { ImageButton btn2 = ((ImageButton)sender); int item = Convert.ToInt32(btn2.CommandArgument); GridViewRow row = btn2.NamingContainer as GridViewRow; BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspDEL_MOD_REQUERIMIENTO(0, Convert.ToInt32(btn2.CommandArgument.ToString())); Listar("", ""); }
protected void Eliminar(object sender, ImageClickEventArgs e) { ImageButton btnEliminar = ((ImageButton)sender); int item = Convert.ToInt32(btnEliminar.CommandArgument); GridViewRow row = btnEliminar.NamingContainer as GridViewRow; string IDE_REQUERIMIENTO = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); string IDE_MOD = GridView1.DataKeys[row.RowIndex].Values[1].ToString(); BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspDEL_MOD_REQUERIMIENTO_IDE(Convert.ToInt32(IDE_REQUERIMIENTO), Convert.ToInt32(IDE_MOD)); Listar(); }
protected void dlCustomers_ItemDataBound(object sender, DataListItemEventArgs e) { BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataRowView drv = e.Item.DataItem as DataRowView; GridView innerDataList = e.Item.FindControl("GridView2") as GridView; Label lblIDE_MOD = (Label)e.Item.FindControl("lblIDE_MOD"); DataTable _DataTable2 = new DataTable(); _DataTable2 = obj.uspSEL_MOD_REQUERIMIENTO_DETALLE_IDE_MOD(Convert.ToInt32(lblIDE_MOD.Text)); foreach (DataRow rw in _DataTable2.Rows) { innerDataList.DataSource = _DataTable2; innerDataList.DataBind(); } }
protected void CartaDatos(string IDE_MOD) { DataTable dtResultado = new DataTable(); BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); dtResultado = obj.uspSEL_MOD_REQUERIMIENTO_IDE(Convert.ToInt32(IDE_MOD)); if (dtResultado.Rows.Count > 0) { txtTicket.Text = dtResultado.Rows[0]["TICKET"].ToString(); lblCodigo.Text = dtResultado.Rows[0]["IDE_MOD"].ToString(); txtSolicitado.Text = dtResultado.Rows[0]["NOM_SOLICITANTE"].ToString(); txtVerificado.Text = dtResultado.Rows[0]["NOM_JEFE_AREA"].ToString(); txtadministrador.Text = dtResultado.Rows[0]["NOM_ADMINISTRADOR"].ToString(); txtGerente.Text = dtResultado.Rows[0]["NOM_GERENTE"].ToString(); Listar(); } }
protected void Listar() { BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_MOD_REQUERIMIENTO_DETALLE_IDE_MOD(Convert.ToInt32(lblCodigo.Text)); if (dtResultado.Rows.Count > 0) { //GridView1.Visible = true; GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { //GridView1.Visible = false; GridView1.DataSource = dtResultado; GridView1.DataBind(); } }
protected void btnAgregar_Click(object sender, EventArgs e) { string cleanMessage = string.Empty; if (txtCantidad.Text == string.Empty) { cleanMessage = "Ingresar cantidad"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { BE_MOD_REQUERIMIENTO oBESol = new BE_MOD_REQUERIMIENTO(); oBESol.IDE_MOD = Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.CODIGO = string.Empty; oBESol.FECHA_REQUERIMIENTO = txtFecha.Text.Trim(); oBESol.IP_CENTRO = ddlcentro.SelectedValue.ToString(); oBESol.CENTRO = ddlcentro.SelectedValue.ToString(); oBESol.USER_REGISTRO = Session["IDE_USUARIO"].ToString(); int dtrpta = 0; dtrpta = new BL_MOD_REQUERIMIENTO().uspINS_MOD_REQUERIMIENTO(oBESol); if (dtrpta > 0) { lblCodigo.Text = dtrpta.ToString(); BE_MOD_REQUERIMIENTO_DETALLE oBESolD = new BE_MOD_REQUERIMIENTO_DETALLE(); oBESolD.IDE_REQUERIMIENTO = 0; oBESolD.IDE_MOD = dtrpta; oBESolD.IDE_CATEGORIA = Convert.ToInt32(ddlCategoria.SelectedValue); oBESolD.IDE_ESPECIALIDAD = Convert.ToInt32(ddlespecialidad.SelectedValue); oBESolD.CANTIDAD = Convert.ToInt32(string.IsNullOrEmpty(txtCantidad.Text) ? "0" : txtCantidad.Text); oBESolD.IP_CENTRO = ddlcentro.SelectedValue.ToString(); oBESolD.USER_REGISTRO = Session["IDE_USUARIO"].ToString(); int dtrpta2 = 0; dtrpta2 = new BL_MOD_REQUERIMIENTO().uspINS_MOD_REQUERIMIENTO_DETALLE(oBESolD); cleanMessage = "Registro exitoso."; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //lblCodigo.Text = string.Empty; Listar(); } } }
protected void Listar() { IDE_REQUERIMIENTO = Session["IDE_REQUERIMIENTO"].ToString(); BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_MOD_REQUERIMIENTO_PERSONAL_POR_REQ(Convert.ToInt32(IDE_REQUERIMIENTO)); if (dtResultado.Rows.Count > 0) { //GridView1.Visible = true; GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { //GridView1.Visible = false; GridView1.DataSource = dtResultado; GridView1.DataBind(); } }
protected void btnDescarga_Click(object sender, EventArgs e) { IDE_REQUERIMIENTO = Session["IDE_REQUERIMIENTO"].ToString(); BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataTable dtResultadoeExcel = new DataTable(); dtResultadoeExcel = obj.uspSEL_MOD_REQUERIMIENTO_PERSONAL_POR_REQ(Convert.ToInt32(IDE_REQUERIMIENTO)); if (dtResultadoeExcel.Rows.Count > 0) { //ExcelHelper.ToExcel(dtResultadoeExcel, "CJI3_" + ddlEstados.SelectedItem + ".xls", Page.Response); gvExcel.DataSource = dtResultadoeExcel; gvExcel.DataBind(); GridViewExportUtil.Export("ESTATUS_MOD_" + DateTime.Now + ".xls", gvExcel); return; } else { } }
protected void btnGuardar_Click(object sender, EventArgs e) { BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataTable dtResultado = new DataTable(); string cleanMessage = string.Empty; if (ddlPersonal.Text.Trim() == string.Empty) { cleanMessage = "Ingresar nombre de personal"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { BE_MOD_REQUERIMIENTO oBESol = new BE_MOD_REQUERIMIENTO(); oBESol.IDE_MOD = Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.CODIGO = string.Empty; oBESol.FECHA_REQUERIMIENTO = txtFecha.Text.Trim(); oBESol.IP_CENTRO = ddlcentro.SelectedValue.ToString(); oBESol.CENTRO = ddlcentro.SelectedValue.ToString(); oBESol.USER_REGISTRO = Session["IDE_USUARIO"].ToString(); int dtrpta = 0; dtrpta = new BL_MOD_REQUERIMIENTO().uspINS_MOD_REQUERIMIENTO(oBESol); if (dtrpta > 0) { lblCodigo.Text = dtrpta.ToString(); dtResultado = obj.uspUPD_MOD_REQUERIMIENTO_RESPONSABLE(Convert.ToInt32(lblCodigo.Text), ddlPersonal.SelectedValue.ToString(), Convert.ToInt32(ddlResponsable.SelectedValue)); CartaDatos(dtrpta.ToString()); cleanMessage = "Registro exitoso."; ddlPersonal.Text = string.Empty; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }
protected void btnMasivo_Click(object sender, EventArgs e) { string cleanMessage = string.Empty; BL_MOD_REQUERIMIENTO OBJ = new BL_MOD_REQUERIMIENTO(); DataTable dtResultado = new DataTable(); int intContador = 0; if (GridView1.Rows.Count == 0) { cleanMessage = "No existe registros"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } foreach (GridViewRow Fila in GridView1.Rows) { CheckBox ChkBoxCell = ((CheckBox)Fila.FindControl("chkSelect")); if (ChkBoxCell.Checked == true) { intContador += 1; } } if (intContador == 0) { cleanMessage = "Debe seleccionar al menos un registro."; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } string REQ_PERSONAL; string IDE_REQUERIMIENTO; int registroUpdate = 0; foreach (GridViewRow row in GridView1.Rows) { //TextBox txt; //txt = (TextBox)GridView1.HeaderRow.FindControl("TextBox1"); CheckBox ChkBoxCell = ((CheckBox)row.FindControl("chkSelect")); if (ChkBoxCell.Checked) { REQ_PERSONAL = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); // extrae key IDE_REQUERIMIENTO = GridView1.DataKeys[row.RowIndex].Values[1].ToString(); // extrae key DropDownList ddlEtapas_F = (DropDownList)GridView1.HeaderRow.FindControl("ddlEtapas_F"); if (ddlEtapas_F.SelectedIndex > 0) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), ddlEtapas_F.SelectedItem.ToString(), 1); registroUpdate++; } TextBox txtExaMedico_F = (TextBox)GridView1.HeaderRow.FindControl("txtExaMedico_F"); Boolean ExaMedico_F = EsFecha(txtExaMedico_F.Text); if (ExaMedico_F == true) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), txtExaMedico_F.Text, 2); registroUpdate++; } TextBox txtTr_F = (TextBox)GridView1.HeaderRow.FindControl("txtTr_F"); Boolean Tr_F = EsFecha(txtTr_F.Text); if (Tr_F == true) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), txtTr_F.Text, 3); registroUpdate++; } TextBox txtSSK_F = (TextBox)GridView1.HeaderRow.FindControl("txtSSK_F"); Boolean SSK_F = EsFecha(txtSSK_F.Text); if (SSK_F == true) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), txtSSK_F.Text, 4); registroUpdate++; } TextBox txtALTURA_F = (TextBox)GridView1.HeaderRow.FindControl("txtALTURA_F"); Boolean ALTURA_F = EsFecha(txtALTURA_F.Text); if (ALTURA_F == true) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), txtALTURA_F.Text, 5); registroUpdate++; } TextBox txtESPACIO_F = (TextBox)GridView1.HeaderRow.FindControl("txtESPACIO_F"); Boolean ESPACIO_F = EsFecha(txtESPACIO_F.Text); if (ESPACIO_F == true) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), txtESPACIO_F.Text, 6); registroUpdate++; } TextBox txtCaliente_F = (TextBox)GridView1.HeaderRow.FindControl("txtCaliente_F"); Boolean Caliente_F = EsFecha(txtCaliente_F.Text); if (Caliente_F == true) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), txtCaliente_F.Text, 7); registroUpdate++; } TextBox txtFileTr_F = (TextBox)GridView1.HeaderRow.FindControl("txtFileTr_F"); Boolean FileTr_F = EsFecha(txtFileTr_F.Text); if (FileTr_F == true) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), txtFileTr_F.Text, 8); registroUpdate++; } TextBox txtPlanta_F = (TextBox)GridView1.HeaderRow.FindControl("txtPlanta_F"); Boolean Planta_F = EsFecha(txtPlanta_F.Text); if (Planta_F == true) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), txtPlanta_F.Text, 9); registroUpdate++; } DropDownList ddlFOTOCHECK_F = (DropDownList)GridView1.HeaderRow.FindControl("ddlFOTOCHECK_F"); if (ddlFOTOCHECK_F.SelectedIndex > 0) { OBJ.uspUPD_MOD_REQUERIMIENTO_PERSONAL_MASIVO(Convert.ToInt32(REQ_PERSONAL), ddlFOTOCHECK_F.SelectedItem.ToString(), 10); registroUpdate++; } } ChkBoxCell = null; } if (registroUpdate > 0) { cleanMessage = "Se actualización satisfactoria"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); Listar(); } }
protected void btnGuardar_Click(object sender, EventArgs e) { string cleanMessage = string.Empty; if (lblCodigo.Text.Trim() == string.Empty) { cleanMessage = "Falta seleccionar personal"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { if (ddlEtapas.SelectedIndex == 0) { cleanMessage = "Seleccionar etapa"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } //else if (txtDni.Text.Trim() == string.Empty) //{ // cleanMessage = "Ingresar N° documento"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //} else if (txtPaterno.Text.Trim() == string.Empty) { cleanMessage = "Ingresar apellido paterno"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else if (txtMaterno.Text.Trim() == string.Empty) { cleanMessage = "Ingresar apellido materno"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else if (txtNombres.Text.Trim() == string.Empty) { cleanMessage = "Ingresar nombres"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } //else if (ddlCiudad .SelectedIndex == 0) //{ // cleanMessage = "Seleccionar ciudad"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //} //else if (ddlProvincia.SelectedIndex == 0) //{ // cleanMessage = "Seleccionar provincia"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //} //else if (ddlDistrito.SelectedIndex == 0) //{ // cleanMessage = "Seleccionar distrito"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //} //else if (ddlMano .SelectedIndex == 0) //{ // cleanMessage = "Seleccionar mano de obra"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //} //else if (ddlCondicion.SelectedIndex == 0) //{ // cleanMessage = "Seleccionar condición"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //} //else if (ddlFotocheck.SelectedIndex == 0) //{ // cleanMessage = "Seleccionar fotocheck"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //} else { BE_MOD_REQUERIMIENTO_PERSONAL oBESol = new BE_MOD_REQUERIMIENTO_PERSONAL(); oBESol.REQ_PERSONAL = Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.IDE_RESPONSABLE = Session["IDE_USUARIO"].ToString(); oBESol.IDE_ETAPAS = Convert.ToInt32(ddlEtapas.SelectedValue); oBESol.DNI = txtDni.Text.Trim(); oBESol.APE_PATERNO = txtPaterno.Text.Trim(); oBESol.APE_MATERNO = txtMaterno.Text.Trim(); oBESol.NOMBRES = txtNombres.Text.Trim(); oBESol.FEC_NACIMIENTO = txtFechaNac.Text.Trim(); string UBIGEO; if (ddlDistrito.SelectedIndex == 0) { UBIGEO = string.Empty; } else { UBIGEO = ddlDistrito.SelectedValue.ToString(); } oBESol.UBIGEO = UBIGEO; oBESol.TELEFONOS = txtTelefonos.Text.Trim(); string MANO; if (ddlMano.SelectedIndex == 0) { MANO = "0"; } else { MANO = ddlMano.SelectedValue.ToString(); } oBESol.IDE_MANO_OBRA = Convert.ToInt32(MANO); string CONDICION; if (ddlCondicion.SelectedIndex == 0) { CONDICION = "0"; } else { CONDICION = ddlCondicion.SelectedValue.ToString(); } oBESol.IDE_CONDICION = Convert.ToInt32(CONDICION); oBESol.FEC_EXA_MEDICO = txtMedico.Text.Trim(); oBESol.FEC_CHARLA_TR = txtTr.Text.Trim(); oBESol.FEC_CHARLA_SSK = txtSSK.Text.Trim(); oBESol.FEC_CHARLA_ALTURA = txtAltura.Text.Trim(); oBESol.FEC_CHARLA_ESP_CONFINADO = txtEspacio.Text.Trim(); oBESol.FEC_CHARL_CALIENTE = txtCaliente.Text.Trim(); oBESol.FEC_ENTREGA_FILE_TR = txtFile.Text.Trim(); oBESol.FEC_ACCESO_PLANTA = txtPlanta.Text.Trim(); string FOTOCHECK; if (ddlFotocheck.SelectedIndex == 0) { FOTOCHECK = "0"; } else { FOTOCHECK = ddlFotocheck.SelectedValue.ToString(); } oBESol.IDE_FOTOCHECK = Convert.ToInt32(FOTOCHECK); oBESol.OBSERVACIONES = txtObservaciones.Text.Trim(); int dtrpta = 0; dtrpta = new BL_MOD_REQUERIMIENTO().uspUPD_MOD_REQUERIMIENTO_PERSONAL(oBESol); if (dtrpta > 0) { cleanMessage = "Registro exitoso."; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); CleanControl(this.Controls); Listar(); btnMasivo.Focus(); } } } }
protected void Ver(object sender, ImageClickEventArgs e) { ImageButton btnVer = ((ImageButton)sender); int item = Convert.ToInt32(btnVer.CommandArgument); GridViewRow row = btnVer.NamingContainer as GridViewRow; string REQ_PERSONAL = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); DataTable dtResultado = new DataTable(); BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); dtResultado = obj.uspSEL_MOD_REQUERIMIENTO_PERSONAL_POR_IDE(Convert.ToInt32(REQ_PERSONAL)); if (dtResultado.Rows.Count > 0) { txtDni.Focus(); lblCodigo.Text = dtResultado.Rows[0]["REQ_PERSONAL"].ToString(); txtDni.Text = dtResultado.Rows[0]["DNI"].ToString(); txtPaterno.Text = dtResultado.Rows[0]["APE_PATERNO"].ToString(); txtMaterno.Text = dtResultado.Rows[0]["APE_MATERNO"].ToString(); txtNombres.Text = dtResultado.Rows[0]["NOMBRES"].ToString(); txtFechaNac.Text = dtResultado.Rows[0]["FEC_NACIMIENTO"].ToString(); txtTelefonos.Text = dtResultado.Rows[0]["TELEFONOS"].ToString(); txtMedico.Text = dtResultado.Rows[0]["FEC_EXA_MEDICO"].ToString(); txtTr.Text = dtResultado.Rows[0]["FEC_CHARLA_TR"].ToString(); txtSSK.Text = dtResultado.Rows[0]["FEC_CHARLA_SSK"].ToString(); txtAltura.Text = dtResultado.Rows[0]["FEC_CHARLA_ALTURA"].ToString(); txtEspacio.Text = dtResultado.Rows[0]["FEC_CHARLA_ESP_CONFINADO"].ToString(); txtCaliente.Text = dtResultado.Rows[0]["FEC_CHARL_CALIENTE"].ToString(); txtFile.Text = dtResultado.Rows[0]["FEC_ENTREGA_FILE_TR"].ToString(); txtPlanta.Text = dtResultado.Rows[0]["FEC_ACCESO_PLANTA"].ToString(); txtObservaciones.Text = dtResultado.Rows[0]["OBSERVACIONES"].ToString(); string IDE_ETAPAS = dtResultado.Rows[0]["IDE_ETAPAS"].ToString(); if (IDE_ETAPAS == string.Empty) { } else { ddlEtapas.SelectedValue = IDE_ETAPAS; } string IDE_TIPO_NACIONALIDAD = dtResultado.Rows[0]["IDE_TIPO_NACIONALIDAD"].ToString(); if (IDE_TIPO_NACIONALIDAD == string.Empty) { ddlNacionalidad.SelectedIndex = 0; } else { ddlNacionalidad.SelectedValue = IDE_TIPO_NACIONALIDAD; } Cuidad(); string DES_COD_DPTO = dtResultado.Rows[0]["DES_COD_DPTO"].ToString(); if (DES_COD_DPTO == string.Empty) { } else { ddlCiudad.SelectedValue = DES_COD_DPTO; } Provincia(); string DES_CODPROV = dtResultado.Rows[0]["DES_CODPROV"].ToString(); if (DES_CODPROV == string.Empty) { } else { ddlProvincia.SelectedValue = DES_CODPROV; } Distrito(); string UBIGEO = dtResultado.Rows[0]["UBIGEO"].ToString(); if (UBIGEO == string.Empty) { } else { ddlDistrito.SelectedValue = UBIGEO; } string IDE_MANO_OBRA = dtResultado.Rows[0]["IDE_MANO_OBRA"].ToString(); if (IDE_MANO_OBRA == string.Empty) { } else { ddlMano.SelectedValue = IDE_MANO_OBRA; } string IDE_CONDICION = dtResultado.Rows[0]["IDE_CONDICION"].ToString(); if (IDE_CONDICION == string.Empty) { } else { ddlCondicion.SelectedValue = IDE_CONDICION; } string IDE_FOTOCHECK = dtResultado.Rows[0]["IDE_FOTOCHECK"].ToString(); if (IDE_FOTOCHECK == string.Empty) { } else { ddlFotocheck.SelectedValue = IDE_FOTOCHECK; } } //string IDE_MOD = GridView1.DataKeys[row.RowIndex].Values[1].ToString(); }